#!/usr/bin/env bash

set -euo pipefail

if [[ -z "${1:-}" || "$1" == '--help' || "$1" == '-h' ]]; then
  echo "Usage: $0 TAG"
  exit 1
fi

tag="$1"
image_name="docker-registry.zooxlabs.com/zrn_overlay_frontend:$tag"

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

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

echo Success!
