-
Notifications
You must be signed in to change notification settings - Fork 45
Specification for lifecycles file
This is the general description of the supported language format listing default commands. This will be used to generate default commands depending on the language and files detected in the repository.
language:
friendlyName: my friendly name
defaultKey: somekey
somekey:
fileExistsCondition: somefile
fallbackKey: some other key
env: export somevar=value
before_install: some command
install: some command
before_script: some command
script: some command
after_success: some command
after_failure: some command
after_script: some command
some other key:
install: some command
script: some command
-
language
- is the language that the commands are set up for. e.g.groovy
,python
,ruby
,java
, etc. The language is the root key of the object and will be used to look up default commands for all of the different command generation cases. The following keys fall under the language. Validation: This key is required.-
friendlyName
- A friendly name which can be used to reference the language. This is sometimes different than the key used to reference the language. Provides a user friendly means of printing out the language being used. e.g. Instead ofcpp
it isC++
. Validation: This key is required. -
defaultKey
- This is the default key which will be used to look up the default commands to be generated. Validation: This key is required. The value of this key must exist as another key in the same level as this key. e.g."somekey"
. -
somekey
- This key is one or more keys in which will, by convention, be named after the build tool the commands are related to. e.g.gradle
,ant
,maven
, etc. Validation: This key is required if it is referenced by any other keys (i.e. referenced bydefaultKey
or afallbackKey
).-
fileExistsCondition
- IffileExistsCondition
key does not exist then jervis uses the default commands in this parent key. IffileExistsCondition
key does exist AND the file exists then jervis uses the default commands in this parent key. IffileExistsCondition
key does exist AND the file does not exist then it will use thefallbackKey
to try to fall back to another key. IffileExistsCondition
key does exist AND the file does not exist ANDfallbackKey
does not exist then jervis uses the default commands in this parent key. Validation: This key is optional. This key is required iffallbackKey
exists. -
fallbackKey
- Reference a key that the program should fall back to for other defaults. Validation: This key is optional. If this key exists then the fallback key,"some other key"
, must exist.fileExistsCondition
becomes a required key if this key is used. -
env
- Used to set any environment variables which will be included before thebefore_install
step is executed. Validation: This key is optional. -
before_install
- The contents of this key may either be a string of commands to execute (one line). Validation: This key is optional. -
install
- The contents of this key may either be a string of commands to execute (one line). Validation: This key is optional. -
before_script
- The contents of this key may either be a string of commands to execute (one line). Validation: This key is optional. -
script
- The contents of this key may either be a string of commands to execute (one line). Validation: This key is optional. -
after_success
- The contents of this key may either be a string of commands to execute (one line). Validation: This key is optional. -
after_failure
- The contents of this key may either be a string of commands to execute (one line). Validation: This key is optional. -
after_script
- The contents of this key may either be a string of commands to execute (one line). Validation: This key is optional.
-
-
These are similar in concept to the Travis Build Lifecycle.
Here's an example of our supported language key when we're supporting just the groovy
language. This example is based on the "Building a Groovy Project" Travis CI Documentation. In the groovy project docs it first tries gradle, then falls back to maven, and finally falls back to ant. The following represents that.
groovy:
friendlyName: Groovy
defaultKey: gradle
gradle:
fileExistsCondition: build.gradle
fallbackKey: maven
install: gradle assemble
script: gradle check
maven:
fileExistsCondition: pom.xml
fallbackKey: ant
install: mvn install -DskipTests=true
script: mvn test
ant:
script: ant test
Now we're going to add another language, ruby
, to the previous example. This example is based on the "Building a Ruby Project" Travis CI Documentation.
groovy:
friendlyName: Groovy
defaultKey: gradle
gradle:
fileExistsCondition: build.gradle
fallbackKey: maven
install: gradle assemble
script: gradle check
maven:
fileExistsCondition: pom.xml
fallbackKey: ant
install: mvn install -DskipTests=true
script: mvn test
ant:
script: ant test
ruby:
friendlyName: Ruby
defaultKey: rake1
rake1:
fileExistsCondition: Gemfile.lock
fallbackKey: rake2
install: bundle install --jobs=3 --retry=3 --deployment
script: bundle exec rake
rake2:
install: bundle install --jobs=3 --retry=3
script: bundle exec rake
The groovy
and ruby
language keys are independent of each other. It depends on the language: groovy
or language: ruby
setting in the .travis.yml
.
- 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