Skip to content

Commit

Permalink
automating versioning and pushing images to docker
Browse files Browse the repository at this point in the history
  • Loading branch information
bbilly1 committed Sep 18, 2021
1 parent cbedfe2 commit d2d6835
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion deploy.sh
Expand Up @@ -54,16 +54,49 @@ 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

sudo docker build -t bbilly1/tubearchivist:latest .
echo "latest tags:"
git tag

echo "latest docker images:"
sudo docker image ls bbilly1/tubearchivist

printf "\ncreate new version:\n"
read -r VERSION

# start build
sudo docker build -t bbilly1/tubearchivist:latest -t bbilly1/tubearchivist:"$VERSION" .

printf "\nlatest images:\n"
sudo docker image ls bbilly1/tubearchivist

read -s "Push?"

# push to docker
echo "pushing latest:"
sudo docker push bbilly1/tubearchivist:latest
echo "pushing $VERSION"
sudo docker push bbilly1/tubearchivist:"$VERSION"

# 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 all "$VERSION"

}


# check package versions in requirements.txt for updates
python version_check.py

Expand Down

0 comments on commit d2d6835

Please sign in to comment.