mirror of
https://github.com/tubearchivist/jellyfin.git
synced 2025-01-15 13:20:13 +00:00
add docker build function
This commit is contained in:
parent
28e4c95f86
commit
5febd8b20f
40
deploy.sh
40
deploy.sh
@ -51,12 +51,50 @@ 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
|
||||||
|
|
||||||
|
echo "latest tags:"
|
||||||
|
git tag | tail -n 5 | sort -r
|
||||||
|
|
||||||
|
printf "\ncreate new version:\n"
|
||||||
|
read -r VERSION
|
||||||
|
|
||||||
|
echo "build and push $VERSION?"
|
||||||
|
read -rn 1
|
||||||
|
|
||||||
|
# start build
|
||||||
|
docker buildx build \
|
||||||
|
--platform linux/amd64,linux/arm64 \
|
||||||
|
-t bbilly1/tubearchivist-jf \
|
||||||
|
-t bbilly1/tubearchivist-jf:"$VERSION" --push .
|
||||||
|
|
||||||
|
# create release tag
|
||||||
|
echo "commits since last version:"
|
||||||
|
git log "$(git describe --tags --abbrev=0)"..HEAD --oneline
|
||||||
|
git tag -a "$VERSION" -m "new release version $VERSION"
|
||||||
|
git push origin "$VERSION"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user