Added individual deploy scripts.

This commit is contained in:
Andrew Lalis 2024-12-30 11:55:30 -05:00
parent 5c54616c48
commit 9669311987
5 changed files with 38 additions and 20 deletions

10
build-api.sh Executable file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -e
set -o pipefail
echo "Building API"
cd api
dub clean
dub build --build=release --compiler=/opt/ldc2/ldc2-1.36.0-linux-x86_64/bin/ldc2
cd ..

10
build-app.sh Executable file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -e
set -o pipefail
echo "Building app"
cd app
rm -rf dist
npm run build
cd ..

8
deploy-api.sh Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -e
set -o pipefail
ssh -f root@andrewlalis.com 'systemctl stop teacher-tools-api.service'
scp api/teacher-tools-api root@andrewlalis.com:/opt/teacher-tools/
ssh -f root@andrewlalis.com 'systemctl start teacher-tools-api.service'

6
deploy-app.sh Executable file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -e
set -o pipefail
rsync -rav -e ssh --delete app/dist/* root@andrewlalis.com:/opt/teacher-tools/app-content

View File

@ -1,23 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -e ./build-app.sh
set -o pipefail ./build-api.sh
# Script for deploying the application to teacher-tools.andrewlalis.com. ./deploy-app.sh
./deploy-api.sh
echo "Building app"
cd app
rm -rf dist
npm run build
cd ..
echo "Building API"
cd api
dub clean
dub build --build=release --compiler=/opt/ldc2/ldc2-1.36.0-linux-x86_64/bin/ldc2
cd ..
ssh -f root@andrewlalis.com 'systemctl stop teacher-tools-api.service'
scp api/teacher-tools-api root@andrewlalis.com:/opt/teacher-tools/
rsync -rav -e ssh --delete app/dist/* root@andrewlalis.com:/opt/teacher-tools/app-content
ssh -f root@andrewlalis.com 'systemctl start teacher-tools-api.service'