<li>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 [https://travis-ci.org Travis dashboard] with each new commit, with corresponding SNAPSHOT artifacts automatically deployed to [http://maven.imagej.net/index.html#view-repositories maven.imagej.net].
<li>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 [https://travis-ci.org Travis dashboard] with each new commit, with corresponding SNAPSHOT artifacts automatically deployed to [http://maven.imagej.net/index.html#view-repositories maven.imagej.net].
Travis is a tool for continuous integration. It has excellent integration with GitHub, and is very useful for automating builds, deployment and other tasks.
ImageJ and SciJava projects use Travis in a variety of ways:
Perform builds of SciJava projects. Travis deploys SNAPSHOT builds to the ImageJ Maven repository in response to pushes to each code repository's master branch. So any downstream projects depending on a version of LATEST for a given component will match the last successful Travis build—i.e., the latest code on master.
Run each project's associated unit tests. Travis is instrumental in early detection of new bugs introduced to the codebase.
Perform releases of SciJava projects. Travis deploys release builds to the appropriate Maven repository—typically either the ImageJ Maven repository or OSS Sonatype.
Note that this will automatically modify your .travis.yml file.
If you are not a core ImageJ maintainer, you probably do not have this password. Finish the rest of these steps below, then start a topic on the Image.sc Forum asking for a core ImageJ maintainer to file a PR to your repository adding this encrypted variable.
#!/bin/sh
curl -fsLO https://raw.githubusercontent.com/scijava/scijava-scripts/master/travis-build.sh
sh travis-build.sh $encrypted_44f58251b904_key $encrypted_44f58251b904_iv
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 artifacts automatically deployed to maven.imagej.net.
Add the following code to your build.gradle file:
// this _must_ be at the top, with the other plugins
apply plugin: 'maven'
apply plugin: 'maven-publish'
// more towards the end
uploadArchives {
repositories {
mavenDeployer {
repository(url: "http://maven.imagej.net/content/repositories/releases") {
authentication(userName: "$System.env.MAVEN_USER", password: "$System.env.MAVEN_PASS")
}
snapshotRepository(url: "http://maven.imagej.net/content/repositories/snapshots") {
authentication(userName: "$System.env.MAVEN_USER", password: "$System.env.MAVEN_PASS")
}
}
}
}
If you also want your Javadoc JAR to be published, also add the following:
From the command line in your repository, create an encrypted environment variable for your maven.imagej.net username and password—be careful with escaping special characters correctly:
Note that this will automatically modify your .travis.yml file.
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.
Testing things which cannot run headless
If your tests require a display (i.e.: they do not pass when run headless), you can use Xvfb as follows:
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3 # give xvfb some time to start
Of course, you should do this only as a last resort, since the best unit tests should not require a display in the first place.