#!/usr/bin/env bash

set -euo pipefail

# version read in from the package.json
tag="$(node -e "console.log(require('./package.json').version);")"
git tag "hwsd_dashboard__${tag}"
git push origin "hwsd_dashboard__${tag}"
image_name="docker-registry.zooxlabs.com/hwsd_dashboard:$tag"

cd "$( (builtin cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) )"

(
  set -x
  docker build ./ --tag "$image_name"
  docker push "$image_name"
)

echo Success!
