feat: create deployment scripts
This commit is contained in:
parent
78297efe5c
commit
8d5bce4bfb
22 changed files with 2697 additions and 74 deletions
33
deploy-models.sh
Executable file
33
deploy-models.sh
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
# rsync local models_cache to server shared cache
|
||||
# reports server models not in local (manual cleanup required)
|
||||
|
||||
ssh=deploy-peoplesgrocers-website
|
||||
base=/home/peoplesgrocers
|
||||
project=salience
|
||||
|
||||
ssh $ssh "mkdir -p $base/$project/shared/models_cache"
|
||||
|
||||
test -d api/models_cache || { echo 'no local api/models_cache'; exit 1; }
|
||||
|
||||
echo "local models_cache size:"
|
||||
du -sh api/models_cache
|
||||
|
||||
echo "syncing to $ssh:$base/$project/shared/models_cache/"
|
||||
# do not use compression because these model files are basically random data
|
||||
# the SSH connection is pretty spotting when transferring large files
|
||||
rsync -va --info=progress2 --partial --append-verify api/models_cache/ $ssh:$base/$project/shared/models_cache/
|
||||
|
||||
# local models
|
||||
local=$(cd api/models_cache && find . -maxdepth 2 -name 'models--*' -type d | sed 's|./||' | sort)
|
||||
|
||||
# server models
|
||||
remote=$(ssh $ssh "cd $base/$project/shared/models_cache && find . -maxdepth 2 -name 'models--*' -type d | sed 's|./||'" | sort)
|
||||
|
||||
# report server models not in local
|
||||
echo "checking for unused models on server..."
|
||||
for r in $remote; do
|
||||
echo "$local" | grep -q "^${r}$" || echo "unused: $r"
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue