From 0e36d60a74af3df38141c2ddd2786eb3e0a59f42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Mon, 13 Dec 2021 16:30:19 +0100 Subject: [PATCH] Add additional-tag argument (#125) --- README.md | 2 ++ builder.sh | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/README.md b/README.md index 4a42e86..c05deb7 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,8 @@ Options: Additional version information like for base images. --release-tag Use this as main tag. + --additional-tag + Add additional tags that will be published --version-from Use this to set build_from tag if not specified. Architecture diff --git a/builder.sh b/builder.sh index 41655d2..94f1a3e 100755 --- a/builder.sh +++ b/builder.sh @@ -28,6 +28,7 @@ VERSION_BASE= VERSION_FROM= IMAGE= RELEASE= +ADDITIONAL_TAGS=() BUILD_LIST=() BUILD_TYPE="addon" BUILD_TASKS=() @@ -81,6 +82,8 @@ Options: Additional version information like for base images. --release-tag Use this as main tag. + --additional-tag + Add additional tags that will be published --version-from Use this to set build_from tag if not specified. @@ -292,6 +295,11 @@ function run_build() { docker_tags+=("latest") fi + # Add additional tags + for tag_image in "${ADDITIONAL_TAGS[@]}"; do + docker_tags+=("${tag_image}") + done + # Tag images for tag_image in "${docker_tags[@]}"; do bashio::log.info "Create image tag: ${tag_image}" @@ -812,6 +820,10 @@ while [[ $# -gt 0 ]]; do --test) DOCKER_PUSH=false ;; + --additional-tag) + ADDITIONAL_TAGS+=("$2") + shift + ;; --no-cache) DOCKER_CACHE=false ;;