forked from containers/automation_images
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request containers#304 from cevich/fix_jq_null_iteration
Latest common automation library on build-push VM
- Loading branch information
Showing
5 changed files
with
39 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
20230920t195830z-f38f37d13 | ||
20230921t145748z-f38f37d13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ if [[ -r "/etc/automation_environment" ]]; then | |
source /etc/automation_environment # defines AUTOMATION_LIB_PATH | ||
#shellcheck disable=SC1090,SC2154 | ||
source "$AUTOMATION_LIB_PATH/common_lib.sh" | ||
dbg "Using automation common library version $(<$AUTOMATION_LIB_PATH/../AUTOMATION_VERSION)" | ||
else | ||
echo "Expecting to find automation common library installed." | ||
exit 1 | ||
|
@@ -123,6 +124,15 @@ cd "$CLONE_TMP" | |
head_sha=$(git rev-parse HEAD) | ||
dbg "HEAD is $head_sha" | ||
|
||
# Docs should always be in one of two places, otherwise don't list any. | ||
DOCS_URL="" | ||
for _docs_subdir in "$CTX_SUB/README.md" "$(dirname $CTX_SUB)/README.md"; do | ||
if [[ -r "./$_docs_subdir" ]]; then | ||
dbg "Found README.md under '$CLONE_TMP/$_docs_subdir'" | ||
DOCS_URL="${REPO_URL%.git}/blob/${head_sha}/$_docs_subdir" | ||
fi | ||
done | ||
|
||
req_env_vars CIRRUS_TASK_ID CIRRUS_CHANGE_IN_REPO CIRRUS_REPO_NAME | ||
|
||
# Labels to add to all images as per | ||
|
@@ -139,10 +149,15 @@ for arg in "--label" "--annotation"; do | |
"$arg=org.opencontainers.image.source=${REPO_URL%.git}/blob/${head_sha}/${CTX_SUB}/" | ||
"$arg=org.opencontainers.image.revision=$head_sha" | ||
"$arg=org.opencontainers.image.created=$(date -u --iso-8601=seconds)" | ||
"$arg=org.opencontainers.image.documentation=${REPO_URL%.git}/tree/$CTX_SUB/README.md" | ||
"$arg[email protected]" | ||
) | ||
|
||
if [[ -n "$DOCS_URL" ]]; then | ||
label_args+=(\ | ||
"$arg=org.opencontainers.image.documentation=${DOCS_URL}" | ||
) | ||
fi | ||
|
||
# Perhaps slightly outside the intended purpose, but it kind of fits, and may help | ||
# somebody ascertain provenance a little better. Note: Even if the console logs | ||
# are blank, the Cirrus-CI GraphQL API keeps build and task metadata for years. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters