remove legacy db sync function
This commit is contained in:
parent
b0e21de7ad
commit
a1aeb97e41
17
deploy.sh
17
deploy.sh
|
@ -39,27 +39,12 @@ function sync_test {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# sync prod db to testing
|
|
||||||
function sync_db {
|
|
||||||
|
|
||||||
newest_backup=$(ssh $remote_host 'find backup -type f -name "pg_*.gz" | sort | tail -n 1')
|
|
||||||
rsync --progress -e ssh $remote_host:"$newest_backup" .
|
|
||||||
rsync --progress -e ssh "$(basename "$newest_backup")" $local_host:backup/backup.gz
|
|
||||||
|
|
||||||
ssh $local_host "gzip -d backup/backup.gz"
|
|
||||||
ssh $local_host "docker exec -i postgres psql -U aqi -d aqi < backup/backup"
|
|
||||||
ssh $local_host "docker compose -f docker/docker-compose.yml restart"
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if [[ $1 == "test" ]]; then
|
if [[ $1 == "test" ]]; then
|
||||||
sync_test "$2"
|
sync_test "$2"
|
||||||
elif [[ $1 == "docker" ]]; then
|
elif [[ $1 == "docker" ]]; then
|
||||||
sync_docker
|
sync_docker
|
||||||
elif [[ $1 == "db" ]]; then
|
|
||||||
sync_db
|
|
||||||
else
|
else
|
||||||
echo "valid options are: test | docker | db"
|
echo "valid options are: test | docker"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|
Loading…
Reference in New Issue