#!/usr/bin/env bash
#
# Build and upload a diagnostics docker image
#

set -euo pipefail
set -x

image="diagnostics_timeline"
tag="$1"

root_path="web_apps/diagnostics_timeline"
dest_path="docker-registry.zooxlabs.com/diagnostics"

# Build the image
bazel_run -c opt "//${root_path}:${image}_image" -- --norun

# Tag the image
docker tag "bazel/${root_path}:${image}_image" "${dest_path}/${image}:${tag}"
docker push "${dest_path}/${image}:${tag}"
