diff options
| author | Lars Kellogg-Stedman <lars@redhat.com> | 2014-10-05 00:03:19 -0400 |
|---|---|---|
| committer | Lars Kellogg-Stedman <lars@redhat.com> | 2014-10-05 21:29:53 -0400 |
| commit | cf9440005a3ff067666e898a9b6b0d44a98a0516 (patch) | |
| tree | bf80d4f3e97e47ab6e9cd4745736f704343bd4e7 | |
| parent | 82536f830ea68a328ef5697bd6fac08b827a8e50 (diff) | |
| download | kolla-cf9440005a3ff067666e898a9b6b0d44a98a0516.tar.gz kolla-cf9440005a3ff067666e898a9b6b0d44a98a0516.zip | |
fix issues with build-docker-image
- fix typo in --namespace option
build-docker-image had a missing '$' in the code that handled the
--namespace option.
- force builds to kollaglue namespace with 'latest' tag to use
the --release flag
- build IMAGE after config and options processing to permit overriding
PREFIX in .buildconf
Change-Id: Icf70b33080ef19643f133f2b6f60087c524bd4fb
| -rwxr-xr-x | tools/build-docker-image | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/tools/build-docker-image b/tools/build-docker-image index 66e534fa4..469c63207 100755 --- a/tools/build-docker-image +++ b/tools/build-docker-image @@ -1,11 +1,11 @@ #!/bin/bash +TOPDIR=$(git rev-parse --show-toplevel) + +RELEASE_NAMESPACE=kollaglue NAMESPACE=kollaglue PREFIX=fedora-rdo- TAG=$(git rev-parse --short HEAD) -IMAGE="${PREFIX}${PWD##*/}" - -TOPDIR=$(git rev-parse --show-toplevel) usage () { cat <<EOF @@ -36,6 +36,7 @@ while :; do ;; (--release) MODE=release + NAMESPACE=$RELEASE_NAMESPACE TAG=latest ;; @@ -52,7 +53,7 @@ while :; do (--namespace|-n) shift - NAMESPACE="1" + NAMESPACE="$1" ;; (--) break @@ -63,6 +64,15 @@ while :; do shift done +if [ "$NAMESPACE" = "$RELEASE_NAMESPACE" ] \ + && [ "$TAG" = "latest" ] \ + && ! [ "$MODE" = "release" ]; then + + echo "ERROR: use --release to build a release image" >&2 + exit 1 +fi + +IMAGE="${PREFIX}${PWD##*/}" FULLIMAGE="${NAMESPACE}/${IMAGE}${TAG:+:${TAG}}" cat <<EOF |
