/ docker

continuous delivery chain, part 1

In the first part of this series I will focus on the build chain. In part two I will provide an example of a build pipeline with interactive steps. The last part of this series will deal with rancher and how it integrates in Jenkins.
Our example apps we're going to deliver in our pipeline are the dockercoins apps from Jérôme Petazzoni.
The chain of tools for continuous delivery (cd) and continuous integration (ci) are based on following applications. All of them are running inside docker containers:

  • GitLab (incl. push to Jenkins)
  • Jenkins (using recent version 2 for pipelining)
  • Selenium Hub for GUI Tests
  • docker (for building images)
  • Rancher for the delivery part in cd

The build stack I am using is based on a great blog post from Marcel Birkner from codecentric. Here you can find his recorded webinar with slides and q&a.

Lets get started:
I am running and tested docker v1.11 and docker-compose v.1.6 and linux kernel 4.5.2

  1. Install docker and docker-compose on your linux build server. Make sure the docker daemon is started.

  2. mkdir ~/docker git clone https://github.com/devnull-0/cd-chain.git ~/docker/ cd ~/docker/buildstack

  3. Download docker and rancher-compose binary and save to ./jenkins/bin

  4. modify following items in docker-compose.yml to fit your needs:
        - GITLAB_TIMEZONE=Berlin
        - GITLAB_SECRETS_DB_KEY_BASE=long-and-random-alphanumeric-string
        - GITLAB_HOST=buildserver.example.com
        - GITLAB_EMAIL=buildmaster@example.com
        - GITLAB_EMAIL_REPLY_TO=buildmaster@example.com
        - GITLAB_INCOMING_EMAIL_ADDRESS=buildmaster@example.com
        - SMTP_DOMAIN=example.com
        - SMTP_HOST=smtp.example.com
        - SMTP_PORT=25
        - SMTP_USER=
        - SMTP_PASS=
        - SMTP_STARTTLS=false
  5. Start the stack by running following command cd ~/docker/buildstack && docker-compose up -d
    If all went fine docker-compose psshould show all services as "Up"

  6. Use following credentials to access your chain
    App URL credentials
    Jenkins http://build.example.com:18080/ none
    GitLab http://build.example.com:10080/ root / 5iveL!fe
    SonarQube http://build.example.com:19000/ admin / admin
    Nexus http://build.example.com:18081/ admin / admin123
    Selenium Grid http://build.example.com:4444/grid/console none
Find below the links to the next parts: Part 2 Part 3