2022-06-02 21:26:42 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -o pipefail -o errexit
|
|
|
|
BASEDIR=$(dirname "$(readlink -f "$0")")
|
|
|
|
|
|
|
|
# Error handling
|
|
|
|
handle_error() {
|
|
|
|
read -n1 -r -p "FAILED: line $1, exit code $2. Press any key to exit..." _
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
trap 'handle_error $LINENO $?' ERR
|
|
|
|
|
|
|
|
# Load default script environment variables
|
|
|
|
# shellcheck source=.script_env
|
|
|
|
. "${BASEDIR}/.script_env"
|
|
|
|
|
2022-06-29 16:49:38 +03:00
|
|
|
mkdir -pv "${BASEDIR}/../${OUTPUT_FOLDER}"
|
2022-06-02 21:26:42 +03:00
|
|
|
|
2022-06-29 16:49:38 +03:00
|
|
|
pushd "${VAULT_FOLDER}/apps/web"
|
2022-06-02 21:26:42 +03:00
|
|
|
|
|
|
|
VAULT_VERSION=$(get_web_vault_version)
|
2022-06-29 16:49:38 +03:00
|
|
|
OUTPUT_NAME="${OUTPUT_FOLDER}/bw_web_${VAULT_VERSION}"
|
2022-06-02 21:26:42 +03:00
|
|
|
|
|
|
|
mv build web-vault
|
2022-06-29 16:49:38 +03:00
|
|
|
# Tar the web-vault
|
|
|
|
tar -czvf "${BASEDIR}/../${OUTPUT_NAME}.tar.gz" web-vault --owner=0 --group=0
|
|
|
|
# Copy the web-vault
|
|
|
|
cp -dpr web-vault "${BASEDIR}/../${OUTPUT_NAME}"
|
2022-06-02 21:26:42 +03:00
|
|
|
mv web-vault build
|
|
|
|
|
|
|
|
popd
|