You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if [[ $(git rev-parse HEAD)!="${branch_hash}" ]];then
93
+
echo"We are doing a nightly build but we are not on top of the ${branch_name} branch. This is wrong and would result in the nightly tag not being a part of the branch.">&2
94
+
exit 1
95
+
fi
96
+
target_branch=${branch_name}
85
97
# Check for the existing tag only when we allow shortcutting
86
98
# the builds. That way we can skip the checks for build
87
99
# shortcutting.
88
100
if bool_is_true "${AVOID_NIGHTLY_BUILD_SHORTCUTS}";then
89
101
echo"Continuing the build because AVOID_NIGHTLY_BUILD_SHORTCUTS is bool true (${AVOID_NIGHTLY_BUILD_SHORTCUTS})">&2
90
102
else
91
-
existing_tag=$(git tag --points-at HEAD)# exit code is always 0, output may be empty
103
+
git fetch --all --tags --force
104
+
# exit code of git tag is always 0; output may be empty,
105
+
# but may also have multiple tags
106
+
mapfile -t existing_tags <<(git tag --points-at HEAD)
92
107
fi
93
-
# If the found tag is a release or nightly tag, we stop this build if there are no changes
94
-
if [[ "${existing_tag}"=~${nightly_pattern_2} ]];then
95
-
local ret=0
96
-
git diff --exit-code "${existing_tag}"|| ret=$?
97
-
if [[ ret -eq 0 ]];then
98
-
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} and the Flatcar images exist">&2
133
+
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 ${nightly_or_release_tag} and the Flatcar images exist">&2
102
134
return 0
103
135
fi
104
136
echo"No changes but continuing build because Flatcar images do not exist"
105
-
elif [[ ret -eq 1 ]];then
106
-
echo"Found changes since last tag ${existing_tag}">&2
107
-
else
137
+
elif [[ ret -eq 1 ]];then
138
+
echo"HEAD is tagged with a nightly tag and yet there a differences? This is fishy and needs to be investigated. Maybe you forgot to commit your changes?">&2
0 commit comments