Skip to content

Commit

Permalink
Revert git tagging with travis
Browse files Browse the repository at this point in the history
  • Loading branch information
steve-jansen committed May 26, 2015
1 parent 97e537b commit b60b7d7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,6 @@ Session.vim
.netrwhist
*~

### Travis ###
.travis/

8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ node_js:
- "0.12"
- "0.10"

branches:
except:
- /^v[0-9]/ # ignore building release tags

after_success:
- npm run-script jshint
- npm run-script codeclimate
Expand All @@ -21,7 +25,3 @@ deploy:
branch: master
node: "0.12"

after_deploy:
- chmod a+x ./release.sh
- ./release.sh

24 changes: 13 additions & 11 deletions release.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
#!/usr/bin/env bash

APP_TAG="v`node -p 'require("./package.json").version'`"
GIT_COMMIT=`git rev-parse HEAD`

# see http://docs.travis-ci.com/user/originment/custom/
echo $0: configuring git
git config --global user.email "builds@travis-ci.com"
git config --global user.name "Travis CI"

APP_TAG="v`node -p 'require("package.json").version'`"

echo $0: tagging commit ${TRAVIS_COMMIT} as ${APP_TAG}
git tag "${APP_TAG}" "${TRAVIS_COMMIT}"
echo $0: git reseting
git reset --hard HEAD

echo $0: updating release branch to commit ${TRAVIS_COMMIT}
git branch -f release "${TRAVIS_COMMIT}"

echo $0: pushing tags and release branch
git push -q origin "${APP_TAG}"
echo $0: tagging commit ${GIT_COMMIT} as ${APP_TAG}
git tag "${APP_TAG}" "${GIT_COMMIT}"

echo $0: version bumping
npm version minor -m "Version bump by Travis CI"
git push -q origin master
npm version patch -m 'Version bump to %s'

echo $0: pushing tags and master
git push -q origin master --tags

0 comments on commit b60b7d7

Please sign in to comment.