#!/usr/bin/env bash
#
# Build the ingest_pipeline_base image with a specific version
# Then tag it with an environment
#
# Example: ./build_and_push_image.sh prod 17

set -exuo pipefail

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

dir=ingest_pipeline_base

sh _get_files_for_base.sh "$dir"

function cleanup {
  sh _cleanup_for_base.sh "$dir"
}
trap cleanup EXIT

(
  docker build "$dir"
)

echo Success!
