Skip to content

Commit

Permalink
Let Travis update the "snapshot" tag after every build
Browse files Browse the repository at this point in the history
This required a GitHub deployment key with write access to
be added to the repository. It is encrypted with by using
the encrypt-file functionality of Travis. See here:

http://docs.travis-ci.com/user/encrypting-files/
  • Loading branch information
denisw committed Sep 19, 2015
1 parent 42774a5 commit 8dd91d2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ jdk:

after_success:
- mvn -DserviceJobId=$TRAVIS_JOB_ID clean cobertura:cobertura coveralls:cobertura -Dcobertura.report.format=xml
- ./.travis/update_snapshot_tag.sh
Binary file added .travis/deploy_key.enc
Binary file not shown.
22 changes: 22 additions & 0 deletions .travis/update_snapshot_tag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh

[email protected]:buddycloud/buddycloud-server-java.git

# Decrypt the deployment key for Git push access
openssl aes-256-cbc -K $encrypted_937d176d0339_key -iv $encrypted_937d176d0339_iv -in .travis/deploy_key.enc -out .travis/deploy_key -d
ssh-add .travis/deploy_key.enc

# Import the deployment key
chmod 600 .travis/deploy_key
eval `ssh-agent -s`
ssh-add .travis/deploy_key

# Set Git committer information
git config user.name "Travis CI"
git config user.email "[email protected]"

# Remove the `snapshot` tag and re-add it to point to the latest commit
git tag -d snapshot
git push $GIT_URL :snapshot
git tag -a snapshot -m "Latest Snapshot"
git push --tags $GIT_URL

0 comments on commit 8dd91d2

Please sign in to comment.