Skip to content

Commit 8dd91d2

Browse files
committed
Let Travis update the "snapshot" tag after every build
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/
1 parent 42774a5 commit 8dd91d2

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ jdk:
66

77
after_success:
88
- mvn -DserviceJobId=$TRAVIS_JOB_ID clean cobertura:cobertura coveralls:cobertura -Dcobertura.report.format=xml
9+
- ./.travis/update_snapshot_tag.sh

.travis/deploy_key.enc

3.17 KB
Binary file not shown.

.travis/update_snapshot_tag.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/sh
2+
3+
[email protected]:buddycloud/buddycloud-server-java.git
4+
5+
# Decrypt the deployment key for Git push access
6+
openssl aes-256-cbc -K $encrypted_937d176d0339_key -iv $encrypted_937d176d0339_iv -in .travis/deploy_key.enc -out .travis/deploy_key -d
7+
ssh-add .travis/deploy_key.enc
8+
9+
# Import the deployment key
10+
chmod 600 .travis/deploy_key
11+
eval `ssh-agent -s`
12+
ssh-add .travis/deploy_key
13+
14+
# Set Git committer information
15+
git config user.name "Travis CI"
16+
git config user.email "[email protected]"
17+
18+
# Remove the `snapshot` tag and re-add it to point to the latest commit
19+
git tag -d snapshot
20+
git push $GIT_URL :snapshot
21+
git tag -a snapshot -m "Latest Snapshot"
22+
git push --tags $GIT_URL

0 commit comments

Comments
 (0)