Merge pull request 'rsync was a bad idea' (#706) from reduce-deployment-time into staging
All checks were successful
CI/CD Pipeline / test (push) Successful in 10m42s
CI/CD Pipeline / deploy-staging (push) Successful in 8m14s
CI/CD Pipeline / deploy-main (push) Has been skipped

Reviewed-on: #706
This commit is contained in:
philipp 2024-08-21 17:40:29 +02:00
commit 4290010cc6

View File

@ -66,9 +66,9 @@ jobs:
scp target/$CARGO_TARGET/release/rot $SSH_USER@$SSH_HOST:/home/rowing-staging/rot-updating scp target/$CARGO_TARGET/release/rot $SSH_USER@$SSH_HOST:/home/rowing-staging/rot-updating
scp staging-diff.sql $SSH_USER@$SSH_HOST:/home/rowing-staging/ scp staging-diff.sql $SSH_USER@$SSH_HOST:/home/rowing-staging/
rsync -avz static/ $SSH_USER@$SSH_HOST:/home/rowing-staging/static/ scp -r static $SSH_USER@$SSH_HOST:/home/rowing-staging/
rsync -avz templates/ $SSH_USER@$SSH_HOST:/home/rowing-staging/templates/ scp -r templates $SSH_USER@$SSH_HOST:/home/rowing-staging/
rsync -avz svelte/ $SSH_USER@$SSH_HOST:/home/rowing-staging/svelte/ scp -r svelte $SSH_USER@$SSH_HOST:/home/rowing-staging/
ssh $SSH_USER@$SSH_HOST 'sudo systemctl stop rotstaging' ssh $SSH_USER@$SSH_HOST 'sudo systemctl stop rotstaging'
ssh $SSH_USER@$SSH_HOST 'rm /home/rowing-staging/db.sqlite && cp /home/rowing/db.sqlite /home/rowing-staging/db.sqlite && mkdir -p /home/rowing-staging/svelte/build && mkdir -p /home/rowing-staging/data-ergo/thirty && mkdir -p /home/rowing-staging/data-ergo/dozen && sqlite3 /home/rowing-staging/db.sqlite < /home/rowing-staging/staging-diff.sql' ssh $SSH_USER@$SSH_HOST 'rm /home/rowing-staging/db.sqlite && cp /home/rowing/db.sqlite /home/rowing-staging/db.sqlite && mkdir -p /home/rowing-staging/svelte/build && mkdir -p /home/rowing-staging/data-ergo/thirty && mkdir -p /home/rowing-staging/data-ergo/dozen && sqlite3 /home/rowing-staging/db.sqlite < /home/rowing-staging/staging-diff.sql'
ssh $SSH_USER@$SSH_HOST 'mv /home/rowing-staging/rot-updating /home/rowing-staging/rot' ssh $SSH_USER@$SSH_HOST 'mv /home/rowing-staging/rot-updating /home/rowing-staging/rot'
@ -107,9 +107,9 @@ jobs:
chmod 600 ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa
scp target/$CARGO_TARGET/release/rot $SSH_USER@$SSH_HOST:/home/rowing/rot-updating scp target/$CARGO_TARGET/release/rot $SSH_USER@$SSH_HOST:/home/rowing/rot-updating
rsync -avz static/ $SSH_USER@$SSH_HOST:/home/rowing/static/ scp -r static $SSH_USER@$SSH_HOST:/home/rowing/
rsync -avz templates/ $SSH_USER@$SSH_HOST:/home/rowing/templates/ scp -r templates $SSH_USER@$SSH_HOST:/home/rowing/
rsync -avz svelte/ $SSH_USER@$SSH_HOST:/home/rowing/svelte/ scp -r svelte $SSH_USER@$SSH_HOST:/home/rowing/
ssh $SSH_USER@$SSH_HOST 'mkdir -p /home/rowing/svelte/build && mkdir -p /home/rowing/data-ergo/thirty && mkdir -p /home/rowing/data-ergo/dozen' ssh $SSH_USER@$SSH_HOST 'mkdir -p /home/rowing/svelte/build && mkdir -p /home/rowing/data-ergo/thirty && mkdir -p /home/rowing/data-ergo/dozen'
ssh $SSH_USER@$SSH_HOST 'sudo systemctl stop rot' ssh $SSH_USER@$SSH_HOST 'sudo systemctl stop rot'
ssh $SSH_USER@$SSH_HOST 'mv /home/rowing/rot-updating /home/rowing/rot' ssh $SSH_USER@$SSH_HOST 'mv /home/rowing/rot-updating /home/rowing/rot'