Update deploy scripts to work with Vite dist dir (vs. build dir)
This commit is contained in:
28
scripts/deploy.sh
Executable file
28
scripts/deploy.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# remoteUser="username"
|
||||
remoteHost="11001001.org"
|
||||
# remotePort=22
|
||||
remoteDir="/var/www/med-plan-assistant"
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
localDist="${SCRIPT_DIR}/../dist"
|
||||
|
||||
if [[ ! -d "${localDist}" ]]; then
|
||||
echo "Dist folder not found: ${localDist}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dest="${remoteHost}:${remoteDir}"
|
||||
if [[ -n "${remoteUser:-}" ]]; then
|
||||
dest="${remoteUser}@${remoteHost}:${remoteDir}"
|
||||
fi
|
||||
|
||||
scp_args=()
|
||||
if [[ -n "${remotePort:-}" ]]; then
|
||||
scp_args+=("-P" "${remotePort}")
|
||||
fi
|
||||
|
||||
# Copy contents of dist directory to remote target
|
||||
scp -r "${scp_args[@]}" "${localDist}/"* "${dest}"
|
||||
Reference in New Issue
Block a user