@@ -516,6 +516,7 @@ function build_addon() {
516
516
if bashio::fs.file_exists " /tmp/build_config/build.json" ; then
517
517
build_from=" $( jq --raw-output " .build_from.$build_arch // empty" " /tmp/build_config/build.json" ) "
518
518
args=" $( jq --raw-output ' .args // empty | keys[]' " /tmp/build_config/build.json" ) "
519
+ labels=" $( jq --raw-output ' .labels // empty | keys[]' " /tmp/build_config/build.json" ) "
519
520
shadow_repository=" $( jq --raw-output ' .shadow_repository // empty' " /tmp/build_config/build.json" ) "
520
521
fi
521
522
@@ -532,13 +533,21 @@ function build_addon() {
532
533
done
533
534
fi
534
535
536
+ # Additional build labels
537
+ if bashio::var.has_value " ${labels} " ; then
538
+ for label in ${labels} ; do
539
+ value=" $( jq --raw-output " .labels.\" ${label} \" " " /tmp/build_config/build.json" ) "
540
+ docker_cli+=(" --label" " ${label} =${value} " )
541
+ done
542
+ fi
543
+
535
544
# Read addon config.json
536
545
name=" $( jq --raw-output ' .name // empty' " /tmp/build_config/config.json" | sed " s/'//g" ) "
537
546
description=" $( jq --raw-output ' .description // empty' " /tmp/build_config/config.json" | sed " s/'//g" ) "
538
547
url=" $( jq --raw-output ' .url // empty' " /tmp/build_config/config.json" ) "
539
548
raw_image=" $( jq --raw-output ' .image // empty' " /tmp/build_config/config.json" ) "
540
549
mapfile -t supported_arch < <( jq --raw-output ' .arch // empty' " /tmp/build_config/config.json" )
541
-
550
+
542
551
# Read version from config.json when VERSION is not set
543
552
if [ -n " $VERSION " ]; then
544
553
version=" $VERSION "
@@ -740,7 +749,7 @@ function cosign_sign() {
740
749
if bashio::var.false " ${DOCKER_PUSH} " || bashio::var.false " ${COSIGN} " ; then
741
750
return 0
742
751
fi
743
-
752
+
744
753
for j in {1..6}; do
745
754
if cosign sign --yes " ${image} " ; then
746
755
success=true
0 commit comments