From 4efb14c2a3b1ad0cf05ce68f7e009286a9b2fb11 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Thu, 2 Apr 2020 10:20:52 +0200 Subject: [PATCH] .github: check out correct base branches before applying patches Before starting to apply patches inside `coreos-overlay`, we need to check out base branches, also for `scripts` and `portage-stable`. Otherwise, in case of Beta, Alpha, or Edge, `ebuild` commands could fail due to mismatch of ebuild files across multiple repos like `coreos-overlay` and `portage-stable`. --- .../coreos-overlay/.github/workflows/docker-apply-patch.sh | 5 ++++- .../coreos-overlay/.github/workflows/go-apply-patch.sh | 5 ++++- .../coreos-overlay/.github/workflows/kernel-apply-patch.sh | 5 ++++- .../coreos-overlay/.github/workflows/runc-apply-patch.sh | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-) 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 6fb563fa83..2591579fb0 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 @@ -4,7 +4,10 @@ set -euo pipefail branch="docker-${VERSION_NEW}" -pushd ~/flatcar-sdk/src/third_party/coreos-overlay || exit +git -C ~/flatcar-sdk/src/scripts checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" +git -C ~/flatcar-sdk/src/third_party/portage-stable checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" + +pushd ~/flatcar-sdk/src/third_party/coreos-overlay >/dev/null || exit git checkout -B "${branch}" "github/${BASE_BRANCH}" VERSION_OLD=$(sed -n "s/^DIST docker-\([0-9]*.[0-9]*.[0-9]*\).*/\1/p" app-emulation/docker/Manifest | sort -ruV | head -n1) 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 3e6b3cefa3..12cf6af095 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 @@ -4,7 +4,10 @@ set -euo pipefail branch="go-${VERSION_NEW}" -pushd ~/flatcar-sdk/src/third_party/coreos-overlay || exit +git -C ~/flatcar-sdk/src/scripts checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" +git -C ~/flatcar-sdk/src/third_party/portage-stable checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" + +pushd ~/flatcar-sdk/src/third_party/coreos-overlay >/dev/null || exit git checkout -B "${branch}" "github/${BASE_BRANCH}" versionOld=$(sed -n "s/^DIST go\(${GO_VERSION}.[0-9]*\).*/\1/p" dev-lang/go/Manifest | sort -ruV | head -n1) 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 b4c68a54c5..47e28e29b6 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 @@ -4,7 +4,10 @@ set -euo pipefail branch="linux-${VERSION_NEW}" -pushd ~/flatcar-sdk/src/third_party/coreos-overlay || exit +git -C ~/flatcar-sdk/src/scripts checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" +git -C ~/flatcar-sdk/src/third_party/portage-stable checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" + +pushd ~/flatcar-sdk/src/third_party/coreos-overlay >/dev/null || exit git checkout -B "${branch}" "github/${BASE_BRANCH}" versionOld=$(sed -n "s/^DIST patch-\(${KERNEL_VERSION}.[0-9]*\).*/\1/p" sys-kernel/coreos-sources/Manifest) 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 333ac621fb..28ee335f2a 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 @@ -4,7 +4,10 @@ set -euo pipefail branch="runc-${VERSION_NEW}" -pushd ~/flatcar-sdk/src/third_party/coreos-overlay || exit +git -C ~/flatcar-sdk/src/scripts checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" +git -C ~/flatcar-sdk/src/third_party/portage-stable checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" + +pushd ~/flatcar-sdk/src/third_party/coreos-overlay >/dev/null || exit git checkout -B "${branch}" "github/${BASE_BRANCH}" # Get the original runc version, including official releases and rc versions.