Travis

Revision as of 13:29, 12 April 2016 by Hinerm (talk | contribs) (Create travis deployment guide)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Travis is a tool for continuous integration. It has excellent integration with GitHub, making it a viable alternative to Jenkins for automating tasks.

Automatic Deployment of Maven Artifacts

Deploying your library to Maven makes it available for other developers. It is also a contribution requirement.

Requirements

Instructions

1. Create a .travis.yml in your repository using the following template:

language: java
jdk:
- oraclejdk8
script:
- mvn -U -Pdeploy-to-imagej clean deploy --settings settings.xml

2. From the command line in your repository, create an encrypted environment variable for your maven.imagej.net password:

$ travis encrypt MAVEN_PASS=my_maven_password --add env.matrix

Note that this will automatically modify your .travis.yml file.

3. Create a settings.xml in your repository using the following template, using your maven.imagej.net username:

<settings>
  <servers>
    <server>
      <id>imagej.releases</id>
      <username>my_maven_username</username>
      <password>${env.MAVEN_PASS}</password>
    </server>
    <server>
      <id>imagej.snapshots</id>
      <username>my_maven_username</username>
      <password>${env.MAVEN_PASS}</password>
    </server>
  </servers>
</settings>

4. Commit all your files with Git and push them back to your repository. If everything works as intended, you should start seeing new builds in your Travis dashboard with each new commit, with corresponding SNAPSHOT and release artifacts immediately deployed automatically to maven.imagej.net.