|
7 | 7 |
|
8 | 8 | #### Variable #### |
9 | 9 |
|
| 10 | +NAMESPACE= |
10 | 11 | DOCKER_TIMEOUT=20 |
11 | 12 | DOCKER_PID=-1 |
12 | 13 | DOCKER_HUB= |
@@ -104,6 +105,8 @@ Options: |
104 | 105 | Use same tag as cache tag instead latest. |
105 | 106 | --cache-tag <TAG> |
106 | 107 | Use a custom tag for the build cache. |
| 108 | + -n, --namespace <NAMESPACE> |
| 109 | + Set or overwrite name of personal account or organization to build from. |
107 | 110 | -d, --docker-hub <DOCKER_REPOSITORY> |
108 | 111 | Set or overwrite the docker repository. |
109 | 112 | --docker-hub-check |
@@ -440,6 +443,8 @@ function build_base() { |
440 | 443 | if ! bashio::var.has_value "${raw_image}"; then |
441 | 444 | bashio::log.error "Can't find the image tag on build.json" |
442 | 445 | return 1 |
| 446 | + elif bashio::var.has_value "${NAMESPACE}"; then |
| 447 | + raw_image="${raw_image%%/*}/${NAMESPACE}/${raw_image##*/}" |
443 | 448 | fi |
444 | 449 | repository="${raw_image%/*}" |
445 | 450 | image="${raw_image##*/}" |
@@ -545,6 +550,9 @@ function build_addon() { |
545 | 550 |
|
546 | 551 | # Read data from image |
547 | 552 | if [ -n "$raw_image" ]; then |
| 553 | + if bashio::var.has_value "${NAMESPACE}"; then |
| 554 | + raw_image="${raw_image%%/*}/${NAMESPACE}/${raw_image##*/}" |
| 555 | + fi |
548 | 556 | repository="${raw_image%/*}" |
549 | 557 | image="${raw_image##*/}" |
550 | 558 | fi |
@@ -598,6 +606,8 @@ function build_generic() { |
598 | 606 | if ! bashio::var.has_value "$raw_image"; then |
599 | 607 | bashio::log.error "Can't find the image tag on build.json" |
600 | 608 | return 1 |
| 609 | + elif bashio::var.has_value "${NAMESPACE}"; then |
| 610 | + raw_image="${raw_image%%/*}/${NAMESPACE}/${raw_image##*/}" |
601 | 611 | fi |
602 | 612 | repository="${raw_image%/*}" |
603 | 613 | image="${raw_image##*/}" |
@@ -660,6 +670,11 @@ function build_machine() { |
660 | 670 | docker_cli+=("--file" "${TARGET}/${build_machine}") |
661 | 671 | fi |
662 | 672 |
|
| 673 | + if bashio::var.has_value "${raw_image}"; then |
| 674 | + if bashio::var.has_value "${NAMESPACE}"; then |
| 675 | + raw_image="${raw_image%%/*}/${NAMESPACE}/${raw_image##*/}" |
| 676 | + fi |
| 677 | + fi |
663 | 678 | repository="${raw_image%/*}" |
664 | 679 | image="${raw_image##*/}" |
665 | 680 |
|
@@ -878,6 +893,10 @@ while [[ $# -gt 0 ]]; do |
878 | 893 | VERSION_FROM=$2 |
879 | 894 | shift |
880 | 895 | ;; |
| 896 | + -n|--namespace) |
| 897 | + NAMESPACE=$2 |
| 898 | + shift |
| 899 | + ;; |
881 | 900 | --docker-hub-check) |
882 | 901 | DOCKER_HUB_CHECK=true |
883 | 902 | ;; |
|
0 commit comments