#!/usr/bin/env bash

export IMAGE_TAG=$($SCRIPT_DIR/get_tag_version.sh)
export DOCKER_REGISTRY_IMAGE=$DOCKER_REGISTRY_IMAGE

if [[ "$CI_COMMIT_REF_NAME" == "main" ]]; then
  profile="main"
elif [[ "$CI_COMMIT_REF_NAME" == "release" ]]; then
  profile="release"
else
  profile="dev"
fi
run_mvn.sh spring-boot:build-image -DskipTests -Dmaven.wagon.http.retryHandler.count=3 -P $profile -Ddocker.publishRegistry.username=${NEXUS_USER} -Ddocker.publishRegistry.password=${NEXUS_PASSWORD}
