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
Lets get started:
I am running and tested docker v1.11 and docker-compose v.1.6 and linux kernel 4.5.2
- Install docker and docker-compose on your linux build server. Make sure the docker daemon is started.
mkdir ~/docker git clone https://github.com/devnull-0/cd-chain.git ~/docker/ cd ~/docker/buildstack
- Download docker and rancher-compose binary and save to
- 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_EMAILemail@example.com - GITLAB_EMAIL_REPLY_TOfirstname.lastname@example.org - GITLAB_INCOMING_EMAIL_ADDRESSemail@example.com - SMTP_DOMAIN=example.com - SMTP_HOST=smtp.example.com - SMTP_PORT=25 - SMTP_USER= - SMTP_PASS= - SMTP_STARTTLS=false - SMTP_AUTHENTICATION=none
- 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"
- 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