#!/usr/bin/env bash set -e set -o pipefail # Script for deploying the application to teacher-tools.andrewlalis.com. 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'