diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/cacerts-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/cacerts-apply-patch.sh index d74de66f6c..19515ff5dd 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/cacerts-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/cacerts-apply-patch.sh @@ -3,12 +3,13 @@ set -euo pipefail UPDATE_NEEDED=1 +CHECKOUT_SCRIPTS="${CHECKOUT_SCRIPTS:-true}" . .github/workflows/common.sh prepare_git_repo -if ! checkout_branches "${VERSION_NEW}-${TARGET}"; then +if ! checkout_branches "${VERSION_NEW}-${TARGET}" "${CHECKOUT_SCRIPTS}"; then UPDATE_NEEDED=0 exit 0 fi diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/cacerts-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/cacerts-releases-alpha.yml index 7e96061e1c..13a75af638 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/cacerts-releases-alpha.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/cacerts-releases-alpha.yml @@ -32,6 +32,8 @@ jobs: BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }} + SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }} run: .github/workflows/cacerts-apply-patch.sh - name: Create pull request for maintenance branch uses: peter-evans/create-pull-request@v3 diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/cacerts-releases-beta.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/cacerts-releases-beta.yml index fbdde125cb..070c7e142a 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/cacerts-releases-beta.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/cacerts-releases-beta.yml @@ -32,6 +32,8 @@ jobs: BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }} + SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }} run: .github/workflows/cacerts-apply-patch.sh - name: Create pull request for maintenance branch uses: peter-evans/create-pull-request@v3 diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/cacerts-releases-lts-2021.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/cacerts-releases-lts-2021.yml index 460d99c330..443d204cae 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/cacerts-releases-lts-2021.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/cacerts-releases-lts-2021.yml @@ -30,6 +30,9 @@ jobs: BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + CHECKOUT_SCRIPTS: "false" + PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }} + SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }} run: .github/workflows/cacerts-apply-patch.sh - name: Create pull request for maintenance branch uses: peter-evans/create-pull-request@v3 diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/cacerts-releases-lts.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/cacerts-releases-lts.yml index e4ed185a90..71db47da19 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/cacerts-releases-lts.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/cacerts-releases-lts.yml @@ -32,6 +32,8 @@ jobs: BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }} + SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }} run: .github/workflows/cacerts-apply-patch.sh - name: Create pull request for maintenance branch uses: peter-evans/create-pull-request@v3 diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/cacerts-releases-main.yaml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/cacerts-releases-main.yaml index 496ed45b83..962530b21e 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/cacerts-releases-main.yaml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/cacerts-releases-main.yaml @@ -29,6 +29,8 @@ jobs: BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAIN }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }} + PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }} + SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }} run: .github/workflows/cacerts-apply-patch.sh - name: Create pull request for main uses: peter-evans/create-pull-request@v3 diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/cacerts-releases-stable.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/cacerts-releases-stable.yml index c0a8d0faab..ef7f406536 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/cacerts-releases-stable.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/cacerts-releases-stable.yml @@ -32,6 +32,8 @@ jobs: BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }} + SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }} run: .github/workflows/cacerts-apply-patch.sh - name: Create pull request for maintenance branch uses: peter-evans/create-pull-request@v3 diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh index 80b0fb5834..6c6e1ba0cd 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh @@ -2,14 +2,18 @@ set -euo pipefail -readonly SDK_OUTER_TOPDIR="${HOME}/flatcar-sdk" +readonly SDK_OUTER_TOPSCRIPTSDIR="${HOME}/flatcar-sdk/scripts" +readonly SDK_OUTER_TOPDIR="${SDK_OUTER_TOPSCRIPTSDIR}/sdk_container" readonly SDK_OUTER_SRCDIR="${SDK_OUTER_TOPDIR}/src" readonly SDK_INNER_SRCDIR="/mnt/host/source/src" readonly BUILDBOT_USERNAME="Flatcar Buildbot" readonly BUILDBOT_USEREMAIL="buildbot@flatcar-linux.org" -function enter() ( cd ../../..; exec cork enter -- $@ ) +function enter() { + ${SDK_OUTER_TOPSCRIPTSDIR}/run_sdk_container -n "${PACKAGES_CONTAINER}" \ + -C "${SDK_NAME}" "$@" +} # Return a valid ebuild file name for ebuilds of the given category name, # package name, and the old version. If the single ebuild file already exists, @@ -32,36 +36,48 @@ function get_ebuild_filename() { } function prepare_git_repo() { - local our_remote_url - + # the original coreos-overlay repo outside the SDK container git config user.name "${BUILDBOT_USERNAME}" git config user.email "${BUILDBOT_USEREMAIL}" git reset --hard HEAD git fetch origin - git checkout -B "${BASE_BRANCH}" "origin/${BASE_BRANCH}" - our_remote_url=$(git remote get-url origin) - # setup overlay repo inside SDK too (be fork friendly) - git -C "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" remote add our_remote "${our_remote_url}" - git -C "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" fetch our_remote - git -C "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" checkout -B "${BASE_BRANCH}" "our_remote/${BASE_BRANCH}" + git checkout -B "${BASE_BRANCH}" "origin/${BASE_BRANCH}" + + # inside the SDK container + git -C "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" config \ + user.name "${BUILDBOT_USERNAME}" + git -C "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" config \ + user.email "${BUILDBOT_USEREMAIL}" } # caller needs to set pass a parameter as a branch name to be created. function checkout_branches() { TARGET_BRANCH=$1 + CHECKOUT_SCRIPTS=$2 [[ -z "${TARGET_BRANCH}" ]] && echo "No target branch specified. exit." && return 1 - git -C "${SDK_OUTER_SRCDIR}/scripts" checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" - git -C "${SDK_OUTER_SRCDIR}/third_party/portage-stable" checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" - - if git -C "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" show-ref "remotes/our_remote/${TARGET_BRANCH}"; then - echo "Target branch already exists. exit."; - return 1 + # Check out the scripts repo only if CHECKOUT_SCRIPTS == true, due to + # a corner case of its LTS-2021 branch does not have run_sdk_container. + if [[ "${CHECKOUT_SCRIPTS}" = true ]]; then + git -C "${SDK_OUTER_TOPSCRIPTSDIR}" checkout -B "${BASE_BRANCH}" \ + "origin/${BASE_BRANCH}" fi - git -C "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" checkout -B "${TARGET_BRANCH}" "our_remote/${BASE_BRANCH}" + # update submodules like portage-stable under the scripts directories + git submodule update --init --recursive + + if git -C "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" show-ref "remotes/origin/${TARGET_BRANCH}"; then + echo "Target branch already exists. exit."; + fi + + # Each submodule directory should be explicitly set from BASE_BRANCH, + # as the submodule refs could be only updated during the night. + git -C "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" checkout \ + -B "${TARGET_BRANCH}" "origin/${BASE_BRANCH}" + git -C "${SDK_OUTER_SRCDIR}/third_party/portage-stable" checkout \ + -B "${TARGET_BRANCH}" "origin/${BASE_BRANCH}" } function regenerate_manifest() { @@ -115,7 +131,8 @@ function generate_patches() { pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit - enter ebuild "${SDK_INNER_SRCDIR}/third_party/coreos-overlay/${CATEGORY_NAME}/${PKGNAME_SIMPLE}/${PKGNAME_SIMPLE}-${VERSION_NEW}.ebuild" manifest --force + enter ebuild "${SDK_INNER_SRCDIR}/third_party/coreos-overlay/${CATEGORY_NAME}/${PKGNAME_SIMPLE}/${PKGNAME_SIMPLE}-${VERSION_NEW}.ebuild" \ + manifest --force # We can only create the actual commit in the actual source directory, not under the SDK. # So create a format-patch, and apply to the actual source. diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-apply-patch.sh index eafdf2ac38..fa4285b55d 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-apply-patch.sh @@ -3,12 +3,13 @@ set -euo pipefail UPDATE_NEEDED=1 +CHECKOUT_SCRIPTS="${CHECKOUT_SCRIPTS:-true}" . .github/workflows/common.sh prepare_git_repo -if ! checkout_branches "containerd-${VERSION_NEW}-${TARGET}"; then +if ! checkout_branches "${VERSION_NEW}-${TARGET}" "${CHECKOUT_SCRIPTS}"; then UPDATE_NEEDED=0 exit 0 fi diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-main.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-main.yml index 0f330e7033..cf4312914a 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-main.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-main.yml @@ -32,6 +32,8 @@ jobs: VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }} COMMIT_HASH: ${{ steps.fetch-latest-release.outputs.COMMIT_MAIN }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} + PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }} + SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }} run: .github/workflows/containerd-apply-patch.sh - name: Create pull request for main uses: peter-evans/create-pull-request@v3 diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh index 2e953f33f9..75f89b6192 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh @@ -3,12 +3,13 @@ set -euo pipefail UPDATE_NEEDED=1 +CHECKOUT_SCRIPTS="${CHECKOUT_SCRIPTS:-true}" . .github/workflows/common.sh prepare_git_repo -if ! checkout_branches "docker-${VERSION_NEW}-${TARGET}"; then +if ! checkout_branches "docker-${VERSION_NEW}-${TARGET}" "${CHECKOUT_SCRIPTS}"; then UPDATE_NEEDED=0 exit 0 fi diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-main.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-main.yml index 955c6434eb..d74af68ae7 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-main.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-main.yml @@ -36,6 +36,8 @@ jobs: COMMIT_HASH: ${{ steps.fetch-latest-release.outputs.COMMIT_MAIN }} COMMIT_CLI_HASH: ${{ steps.fetch-latest-release.outputs.COMMIT_CLI }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} + PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }} + SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }} run: .github/workflows/docker-apply-patch.sh - name: Create pull request for main uses: peter-evans/create-pull-request@v3 diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/firmware-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/firmware-apply-patch.sh index 430ceec9ba..d8d8ea761b 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/firmware-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/firmware-apply-patch.sh @@ -3,12 +3,13 @@ set -euo pipefail UPDATE_NEEDED=1 +CHECKOUT_SCRIPTS="${CHECKOUT_SCRIPTS:-true}" . .github/workflows/common.sh prepare_git_repo -if ! checkout_branches "${VERSION_NEW}-${TARGET}"; then +if ! checkout_branches "${VERSION_NEW}-${TARGET}" "${CHECKOUT_SCRIPTS}"; then UPDATE_NEEDED=0 exit 0 fi diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/firmware-releases-main.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/firmware-releases-main.yml index b160fbce67..fbfcc3258c 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/firmware-releases-main.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/firmware-releases-main.yml @@ -29,6 +29,8 @@ jobs: BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAIN }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }} + PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }} + SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }} run: .github/workflows/firmware-apply-patch.sh - name: Create pull request for main uses: peter-evans/create-pull-request@v3 diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh index fdd17e680d..b34b28692d 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh @@ -19,13 +19,15 @@ for version_new in ${VERSIONS_NEW}; do VERSIONS["${version_new_trimmed}"]="${version_new}" done +CHECKOUT_SCRIPTS="${CHECKOUT_SCRIPTS:-true}" + . .github/workflows/common.sh prepare_git_repo branch_name="go-$(join_by '-and-' ${VERSIONS_NEW})-${TARGET}" -if ! checkout_branches "${branch_name}"; then +if ! checkout_branches "${branch_name}" "${CHECKOUT_SCRIPTS}"; then exit 0 fi diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-main.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-main.yml index 88cb394eb2..3804f88f00 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-main.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-main.yml @@ -34,6 +34,8 @@ jobs: BASE_BRANCH: ${{ steps.fetch-latest-releases.outputs.BASE_BRANCH_MAIN }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSIONS_NEW: ${{ steps.fetch-latest-releases.outputs.VERSIONS_MAIN }} + PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }} + SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }} run: .github/workflows/go-apply-patch.sh - name: Create pull request for main uses: peter-evans/create-pull-request@v3 diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh index 9846ccc5f8..1dc1dd35c7 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh @@ -5,12 +5,13 @@ set -euo pipefail # trim the 3rd part in the input semver, e.g. from 5.4.1 to 5.4 VERSION_SHORT=${VERSION_NEW%.*} UPDATE_NEEDED=1 +CHECKOUT_SCRIPTS="${CHECKOUT_SCRIPTS:-true}" . .github/workflows/common.sh prepare_git_repo -if ! checkout_branches "linux-${VERSION_NEW}-${TARGET}"; then +if ! checkout_branches "linux-${VERSION_NEW}-${TARGET}" "${CHECKOUT_SCRIPTS}"; then UPDATE_NEEDED=0 exit 0 fi diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml index 637933f9db..a3121e7451 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml @@ -33,6 +33,8 @@ jobs: BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }} + SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }} run: .github/workflows/kernel-apply-patch.sh - name: Create pull request for maintenance branch uses: peter-evans/create-pull-request@v3 diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml index e6fc6dc1b9..ca21f3b47c 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml @@ -33,6 +33,8 @@ jobs: BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }} + SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }} run: .github/workflows/kernel-apply-patch.sh - name: Create pull request for maintenance branch uses: peter-evans/create-pull-request@v3 diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-lts-2021.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-lts-2021.yml index b8c923e4c4..0ebc33ccda 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-lts-2021.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-lts-2021.yml @@ -33,6 +33,9 @@ jobs: BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + CHECKOUT_SCRIPTS: "false" + PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }} + SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }} run: .github/workflows/kernel-apply-patch.sh - name: Create pull request for maintenance branch uses: peter-evans/create-pull-request@v3 diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-lts.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-lts.yml index 17353c1d90..cd03aceabd 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-lts.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-lts.yml @@ -33,6 +33,8 @@ jobs: BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }} + SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }} run: .github/workflows/kernel-apply-patch.sh - name: Create pull request for maintenance branch uses: peter-evans/create-pull-request@v3 diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-main.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-main.yml index 7260583636..9c45e24520 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-main.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-main.yml @@ -31,6 +31,8 @@ jobs: BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAIN }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }} + PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }} + SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }} run: .github/workflows/kernel-apply-patch.sh - name: Create pull request for main uses: peter-evans/create-pull-request@v3 diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml index f5917eb7d8..2196470a75 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml @@ -33,6 +33,8 @@ jobs: BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }} + SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }} run: .github/workflows/kernel-apply-patch.sh - name: Create pull request for maintenance branch uses: peter-evans/create-pull-request@v3 diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh index 0efc7abd11..8e61e0b073 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh @@ -3,12 +3,13 @@ set -euo pipefail UPDATE_NEEDED=1 +CHECKOUT_SCRIPTS="${CHECKOUT_SCRIPTS:-true}" . .github/workflows/common.sh prepare_git_repo -if ! checkout_branches "runc-${VERSION_NEW}-${TARGET}"; then +if ! checkout_branches "runc-${VERSION_NEW}-${TARGET}" "${CHECKOUT_SCRIPTS}"; then UPDATE_NEEDED=0 exit 0 fi diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-main.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-main.yml index 5034ccf484..a068034285 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-main.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-main.yml @@ -36,6 +36,8 @@ jobs: VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }} COMMIT_HASH: ${{ steps.fetch-latest-release.outputs.COMMIT_MAIN }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} + PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }} + SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }} run: .github/workflows/runc-apply-patch.sh - name: Create pull request for main uses: peter-evans/create-pull-request@v3 diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh index c09ced47ac..3cd5c50a0a 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh @@ -3,12 +3,13 @@ set -euo pipefail UPDATE_NEEDED=1 +CHECKOUT_SCRIPTS="${CHECKOUT_SCRIPTS:-true}" . .github/workflows/common.sh prepare_git_repo -if ! checkout_branches "rust-${VERSION_NEW}-${TARGET}"; then +if ! checkout_branches "rust-${VERSION_NEW}-${TARGET}" "${CHECKOUT_SCRIPTS}"; then UPDATE_NEEDED=0 exit 0 fi diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-main.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-main.yml index ba71db6f26..f564865163 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-main.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-main.yml @@ -29,6 +29,8 @@ jobs: BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAIN }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }} + PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }} + SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }} run: .github/workflows/rust-apply-patch.sh - name: Create pull request for main id: create-pull-request diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/setup-flatcar-sdk.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/setup-flatcar-sdk.sh index 6c7c06ecc4..08ef96bf37 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/setup-flatcar-sdk.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/setup-flatcar-sdk.sh @@ -2,62 +2,51 @@ set -euo pipefail -sudo apt-get install -y lbzip2 +sudo ln -sfn /bin/bash /bin/sh +sudo apt-get install -y ca-certificates curl git gnupg lbzip2 lsb-release \ + qemu-user-static +sudo mkdir -p /etc/apt/keyrings +curl -fsSL https://download.docker.com/linux/ubuntu/gpg \ + | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg +echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] \ + https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \ + | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null +sudo apt-get update +sudo apt-get install -y docker-ce docker-ce-cli containerd.io \ + docker-compose-plugin -CORK_VERSION=$(curl -sL https://api.github.com/repos/kinvolk/mantle/releases/latest | jq -r .tag_name | sed -e 's/^v//') -curl -L -o cork https://github.com/kinvolk/mantle/releases/download/v"${CORK_VERSION}"/cork-"${CORK_VERSION}"-amd64 -curl -L -o cork.sig https://github.com/kinvolk/mantle/releases/download/v"${CORK_VERSION}"/cork-"${CORK_VERSION}"-amd64.sig -curl -LO https://kinvolk.io/flatcar-container-linux/security/image-signing-key/Flatcar_Image_Signing_Key.asc -gpg --import Flatcar_Image_Signing_Key.asc -gpg --verify cork.sig cork -rm -f cork.sig Flatcar_Image_Signing_Key.asc -chmod +x cork -mkdir -p ~/.local/bin -mv cork ~/.local/bin - -export PATH=$PATH:$HOME/.local/bin mkdir -p ~/flatcar-sdk +git -C ~/flatcar-sdk clone https://github.com/flatcar-linux/scripts -pushd ~/flatcar-sdk || exit -cork create || true +pushd ~/flatcar-sdk/scripts || exit -sudo tee "./chroot/etc/portage/make.conf" <