#!/bin/bash

set -euo pipefail

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"


export CMAKE_BUILD_TYPE="Debug"

rm -rf "${SCRIPT_DIR}/output" 
mkdir -p "${SCRIPT_DIR}/output"

PROJECT="getpkg"

# make sure we have the latest base image.
docker pull gitea.jde.nz/public/dropshell-build-base:latest

docker build \
  -t "${PROJECT}-build" \
  -f "${SCRIPT_DIR}/Dockerfile.dropshell-build" \
  --build-arg PROJECT="${PROJECT}" \
  --build-arg CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" \
  --output "${SCRIPT_DIR}/output" \
  "${SCRIPT_DIR}"

