Files
iparenteau a6df549919
Locusworks Team/portal-webapp/pipeline/head There was a failure building this commit
Upgraded all libraries, switched to npm, upgraded angular and jdk21
2026-09-04 15:22:35 -05:00

26 lines
785 B
Bash

#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PORTAL_HOME="${PORTAL_HOME:-$(cd "${SCRIPT_DIR}/.." && pwd)}"
PORTAL_DEPLOY_DIR="${PORTAL_DEPLOY_DIR:-${PORTAL_HOME}/deploy}"
shopt -s nullglob
artifacts=("${PORTAL_HOME}"/portal_webapp/target/portal_webapp-*.jar)
shopt -u nullglob
if (( ${#artifacts[@]} != 1 )); then
echo "Expected one executable portal_webapp JAR, found ${#artifacts[@]}. Run 'mvn clean package' first." >&2
exit 1
fi
install -d "${PORTAL_DEPLOY_DIR}"
install -m 0644 "${artifacts[0]}" "${PORTAL_DEPLOY_DIR}/portal.jar"
echo "Installed ${artifacts[0]} as ${PORTAL_DEPLOY_DIR}/portal.jar"
if [[ -n "${PORTAL_SERVICE:-}" ]]; then
systemctl restart "${PORTAL_SERVICE}"
echo "Restarted ${PORTAL_SERVICE}"
fi