1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-02 08:40:08 +01:00
bitwarden-browser/build.sh
2017-10-02 16:39:37 -04:00

40 lines
742 B
Bash

#!/usr/bin/env bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo ""
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 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