#!/bin/bash
# Build, tag, and push vehicle discovery docker image to our registry
#
# Usage: ./build_vehicle_discovery_docker_image.sh <tag>
#
# If you don't provide an argument, tag will default to latest
# By convention, we use the current date as the tag, ex: 20180820

set -euo pipefail

tag=${1:-latest}

# Find workspace and set up env
workspace=$(bazel info workspace)
cd ${workspace}
source "$workspace/scripts/shell/bazel/function.sh"

echo "Building vehicle discovery image: $tag"
bazel_run //teleop/ziod/vehicle_discovery:push_vehicle_discovery_server_image --define vehicle_discovery_server_image_tag=$tag
