From f0fbf664d4757c5333cc4127be8e433ae9c87c36 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 2 Oct 2017 16:39:37 -0400 Subject: [PATCH] versioning and tagging --- Dockerfile | 2 +- build.sh | 42 +++++++++++++++++++++++++++++++----------- 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6e83707098..cbd9b74e05 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM bitwarden/server +FROM bitwarden/server:beta WORKDIR /app COPY ./dist . diff --git a/build.sh b/build.sh index 4a335ad71b..4b7bda8afd 100644 --- a/build.sh +++ b/build.sh @@ -4,16 +4,36 @@ set -e DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" echo "" -echo "# Building Web" -echo "" -echo "Building app" -echo "npm version $(npm --version)" -echo "gulp version $(gulp --version)" -npm install -gulp dist:selfHosted +if [ $# -gt 0 -a "$1" == "push" ] +then + echo "# Pushing Web" + echo "" + + if [ $# -gt 1 ] + then + TAG=$2 + docker push bitwarden/web:$TAG + else + docker push bitwarden/web + fi +elif [ $# -gt 1 -a "$1" == "tag" ] +then + TAG=$2 + echo "Tagging Web as '$TAG'" + docker tag bitwarden/web bitwarden/web:$TAG +else + echo "# Building Web" -echo "" -echo "Building docker image" -docker --version -docker build -t bitwarden/web $DIR/. + echo "" + echo "Building app" + echo "npm version $(npm --version)" + echo "gulp version $(gulp --version)" + npm install + gulp dist:selfHosted + + echo "" + echo "Building docker image" + docker --version + docker build -t bitwarden/web $DIR/. +fi