-
Notifications
You must be signed in to change notification settings - Fork 45
Supported Languages
The supported languages for generating lifecycles is dictated by Jenkins
administrators in the lifecycles.json file. Here's the sample
lifecycles.json for the master branch. Initial wishlist of
supported languages is groovy, java, ruby, and python. Here is a list
of languages supported by Travis CI.
The most basic .jervis.yml file for a Groovy project will have the following
contents.
language: groovyIf you need to override one of the steps then you can do so in the following manner.
language: groovy
install: true
script: ./build.shBy using true to override a step it will effectively skip that step by
executing /bin/true. Jervis will then detect the following build tools in
order.
If your project has a gradlew file in the root of the repository then Jervis
will run the following install command to install dependencies.
install: ./gradlew assembleJervis will execute the following script command to run unit tests.
script: ./gradlew checkIf Jervis doesn't have a gradlew file then it will fall back to checking for
Gradle.
If your project has a build.gradle file in the root of the repository then
Jervis will run the following install command to install dependencies.
install: gradle assembleJervis will execute the following script command to run unit tests.
script: gradle checkIf Jervis doesn't have a build.gradle file then it will fall back to checking
for Maven.
If your project has a pom.xml file in the root of the repository then Jervis
will run the following install command to install dependencies.
install: mvn install -DskipTests=trueJervis will execute the following script command to run unit tests.
script: mvn testIf Jervis doesn't have a pom.xml file then it will fall back to generating a
script for Ant.
Ant has no standard way of installing dependencies. Therefore, there is no
default install command defined. However, you can define one yourself. For
example,
install: ant depsJervis will execute the following script command to run unit tests.
script: ant testSee Groovy build matrix support.
The most basic .jervis.yml file for a Java project will have the following
contents.
language: javaIf you need to override one of the steps then you can do so in the following manner.
language: java
install: true
script: ./build.shBy using true to override a step it will effectively skip that step by
executing /bin/true. Jervis will then detect the following build tools in
order.
If your project has a gradlew file in the root of the repository then Jervis
will run the following install command to install dependencies.
install: ./gradlew assembleJervis will execute the following script command to run unit tests.
script: ./gradlew checkIf Jervis doesn't have a gradlew file then it will fall back to checking for
Gradle.
If your project has a build.gradle file in the root of the repository then
Jervis will run the following install command to install dependencies.
install: gradle assembleJervis will execute the following script command to run unit tests.
script: gradle checkIf Jervis doesn't have a build.gradle file then it will fall back to checking
for Maven.
If your project has a pom.xml file in the root of the repository then Jervis
will run the following install command to install dependencies.
install: mvn install -DskipTests=trueJervis will execute the following script command to run unit tests.
script: mvn testIf Jervis doesn't have a pom.xml file then it will fall back to generating a
script for Ant.
Ant has no standard way of installing dependencies. Therefore, there is no
default install command defined. However, you can define one yourself. For
example,
install: ant depsJervis will execute the following script command to run unit tests.
script: ant testSee Java build matrix support.
Python does not have a standard way for building so the install and script
key should be specified in the YAML file.
language: python
install: pip install -r requirements.txt
script: python setup.py testThe following toolchains can be customized for Python.
language: python
python: 2.7Jervis uses virtualenv to isolate python environments. The
default python used is: python: 2.7. virtualenv is activated before the
python build starts. If virtualenv is not desirable or a different virtualenv
is desired then the before_install step can be used to deactivate virtualenv.
before_install: deactivate
Then proceed to activate your own virtualenv. There are multiple pythons available for use. Current supported versions of python in the example toolchains.json are:
- 2.6
- 2.7
- 3.2
- 3.3
- 3.4
- pypy
- pypy3
For example, if you wanted to use the latest Python 3.4, then the following YAML will accomplish that.
python: 3.4See Python build matrix support.
The most basic .jervis.yml file for a Ruby project will have the following
contents.
language: rubyBy default ruby will execute the following install and script.
install: bundle install --jobs=3 --retry=3
script: bundle exec rakeIf a Gemfile.lock file exists in the root of the repository then
--deployment option is added to the install command.
The following toolchains are setup and are customizable for building ruby projects.
By default, the gemfile is Gemfile.
gemfile sets up the environment by exporting the environment variable
BUNDLE_GEMFILE. Here's an example for non-standard path Gemfile.
gemfile: custom/GemfileBy default, Ruby rvm loads Ruby 1.9.3. This can be customized.
rvm: 2.4.2By default, ruby loads OpenJDK 8. This can be customized.
jdk: openjdk9See Ruby build matrix support.
Is a basic and empty language type defined to run scripts in the default shell
of any selected platform and operating system. Shell does not have a standard
way for building so the install and script key should be specified in the
YAML file.
language: shell
script: echo "Hello World."See Shell build matrix support.
- Build overview
- Supported languages
- Supported build tools
- Publish results
- Additional topics:
- Quickstart
- Background information
- Knowledge checklist
- Required Jenkins Plugins
- Labels for Jenkins Agents
- Key security concepts
- Operationalize Jenkins
- High availability
- Disaster recovery
- Pipeline support
- Extending support