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
|
if [[ $1 == "validate" ]]; then
|
||||||
validate "$2"
|
validate "$2"
|
||||||
elif [[ $1 == "test" ]]; then
|
elif [[ $1 == "test" ]]; then
|
||||||
sync_test
|
sync_test
|
||||||
|
elif [[ $1 == "docker" ]]; then
|
||||||
|
sync_docker
|
||||||
else
|
else
|
||||||
echo "valid options are: validate | test"
|
echo "valid options are: validate | test | docker"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
Reference in New Issue
Block a user