45 lines
1.2 KiB
Bash
Executable File
45 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
# Deploys the whole qt/ ui directory to /sls/bd/hla/<env>/qt.
|
|
#
|
|
# Run from the repo root (the qt/ source path is relative), e.g.
|
|
# Usage: ./.gitea/scripts/deploy-qt.sh <dev|prod>
|
|
set -euo pipefail
|
|
|
|
source "$(dirname "$0")/common.sh"
|
|
|
|
AGEBD_ENV=${1:-}
|
|
|
|
if [ -z "${AGEBD_ENV}" ]; then
|
|
echo "Usage: $0 <dev|prod>" >&2
|
|
exit 1
|
|
fi
|
|
|
|
set_env_suffix "${AGEBD_ENV}"
|
|
|
|
DEST_DIR=${HLA_ROOT}/${AGEBD_ENV}/qt
|
|
|
|
echo "=========================================="
|
|
echo "Deploying qt/ (${AGEBD_ENV}) to ${DEST_DIR}"
|
|
echo "=========================================="
|
|
|
|
# TODO: see https://gitea.psi.ch/sls/hla_framework_bd/issues/50
|
|
# rm -rf "${DEST_DIR}"
|
|
# mkdir -p "${DEST_DIR}"
|
|
# cp -r ./qt/* "${DEST_DIR}/"
|
|
|
|
mkdir -p "${DEST_DIR}"
|
|
|
|
rsync -avz --delete \
|
|
--exclude='.nfs*' \
|
|
--exclude='.git/' \
|
|
--exclude='.venv/' \
|
|
--exclude='__pycache__/' \
|
|
--exclude='*.pyc' \
|
|
--exclude='.pytest_cache/' \
|
|
./qt/* "${DEST_DIR}/"
|
|
|
|
### SUBSTITUTIONS
|
|
sed -i "s/{{ *agebd_env_suffix_upper* }}/${AGEBD_ENV_SUFFIX_UPPER}/g" "${DEST_DIR}/"*
|
|
sed -i "s/{{ *agebd_env_suffix_lower* }}/${AGEBD_ENV_SUFFIX_LOWER}/g" "${DEST_DIR}/"*
|
|
sed -i "s/{{ *agebd_env_suffix_paren* }}/${AGEBD_ENV_SUFFIX_PAREN}/g" "${DEST_DIR}/"*
|