Initial commit
This commit is contained in:
commit
1f35f0411b
28 changed files with 5703 additions and 0 deletions
32
scripts/deploy.sh
Executable file
32
scripts/deploy.sh
Executable file
|
@ -0,0 +1,32 @@
|
|||
#!/usr/bin/bash
|
||||
|
||||
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
NO_DELETE=false
|
||||
SSH_SERVER="example"
|
||||
PROJECT_ROOT=example_directory
|
||||
SSH_REMOTE_DIR="${SSH_SERVER}:${PROJECT_ROOT}"
|
||||
|
||||
for arg in "$@"
|
||||
do
|
||||
if [ "$arg" == "--no-delete" ]; then
|
||||
NO_DELETE=true
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$NO_DELETE" = false ]; then
|
||||
echo "Deleting node_modules..."
|
||||
rm -rf node_modules/
|
||||
else
|
||||
echo "Skipping deletion of node_modules."
|
||||
fi
|
||||
|
||||
npm ci
|
||||
npm run build
|
||||
|
||||
rsync -r --delete --progress build/ "${SSH_REMOTE_DIR}"
|
||||
rsync package.json "${SSH_REMOTE_DIR}"
|
||||
rsync package-lock.json "${SSH_REMOTE_DIR}"
|
||||
|
||||
ssh "${SSH_SERVER}" "cd ${PROJECT_ROOT}; npm ci"
|
||||
ssh "${SSH_SERVER}" "systemctl restart downloader"
|
Loading…
Add table
Add a link
Reference in a new issue