Empire/.release.sh

43 lines
1.0 KiB
Bash
Raw Normal View History

2017-12-03 22:11:43 +00:00
#!/usr/bin/env bash
set -ex
# SET THE FOLLOWING VARIABLES
USERNAME=empireproject
IMAGE=empire
VERSION="$(curl -s https://raw.githubusercontent.com/EmpireProject/Empire/master/lib/common/empire.py | grep "VERSION =" | cut -d '"' -f2)"
# UPDATE THE SOURCE CODE
git pull
2017-12-21 22:11:51 +00:00
# bump version
docker run --rm -v "$PWD":/app treeder/bump patch
VERSION=`cat VERSION`
echo "version: $VERSION"
2017-12-03 22:11:43 +00:00
# ALERT VERSION
echo "Building Version: $VERSION"
# START BUILD
./.build.sh
2017-12-21 22:11:51 +00:00
# TAF, PULL, MERGE DEV
git checkout -b "dev"
git add --all
git commit -m "Empire $VERSION Release"
git tag -a "$VERSION" -m "Empire $VERSION Release"
git push origin "dev"
git push origin "dev" --tags
git checkout master
git merge "dev"
git push
hub release create dev -m "Empire $VERSION Release"
2017-12-03 22:11:43 +00:00
# DOCKER TAG/VERSIONING
docker tag $USERNAME/$IMAGE:latest $USERNAME/$IMAGE:$VERSION
# PUSH TO DOCKER HUB
docker push $USERNAME/$IMAGE:latest
echo "Docker image pushed: $USERNAME/$IMAGE:latest"
docker push $USERNAME/$IMAGE:$VERSION
echo "Docker image pushed: $USERNAME/$IMAGE:$VERSION"