-
Notifications
You must be signed in to change notification settings - Fork 5
Maven Deploy Travis
Our guide is based on this existing template, we reused the deploy.sh script, maven settings.xml and the travis.yml file entirely:
https://github.com/making/travis-ci-maven-deploy-skelton
-
Create a JIRA Account at sonatype.org and create a new OOSRH ticket
These steps are explained in this guide: http://central.sonatype.org/pages/ossrh-guide.html. In the ticket explain that you want to be able to administrate the existing
org.cristalise
groupdId. -
Generate Pretty Good Privacy (PGP) keys
These steps are explained in this guide: http://central.sonatype.org/pages/working-with-pgp-signatures.html. Use
gpg --list-secret-keys
to find the keyid or keyname. In the guide such keyid isC6EED57A
and this is what you need to find in your gpg database, and use forGPG_KEYNAME
environment variable bellow. -
Distribute your public key
gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys <keyid>
-
Copy the
deploy
directory from one of our existing project -
Encrypt the gpg files to secure them in github
This will overwrite the existing
secring.gpg.enc
andpubring.gpg.enc
file you have copied in the previous step.$ cd <location of the project> $ export ENCRYPTION_PASSWORD=<password to encrypt> $ openssl aes-256-cbc -pass pass:$ENCRYPTION_PASSWORD -in ~/.gnupg/secring.gpg -out deploy/secring.gpg.enc $ openssl aes-256-cbc -pass pass:$ENCRYPTION_PASSWORD -in ~/.gnupg/pubring.gpg -out deploy/pubring.gpg.enc
-
Edit the
pom.xml
file of the projectCheck this guide: http://central.sonatype.org/pages/requirements.html. The best is to copy it from one of our existing project. Check also the maven pom example provided in the original template we used.
-
Copy the
.travis.yml
file from one of our existing project -
Install travis cli on your computer
Use this command:
gem install travis
. On windows use cygwin. In order to use gem command install ruby development tools first together with make. -
Create the secure environment variables in Travis
It can be done using the settings pages of travis, e.g. https://travis-ci.org/cristal-ise/jooqdb/settings, or use the following commands bellow:
$ travis login $ travis enable -r cristal-ise/<repository> $ travis env set SONATYPE_USERNAME <uid> $ travis env set SONATYPE_PASSWORD <pwd1> $ travis env set ENCRYPTION_PASSWORD $ENCRYPTION_PASSWORD $ travis env set GPG_KEYNAME <the key looks like:B56B4CE4> $ travis env set GPG_PASSPHRASE <passphase>
-
Make sure that
publish.sh
has executable rightsUse this command if you already committed publish.sh :
git update-index --chmod=+x publish.sh
-
Add, commit and push all changes to github.
Check travis run here: https://travis-ci.org/cristal-ise/
- Getting started
- Key features
- Documentation
- Tutorials
- Basic: Create Patient
- Adv: Patient Tracking
- Selected papers
- Maven Deploy Travis
- Maven-Deploy-Travis-GPG2