#!/usr/bin/env bash
set -eo pipefail

# create a version.json
printf '{"commit":"%s","version":"%s","source":"https://github.com/%s/%s","build":"%s"}\n' \
  "$CIRCLE_SHA1" \
  "$CIRCLE_TAG" \
  "$CIRCLE_PROJECT_USERNAME" \
  "$CIRCLE_PROJECT_REPONAME" \
  "$CIRCLE_BUILD_URL" \
> version.json

echo "Building the docker image with the tag app:build"
docker build -t app:build .
