scripts: label images with prind version

This commit is contained in:
Markus Küffner
2022-10-18 20:15:22 +02:00
parent e43facb76b
commit cb1e374017

View File

@@ -26,11 +26,13 @@ shortref=$(echo -n ${ref} | cut -c 1-7)
# Set label Values # Set label Values
label_date=$(date --rfc-3339=seconds) label_date=$(date --rfc-3339=seconds)
if [ "${CI}" == "true" ]; then if [ "${CI}" == "true" ]; then
label_prind_version="${GITHUB_SHA}"
label_author="${GITHUB_REPOSITORY_OWNER}" label_author="${GITHUB_REPOSITORY_OWNER}"
label_url="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" label_url="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}"
label_doc="${label_url}/blob/main/docker/${app}/README.md" label_doc="${label_url}/blob/main/docker/${app}/README.md"
label_src="${label_url}/blob/main/docker/${app}" label_src="${label_url}/blob/main/docker/${app}"
else else
label_prind_version="$(git rev-parse HEAD)"
label_author="$(whoami)" label_author="$(whoami)"
label_url="local" label_url="local"
label_doc="local" label_doc="local"
@@ -61,6 +63,7 @@ for target in $(grep "FROM .* as" ${dockerfile} | sed -r 's/.*FROM.*as (.*)/\1/g
--tag ${registry}${app}:${shortref}${tag_extra} \ --tag ${registry}${app}:${shortref}${tag_extra} \
--tag ${registry}${app}:nightly${tag_extra} \ --tag ${registry}${app}:nightly${tag_extra} \
--tag ${registry}${app}:latest${tag_extra} \ --tag ${registry}${app}:latest${tag_extra} \
--label org.prind.version=${label_prind_version} \
--label org.prind.image.created="${label_date}" \ --label org.prind.image.created="${label_date}" \
--label org.prind.image.authors="${label_author}" \ --label org.prind.image.authors="${label_author}" \
--label org.prind.image.url="${label_url}" \ --label org.prind.image.url="${label_url}" \
@@ -82,6 +85,7 @@ for target in $(grep "FROM .* as" ${dockerfile} | sed -r 's/.*FROM.*as (.*)/\1/g
--build-arg VERSION=${tag} \ --build-arg VERSION=${tag} \
--platform ${platform} \ --platform ${platform} \
--tag ${registry}${app}:${tag}${tag_extra} \ --tag ${registry}${app}:${tag}${tag_extra} \
--label org.prind.version=${label_prind_version} \
--label org.prind.image.created="${label_date}" \ --label org.prind.image.created="${label_date}" \
--label org.prind.image.authors="${label_author}" \ --label org.prind.image.authors="${label_author}" \
--label org.prind.image.url="${label_url}" \ --label org.prind.image.url="${label_url}" \