Skip to content

Commit

Permalink
Add autorelease script
Browse files Browse the repository at this point in the history
  • Loading branch information
onegreyonewhite committed Apr 4, 2019
1 parent 9240293 commit 67f2364
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,23 @@ pages:
- developer
when: always

release:
stage: release
image: onegreyonewhite/tox:tox
only:
refs:
- master
variables:
- $GIT_ACCESS_USER
- $GIT_ACCESS_PASSWORD
before_script:
- url_host=`echo "${CI_REPOSITORY_URL}" | sed -e "s/https:\/\/gitlab-ci-token:.*@//g"`
- git config --global user.name "${GITLAB_USER_NAME}"
- git config --global user.email "${GITLAB_USER_EMAIL}"
- git remote set-url origin "https://${GIT_ACCESS_USER}:${GIT_ACCESS_PASSWORD}@${url_host}"
script:
- bash autorelease.sh

release_pypi:
stage: release
image: onegreyonewhite/tox:centos6
Expand Down
11 changes: 11 additions & 0 deletions autorelease.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
CURRENT_VERSION=$(cat polemarch/__init__.py | grep __version__ | cut -d "=" -f2 | grep -oE "[0-9\.](\.dev[0-9]{1,2}){0,1}"| tr -d '\n')
TAG=$(git tag -l $CURRENT_VERSION)

if [ -z "${TAG}" ]; then
echo "Creating new tag ${CURRENT_VERSION}.";
# git tag $CURRENT_VERSION > /dev/null 2>&1;
# git push origin $CURRENT_VERSION > /dev/null 2>&1;
else
echo "Current release ${CURRENT_VERSION} already exists. Update version to release."
fi

0 comments on commit 67f2364

Please sign in to comment.