Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Jenkins CI with Rancher-Server

This document explains the setup of a rancher-server cluster running a complete CI environment consisting of:

  • a gerrit SCM (git) server (if you arenot familiar with gerrit, think of it as a private github server)
  • a jenkins CI/CD server (your private server)
  • a nexus repository server (aka your private maven central) which can mirror maven artifacts and also serve as a private docker registry

Please also see the accompanying other github repositories

Basic Setup

  1. Setup VMs

     cd 01-setupvms

    please check /etc/hosts whether the new hosts have been added , otherwise add them manually

     docker-machine ip rancher-server
     docker-machine ip rancher-agent-01

    make sure that entries for rancher-server.shared, rancher-server   	rancher-server.shared rancher-server   	rancher-agent-01.shared rancher-agent-01
  2. create the local docker registry for pre-caching all images (only for presentation)

  3. cache images that we will need (optional) (not needed when using presentation registry)


  4. start registry gui (just to see whats in there)


    open http://rancher-server:9000/ to check the local presentation registry

  5. start rancher-server

  6. add rancher-agent


    this will open a web browser with the correct commandline, copy it to the file and make the following changes:

    1. remove the sudo as this is not necessary on mac with docker-machine

    2. add rancher-server:5000 before rancher/agent:v1.2.2 in order to make it download from our cache registry

    3. once this is done execute the updated script


  7. setup api keys


    this will open a web browser and navigate to the "Add api key" page on your server

    • choose the following values
    • name: rancher-cli
    • description: access the server via cli
    • now copy the key
  8. download rancher CLI brew install rancher-cli, or directly download from

  9. setup rancher CLI

     rancher config 
    • URL: http://rancher-server:8080
    • keys: here you have to enter the secrets that you have set up in step 6
  10. build the rancher-cli docker image

     cd ../../container/rancher-cli-configured
    1. update the access keys you have copied from the web page

    2. build the container and push it to our demo registry


Setup Infrastructure stacks


  1. start the nexus stack (already contains all config)

     cd ../stacks/repository-nexus
     rancher up -d
  2. once the registry is up you can log into it from all your nodes

  3. create a jenkins user

    • username: jenkins
    • password: password
    • role : Admin

    Usually you would use the credentials from active directory / LDAP but for the demo we make it quick

  4. add the nexus repository to the rancher UI



  1. launch the stack

     cd ../gerrit
     rancher up -d

    Note that usually you would launch gerrit with the parameters for LDAP auth, for more info, check:

  2. add your .ssh/ to the admin ssh key list


  3. create a jenkins user with SSH key and projects

  4. setup verified permission for admin group on "all projects"

    1. add verified label (for more info check the Documentation about "Verified" label


      Click on "Edit Config"

       [label "Verified"]
         function = MaxWithBlock
         value = -1 Fails
         value =  0 No score
         value = +1 Verified
    2. now click on "Access" to add the permission to reference refs/heads/*

      label verified

  5. finally push the following projects to gerrit

    • rancher-jenkins-seed-jobs (ssh://admin@rancher-agent-01:29418/demo/rancher-jenkins-seed-jobs)
    • demo_webshop (ssh://admin@rancher-agent-01:29418/demo/webshop)


  1. in order to launch Jenkins we need the SEED repo, TODO

    (?) on gerrit or github?

  2. launch jenkins

     cd ../jenkins
     rancher up -d
  3. go to jenkins web UI and launch the seed job


Further reading

More details can be found at Lanyrd.


The instruction repository containing the conference slides and instructions on how to setup a jenkins CI environment on a Rancher Server cluster







No releases published


No packages published