mirror of
https://github.com/tubearchivist/tubearchivist-metrics.git
synced 2024-12-22 09:50:15 +00:00
add sync_docker to publish image
This commit is contained in:
parent
f615aeacd5
commit
ff5e9f2572
34
deploy.sh
34
deploy.sh
@ -43,12 +43,44 @@ function sync_test {
|
||||
|
||||
}
|
||||
|
||||
function sync_docker {
|
||||
|
||||
# check things
|
||||
if [[ $(git branch --show-current) != 'master' ]]; then
|
||||
echo 'you are not on master, dummy!'
|
||||
return
|
||||
fi
|
||||
|
||||
if [[ $(systemctl is-active docker) != 'active' ]]; then
|
||||
echo "starting docker"
|
||||
sudo systemctl start docker
|
||||
fi
|
||||
|
||||
# checkout latest tag
|
||||
git fetch --tags github master
|
||||
VERSION=$(git tag | head -n 1)
|
||||
git checkout "$VERSION"
|
||||
|
||||
echo "build and push tubearchivist-metrics:$VERSION ?"
|
||||
read -rn 1
|
||||
|
||||
# start build
|
||||
sudo docker buildx build \
|
||||
--platform linux/amd64,linux/arm64 \
|
||||
-t bbilly1/tubearchivist-metrics \
|
||||
-t bbilly1/tubearchivist-metrics:"$VERSION" --push .
|
||||
|
||||
}
|
||||
|
||||
|
||||
if [[ $1 == "validate" ]]; then
|
||||
validate "$2"
|
||||
elif [[ $1 == "test" ]]; then
|
||||
sync_test
|
||||
elif [[ $1 == "docker" ]]; then
|
||||
sync_docker
|
||||
else
|
||||
echo "valid options are: validate | test"
|
||||
echo "valid options are: validate | test | docker"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
Loading…
Reference in New Issue
Block a user