Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci-automation/ci_automation_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function image_exists_locally() {
# --

# Derive docker-safe image version string from vernum.
#
# Keep in sync with sdk_lib/sdk_container_common.sh
function vernum_to_docker_image_version() {
local vernum="$1"
echo "$vernum" | sed 's/[+]/-/g'
Expand Down
10 changes: 7 additions & 3 deletions ci-automation/packages-tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,13 @@ function _packages_tag_impl() {
local ret=0
git diff --exit-code "${existing_tag}" || ret=$?
if [[ ret -eq 0 ]]; then
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}" >&2
return 0
if curl --head --fail --silent --show-error --location "https://${BUILDCACHE_SERVER}/images/amd64/${FLATCAR_VERSION}/flatcar_production_image.bin.bz2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if curl --head --fail --silent --show-error --location "https://${BUILDCACHE_SERVER}/images/amd64/${FLATCAR_VERSION}/flatcar_production_image.bin.bz2"
if curl --head --fail --silent --show-error --location "https://${BUILDCACHE_SERVER}/images/amd64/${FLATCAR_VERSION}/flatcar_production_image.bin.bz2" \

Otherwise it fails as currently:

17:20:48  jenkins/systemd-run-wrap.sh: ci-automation/packages-tag.sh: line 102: syntax error near unexpected token `&&'
17:20:48  jenkins/systemd-run-wrap.sh: ci-automation/packages-tag.sh: line 102: `              && curl --head --fail --silent --show-error --location "[https://${BUILDCACHE_SERVER}/images/arm64/${FLATCAR_VERSION}/flatcar_production_image.bin.bz2](https://${buildcache_server}/images/arm64/$%7BFLATCAR_VERSION%7D/flatcar_production_image.bin.bz2)"; then'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just seen the fixing commit. Thanks!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, sorry

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lesson learnt: run shellcheck all the time^^

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be we could add a simple github actions running shellcheck on PR?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shellcheck -x --severity=warning is still a bit noisy until we fix the warnings, just =error isn't very helpful on the other hand.

&& curl --head --fail --silent --show-error --location "https://${BUILDCACHE_SERVER}/images/arm64/${FLATCAR_VERSION}/flatcar_production_image.bin.bz2"; then
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
echo "Found changes since last tag ${existing_tag}" >&2
else
Expand Down
11 changes: 9 additions & 2 deletions ci-automation/sdk_bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,15 @@ function _sdk_bootstrap_impl() {
local ret=0
git diff --exit-code "${existing_tag}" || ret=$?
if [ "$ret" = "0" ]; then
echo "Stopping build because there are no changes since tag ${existing_tag}" >&2
return 0
local sdk_docker_vernum=""
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
echo "Found changes since last tag ${existing_tag}" >&2
else
Expand Down
2 changes: 1 addition & 1 deletion sdk_lib/sdk_container_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function strip_version_prefix() {
# --

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