https://github.com/spirals-team/jtravis
A java binding for the TravisCI Travis REST API
https://github.com/spirals-team/jtravis
java travis-ci travis-ci-api
Last synced: 10 months ago
JSON representation
A java binding for the TravisCI Travis REST API
- Host: GitHub
- URL: https://github.com/spirals-team/jtravis
- Owner: Spirals-Team
- License: lgpl-3.0
- Created: 2018-01-26T13:11:48.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-12-05T22:07:24.000Z (over 2 years ago)
- Last Synced: 2024-04-17T11:14:14.576Z (about 2 years ago)
- Topics: java, travis-ci, travis-ci-api
- Language: Java
- Homepage:
- Size: 2.49 MB
- Stars: 7
- Watchers: 9
- Forks: 4
- Open Issues: 5
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# jtravis [](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22fr.inria.jtravis%22%20AND%20a%3A%22jtravis%22) [](https://travis-ci.org/Spirals-Team/jtravis) [](https://coveralls.io/github/Spirals-Team/jtravis?branch=master)
The purpose of this project is to propose a Java API in order to use Travis-CI API.
## Install
```bash
mvn install
```
## Usage
The API can be immediately used after specifying the following dependency in your pom.xml:
```xml
fr.inria.jtravis
jtravis
2.0
```
The API rely on Travis CI API V3 for most of its part, but some endpoints of Travis CI API V2 are still available (like /jobs endpoint).
It *does not* allow to trigger new builds for now. But it does not require to use TravisCI authentication either.
### Limitations
This tool has primarily been developed in order to study Java builds using Maven tools: so, most features rely on that choice.
Don't hesitate to propose pull requests in order to enhance the current state of this library.
### Github Integration
JTravis uses Github API in order to get useful information about pull requests when builds has been triggered by pull requests.
See [javadoc from github-api library](http://github-api.kohsuke.org/apidocs/org/kohsuke/github/GitHubBuilder.html#fromEnvironment--) for more information.
### Usage example
```java
JTravis jTravis = new JTravis.Builder().build(); // you can specify in the builder the Github API token and/or the Travis CI API token
Optional repository = jTravis.repository().fromSlug("Spirals-Team/jtravis");
if (repository.isPresent()) {
Optional optionalBuilds = jTravis.build().fromRepository(repository.get());
if (optionalBuilds.isPresent()) {
for (Build build : optionalBuilds.get().getBuilds()) {
System.out.println("build id: "+build.getId()+" status: "+build.getState().name());
}
}
}
```
## Aknowledgement
This project has been funded by the InriaHub / ADT LibRepair.