-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NO NEW TESTS NEEDED] Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
- Loading branch information
Showing
4 changed files
with
124 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: MACHINE IMAGE TRIAL | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
env: | ||
COSA_NO_KVM: 1 | ||
|
||
jobs: | ||
setup: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Pull coreos-assembler image | ||
run: podman pull quay.io/coreos-assembler/coreos-assembler | ||
|
||
- name: Create cosa bash alias | ||
run: source ./contrib/podman-next/fcos-podmanimage/cosa-snippet | ||
|
||
- name: Create fcos work dir | ||
run: mkdir /fcos | ||
|
||
build: | ||
needs: setup | ||
defaults: | ||
run: | ||
working-directory: /fcos | ||
|
||
steps: | ||
- name: cosa init | ||
shell: bash -l {0} | ||
run: cosa init https://github.com/coreos/fedora-coreos-config | ||
|
||
- name: cosa fetch | ||
shell: bash -l {0} | ||
run: cosa fetch | ||
|
||
- name: cosa build | ||
shell: bash -l {0} | ||
run: cosa build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
cosa() { | ||
env | grep COREOS_ASSEMBLER | ||
local -r COREOS_ASSEMBLER_CONTAINER_LATEST="quay.io/coreos-assembler/coreos-assembler:latest" | ||
if [[ -z ${COREOS_ASSEMBLER_CONTAINER} ]] && $(podman image exists ${COREOS_ASSEMBLER_CONTAINER_LATEST}); then | ||
local -r cosa_build_date_str="$(podman inspect -f "{{.Created}}" ${COREOS_ASSEMBLER_CONTAINER_LATEST} | awk '{print $1}')" | ||
local -r cosa_build_date="$(date -d ${cosa_build_date_str} +%s)" | ||
if [[ $(date +%s) -ge $((cosa_build_date + 60*60*24*7)) ]] ; then | ||
echo -e "\e[0;33m----" >&2 | ||
echo "The COSA container image is more that a week old and likely outdated." >&2 | ||
echo "You should pull the latest version with:" >&2 | ||
echo "podman pull ${COREOS_ASSEMBLER_CONTAINER_LATEST}" >&2 | ||
echo -e "----\e[0m" >&2 | ||
sleep 10 | ||
fi | ||
fi | ||
set -x | ||
podman run --rm -ti --security-opt=label=disable --privileged \ | ||
--uidmap=1000:0:1 --uidmap=0:1:1000 --uidmap=1001:1001:64536 \ | ||
-v=${PWD}:/srv/ --device=/dev/kvm --device=/dev/fuse \ | ||
--tmpfs=/tmp -v=/var/tmp:/var/tmp --name=cosa \ | ||
${COREOS_ASSEMBLER_CONFIG_GIT:+-v=$COREOS_ASSEMBLER_CONFIG_GIT:/srv/src/config/:ro} \ | ||
${COREOS_ASSEMBLER_GIT:+-v=$COREOS_ASSEMBLER_GIT/src/:/usr/lib/coreos-assembler/:ro} \ | ||
${COREOS_ASSEMBLER_ADD_CERTS:+-v=/etc/pki/ca-trust:/etc/pki/ca-trust:ro} \ | ||
${COREOS_ASSEMBLER_CONTAINER_RUNTIME_ARGS} \ | ||
${COREOS_ASSEMBLER_CONTAINER:-$COREOS_ASSEMBLER_CONTAINER_LATEST} "$@" | ||
rc=$?; set +x; return $rc | ||
} |