Update deploy.sh to utilize buildx for multiarch builds. This is inline with Issue #6. (#51)

This commit is contained in:
lamusmaser 2021-10-12 04:47:48 -06:00 committed by GitHub
parent 519c710e7d
commit 48a4827ad5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,7 +23,7 @@ function sync_blackhole {
--exclude "db.sqlite3" \ --exclude "db.sqlite3" \
. -e ssh "$host":tubearchivist . -e ssh "$host":tubearchivist
echo "$PASS" | ssh "$host" 'sudo -S docker build -t bbilly1/tubearchivist:latest tubearchivist 2>/dev/null' echo "$PASS" | ssh "$host" 'sudo -S docker buildx build --platform linux/amd64,linux/arm64 -t bbilly1/tubearchivist:latest tubearchivist 2>/dev/null'
echo "$PASS" | ssh "$host" 'sudo -S docker-compose up -d 2>/dev/null' echo "$PASS" | ssh "$host" 'sudo -S docker-compose up -d 2>/dev/null'
} }
@ -43,7 +43,7 @@ function sync_test {
rsync -r --progress --delete docker-compose.yml -e ssh "$host":docker rsync -r --progress --delete docker-compose.yml -e ssh "$host":docker
ssh "$host" 'docker build -t bbilly1/tubearchivist:latest tubearchivist' ssh "$host" 'docker buildx build --platform linux/amd64,linux/arm64 -t bbilly1/tubearchivist:latest tubearchivist'
ssh "$host" 'docker-compose -f docker/docker-compose.yml up -d' ssh "$host" 'docker-compose -f docker/docker-compose.yml up -d'
ssh "$host" 'docker cp tubearchivist/tubearchivist/testing.sh tubearchivist:/app/testing.sh' ssh "$host" 'docker cp tubearchivist/tubearchivist/testing.sh tubearchivist:/app/testing.sh'
@ -103,7 +103,7 @@ function sync_docker {
read -r VERSION read -r VERSION
# start build # start build
sudo docker build -t bbilly1/tubearchivist:latest -t bbilly1/tubearchivist:"$VERSION" . sudo docker buildx build --platform linux/amd64,linux/arm64 -t bbilly1/tubearchivist:latest -t bbilly1/tubearchivist:"$VERSION" .
printf "\nlatest images:\n" printf "\nlatest images:\n"
sudo docker image ls bbilly1/tubearchivist sudo docker image ls bbilly1/tubearchivist
@ -112,10 +112,10 @@ function sync_docker {
read -rn 1 read -rn 1
# push to docker # push to docker
echo "pushing latest:" echo "pushing multiarch latest and $VERSION:"
sudo docker push bbilly1/tubearchivist:latest sudo docker buildx build --platform linux/amd64,linux/arm64 -t bbilly1/tubearchivist:latest -t bbilly1/tubearchivist:"$VERSION" --push .
echo "pushing $VERSION" #sudo docker push bbilly1/tubearchivist:latest
sudo docker push bbilly1/tubearchivist:"$VERSION" #sudo docker push bbilly1/tubearchivist:"$VERSION"
# create release tag # create release tag
echo "commits since last version:" echo "commits since last version:"