Merge pull request #509 from flatcar/kai/nightly-after-failure

ci-automation: Don't skip nightly build when the previous one failed
This commit is contained in:
Kai Lüke 2022-09-26 17:17:35 +02:00 committed by GitHub
commit 9620468a81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 7 deletions

View File

@ -161,7 +161,7 @@ function image_exists_locally() {
# -- # --
# Derive docker-safe image version string from vernum. # Derive docker-safe image version string from vernum.
# # Keep in sync with sdk_lib/sdk_container_common.sh
function vernum_to_docker_image_version() { function vernum_to_docker_image_version() {
local vernum="$1" local vernum="$1"
echo "$vernum" | sed 's/[+]/-/g' echo "$vernum" | sed 's/[+]/-/g'

View File

@ -98,9 +98,13 @@ function _packages_tag_impl() {
local ret=0 local ret=0
git diff --exit-code "${existing_tag}" || ret=$? git diff --exit-code "${existing_tag}" || ret=$?
if [[ ret -eq 0 ]]; then if [[ ret -eq 0 ]]; then
touch ./skip-build if curl --head --fail --silent --show-error --location "https://${BUILDCACHE_SERVER}/images/amd64/${FLATCAR_VERSION}/flatcar_production_image.bin.bz2"
echo "Creating ./skip-build flag file, indicating that the build must not to continue because no new tag got created as there are no changes since tag ${existing_tag}" >&2 && curl --head --fail --silent --show-error --location "https://${BUILDCACHE_SERVER}/images/arm64/${FLATCAR_VERSION}/flatcar_production_image.bin.bz2"; then
return 0 touch ./skip-build
echo "Creating ./skip-build flag file, indicating that the build must not to continue because no new tag got created as there are no changes since tag ${existing_tag} and the Flatcar images exist" >&2
return 0
fi
echo "No changes but continuing build because Flatcar images do not exist"
elif [[ ret -eq 1 ]]; then elif [[ ret -eq 1 ]]; then
echo "Found changes since last tag ${existing_tag}" >&2 echo "Found changes since last tag ${existing_tag}" >&2
else else

View File

@ -106,8 +106,15 @@ function _sdk_bootstrap_impl() {
local ret=0 local ret=0
git diff --exit-code "${existing_tag}" || ret=$? git diff --exit-code "${existing_tag}" || ret=$?
if [ "$ret" = "0" ]; then if [ "$ret" = "0" ]; then
echo "Stopping build because there are no changes since tag ${existing_tag}" >&2 local sdk_docker_vernum=""
return 0 sdk_docker_vernum=$(vernum_to_docker_image_version "${FLATCAR_SDK_VERSION}")
if curl --head --fail --silent --show-error --location "https://${BUILDCACHE_SERVER}/containers/${FLATCAR_SDK_VERSION}/flatcar-sdk-all-${sdk_docker_vernum}.tar.gz"
&& curl --head --fail --silent --show-error --location "https://${BUILDCACHE_SERVER}/images/amd64/${FLATCAR_VERSION}/flatcar_production_image.bin.bz2"
&& curl --head --fail --silent --show-error --location "https://${BUILDCACHE_SERVER}/images/arm64/${FLATCAR_VERSION}/flatcar_production_image.bin.bz2"; then
echo "Stopping build because there are no changes since tag ${existing_tag}, the SDK container tar ball and the Flatcar images exist" >&2
return 0
fi
echo "No changes but continuing build because SDK container tar ball and/or the Flatcar images do not exist" >&2
elif [ "$ret" = "1" ]; then elif [ "$ret" = "1" ]; then
echo "Found changes since last tag ${existing_tag}" >&2 echo "Found changes since last tag ${existing_tag}" >&2
else else

View File

@ -134,7 +134,7 @@ function strip_version_prefix() {
# -- # --
# Derive docker-safe image version string from vernum. # Derive docker-safe image version string from vernum.
# # Keep in sync with ci-automation/ci_automation_common.sh
function vernum_to_docker_image_version() { function vernum_to_docker_image_version() {
local vernum="$1" local vernum="$1"
echo "$vernum" | sed 's/[+]/-/g' echo "$vernum" | sed 's/[+]/-/g'