Skip to content

An automated Jenkins CI environment which provisions agent infrastructure on the fly per build.

License

Notifications You must be signed in to change notification settings

samrocketman/jenkins-bootstrap-jervis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bootstrap Jenkins using Jervis Build Status

Jervis generates Jenkins jobs using Travis CI YAML. This project is meant to bootstrap Jenkins from scratch and pre-configure it to use Jervis.

Instructions

Clone this project

This project uses a submodule. Therefore, cloning it must include also cloning the submodule.

git clone --recursive https://github.com/samrocketman/jenkins-bootstrap-jervis.git

GitHub API key

Log into GitHub and generate an API token so that Jervis can authenticate to the GitHub API.

Provision Jenkins

Using Vagrant is the recommended way to provision. Copy settings.groovy.EXAMPLE to settings.groovy and fill in the GitHub personal access token.

export VAGRANT_JENKINS=1
vagrant up
./jervis_bootstrap.sh

Visit http://localhost:8080/ to see Jenkins running with Jervis. Simply read the Welcome page for next steps. The first example will guide you through onboarding the Jervis project for CI.

Screenshot

Jervis built from the main branch by this Jenkins instance.

Screenshot Jervis matrix pipeline

Jervis built from the jervis_simple branch by this Jenkins instance.

Screenshot Jervis simple pipeline

Webhook relay

If you wish to try out this project with webhook integration then I recommend taking advantage of the webhookrelay service.

Provision Jenkins in vagrant and then provision a relay automatically. Pro-tip: start the relay in a screen session so it's easy to detach.

vagrant ssh
curl -sSL https://storage.googleapis.com/webhookrelay/downloads/relay-linux-amd64 > relay && chmod +x relay && sudo mv relay /usr/local/bin
relay forward -b jervis -t internal http://localhost:8080/github-webhook/

Username (token Access Key) and password (token Secret Key) comes from webhookrelay tokens.

Update the settings.groovy file by setting the github_plugin > hookUrl setting to the value of the webhookrelay "input".

Example webhookrelay "input" URL: https://my.webhookrelay.com/v1/webhooks/<uuid>

Configure Jenkins normally and GitHub repository hooks will now be configured with a proper webhook when jobs are generated.

License