From d7a3bed17adf55fe42130cdbf4874fc40137d737 Mon Sep 17 00:00:00 2001 From: xiekeyang Date: Fri, 6 Jul 2018 17:52:44 +0800 Subject: [PATCH] add NOBUILD ARG to script --- build/Dockerfile | 4 ++-- build/docker.sh | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/build/Dockerfile b/build/Dockerfile index f5a3184e..a496ff7b 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -7,7 +7,7 @@ WORKDIR /go/src/github.com/fission/fission-workflows COPY . . -RUN if [ "_$NOBUILD" = "_" ] ; then \ +RUN if ! $NOBUILD ; then \ go get github.com/Masterminds/glide; \ glide install -v; \ build/build-linux.sh; \ @@ -19,4 +19,4 @@ RUN if [ "_$NOBUILD" = "_" ] ; then \ FROM scratch COPY --from=builder /go/src/github.com/fission/fission-workflows/fission-workflows-bundle /fission-workflows-bundle -COPY --from=builder /go/src/github.com/fission/fission-workflows/wfcli /wfcli \ No newline at end of file +COPY --from=builder /go/src/github.com/fission/fission-workflows/wfcli /wfcli diff --git a/build/docker.sh b/build/docker.sh index c43fa0b1..deb5c415 100755 --- a/build/docker.sh +++ b/build/docker.sh @@ -8,11 +8,12 @@ set -eo pipefail BUILD_ROOT=$(dirname $0) IMAGE_REPO=${1:-fission} IMAGE_TAG=${2:-latest} +NOBUILD=${3:-false} # Build bundle images bundleImage=${IMAGE_REPO}/fission-workflows-bundle pushd ${BUILD_ROOT}/.. -if [ ! -z "$NOBUILD" ]; then +if $NOBUILD ; then if [ ! -f ./fission-workflows-bundle ]; then echo "Executable './fission-workflows-bundle' not found!" exit 1; @@ -47,4 +48,4 @@ docker build --tag="${IMAGE_REPO}/wfcli:${IMAGE_TAG}" ${BUILD_ROOT}/wfcli/ \ --build-arg BUNDLE_TAG=${IMAGE_TAG} # Remove intermediate images -# docker rmi $(docker images -f "dangling=true" -q) \ No newline at end of file +# docker rmi $(docker images -f "dangling=true" -q)