add unstable tag for docker deploy

This commit is contained in:
simon
2021-12-17 16:57:10 +07:00
parent a500f9ec63
commit 816c68464b
2 changed files with 30 additions and 5 deletions

View File

@@ -3,7 +3,8 @@
# deploy all needed project files to different servers:
# test for local vm for testing
# blackhole for local production
# docker to publish
# unstable to publish intermediate releases
# docker to publish regular release
# create builder:
# docker buildx create --name tubearchivist
@@ -51,7 +52,8 @@ function sync_test {
--exclude "db.sqlite3" \
. -e ssh "$host":tubearchivist
rsync -r --progress --delete docker-compose.yml -e ssh "$host":docker
# uncomment or copy your own docker-compose file
# rsync -r --progress --delete docker-compose.yml -e ssh "$host":docker
if [[ $1 = "amd64" ]]; then
platform="linux/amd64"
@@ -100,6 +102,22 @@ function validate {
}
# publish unstable tag to docker
function sync_unsable {
if [[ $(systemctl is-active docker) != 'active' ]]; then
echo "starting docker"
sudo systemctl start docker
fi
# start amd64 build
sudo docker buildx build \
--platform linux/amd64 \
-t bbilly1/tubearchivist:unstable --push .
}
function sync_docker {
# check things
@@ -152,8 +170,10 @@ elif [[ $1 == "validate" ]]; then
validate "$2"
elif [[ $1 == "docker" ]]; then
sync_docker
elif [[ $1 == "unstable" ]]; then
sync_unsable
else
echo "valid options are: blackhole | test | validate | docker"
echo "valid options are: blackhole | test | validate | docker | unstable"
fi