tubearchivist-server/deploy.sh

45 lines
1.5 KiB
Bash
Raw Normal View History

2022-04-29 10:48:25 +00:00
#!/bin/bash
# deploy the tube archivist website
test_host="tubearchivist-website.local"
2022-07-11 10:49:42 +00:00
public_host="vps3"
2022-04-29 10:48:25 +00:00
function rebuild_test {
echo "rebuild testing environment"
2022-04-29 11:01:11 +00:00
rsync -a --progress --delete docker-compose_testing.yml $test_host:docker/docker-compose.yml
2022-04-29 10:48:25 +00:00
rsync -a --progress --delete tubearchivist $test_host:docker
rsync -a --progress --delete env $test_host:docker
2022-12-03 02:27:25 +00:00
rsync -a --progress --delete helper_scripts $test_host:
2022-05-20 04:41:44 +00:00
rsync -a --progress --delete builder/ $test_host:builder
ssh "$test_host" "mkdir -p builder/clone"
ssh "$test_host" 'docker compose -f docker/docker-compose.yml up -d --build'
2022-04-29 10:48:25 +00:00
}
function docker_publish {
echo "publish to production"
rsync -a --progress --delete docker-compose_production.yml $public_host:docker/docker-compose.yml
rsync -a --progress --delete tubearchivist $public_host:docker
rsync -a --progress --delete env $public_host:docker
2022-12-03 02:27:25 +00:00
rsync -a --progress --delete helper_scripts $public_host:
2022-05-20 04:41:44 +00:00
rsync -a --progress --delete builder/ $public_host:builder
ssh "$public_host" "mkdir -p builder/clone"
2022-04-29 10:48:25 +00:00
ssh "$public_host" 'docker compose -f docker/docker-compose.yml build tubearchivist'
ssh "$public_host" 'docker compose -f docker/docker-compose.yml up -d'
}
# check package versions in requirements.txt for updates
python version_check.py
if [[ $1 == "test" ]]; then
rebuild_test
elif [[ $1 == "docker" ]]; then
docker_publish
else
echo "valid options are: test | docker "
fi
##
exit 0