
#!/bin/bash
# Build, tag, and push link remote docker image to our registry
#
# Usage: ./build_link_remote_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}
set -euo pipefail

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

# Pull the latest dds_base since it is used by all of the other images
./docker_images/teleop/dds_base/pull.sh

echo "Building remote link image"
bazel_run //vehicle/link:push_link_remote_image --define link_remote_image_tag=$tag
