Commit b254515b authored by Benjamin Murauer's avatar Benjamin Murauer
Browse files

Merge branch '53-make-script-for-releasing' into 'master'

Resolve "Make script for releasing"

Closes #53

See merge request dbis/software/dbispipeline!34
parents c6cdb238 329c5c04
Pipeline #42561 passed with stage
in 1 minute and 42 seconds
BRANCH=$(git branch --show-current)
if [ "${BRANCH}" != "master" ]; then
echo "publishing can only be done on the master branch."
exit 1
DIFFS_STRING=$(git rev-list --left-right --count master...origin/master)
LOCAL=${DIFFS[0]} # how many commits local is ahead of origin
REMOTE=${DIFFS[1]} # how many commits origin is ahead of local
# if the master branch on origin is ahead, probably forgot to pull
if [ "${REMOTE}" != 0 ]; then
echo "master branch is ${REMOTE} commits ahead. Pull/merge first."
exit 1
# make sure all tags are available locally
git fetch --tags
LAST_TAG=$(git describe --tags --abbrev=0)
LAST_LOGS=$(git log --color --pretty=oneline HEAD..."${LAST_TAG}")
LAST_LOG_LINES=$(echo "${LAST_LOGS}" | wc -l)
# count the lines of commits between HEAD and the last named tag
if [ "${LAST_LOG_LINES}" == 0 ]; then
echo "No commits have been detected since the last tag ${LAST_TAG}."
exit 1
echo "commits since last tag:"
echo "-----------------------"
echo "${LAST_LOGS}"
if [ "${VERSION_LEVEL}" != "patch" ] && [ "${VERSION_LEVEL}" != "minor" ]; then
echo "Usage: ./ <patch|minor>"
exit 1
bumpversion "${VERSION_LEVEL}" || exit 1
VERSION=$(python -m setup --version)
echo "new version is: ${VERSION}"
git add setup.cfg
git commit -m "release v${VERSION}"
git tag "v${VERSION}"
git push origin "v${VERSION}"
make release
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment