Skip to content

Docker Infrastructure via docker-compose (Jenkins, SonarQube, Nexus, GitLab)

License

Notifications You must be signed in to change notification settings

hieucao/docker-ci-tool-stack

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CI Tools Demo

This GitHub repository contains Dockerfiles for running a set of Continuous Integration Tools with a single command. The diagram contains all tools used in the Docker containers.

Docker CI Tools

Blog article on the CI Docker Container, https://blog.codecentric.de/en/2015/10/continuous-integration-platform-using-docker-container-jenkins-sonarqube-nexus-gitlab

Prerequisites (Mac)

You should have Docker Toolbox installed, see https://www.docker.com/toolbox

I am using docker-compose to start several docker container at once. Since all containers run in a single VM (virtualbox), this VM needs enough memory.

Step 0 - List Docker Machine

~/git/docker-ci-tool-stack$ docker-machine ls

NAME      ACTIVE   DRIVER       STATE     URL                         SWARM
default   *        virtualbox   Running   tcp://192.168.99.100:2376

Step 1 - Stop your docker VM

docker-machine stop default

Step 2 - Increase Memory via VirtualBox UI

I am using 6000MB for my VM.

VirtualBox

Step 3 - Start VM

docker-machine start default

Getting started

To get all docker containers up and running use:

git clone [email protected]:marcelbirkner/docker-ci-tool-stack.git
cd docker-ci-tool-stack
docker-compose up

Access Tools

Tool Link Credentials
Jenkins http://${docker-machine ip default}:18080/ no login required
SonarQube http://${docker-machine ip default}:9000/ admin/admin
Nexus http://${docker-machine ip default}:18081/nexus admin/admin123
GitLab http://${docker-machine ip default}:10080/ root/5iveL!fe
Selenium Grid http://${docker-machine ip default}:4444/grid/console no login required

Screenshots

Here is an overview of all tools:

  • GitLab is used for storing the Source Code
  • Jenkins contains build job and is triggered once projects in GitLab are updated
  • As part of the CI build, Jenkins triggers a static code analysis and the results are stored in SonarQube
  • The Maven build uses Nexus as a Proxy Repository for all 3rd party libs. The build artifacts are deployed to the Nexus Release Repository
  • The Selenium Grid contains Docker containers running Chrome and Firefox and is used for UI tests

Jenkins Jobs

There are several jobs preconfigured in Jenkins. The Jobs cover the following tasks:

  • Continuous Integration Build with Maven
  • Unit Tests
  • Static Source Analysis results are stored in SonarQube
  • JaCoCo Test Coverage
  • Deployment to Nexus
  • Jenkins Job DSL examples
  • Selenium UI Test

Conference App Jobs

Conference App CI Job

SonarQube Dashboard

Jenkins Jobs

Nexus Repository

Nexus Proxy Repository

Selenium Grid

Selenium Grid

Testing Upgrades

In order to test new versions, I prefer starting out with a blank VirtualBox image. That eliminates any side effects. Afterwards you can throw away the image.

# Create new image
docker-machine create --driver virtualbox docker-ci-v1

# Configure shell environment
eval "$(docker-machine env docker-ci-v1)"

# Stop new image, in order to increase Memory via VirtualBox Manager
docker-machine stop docker-ci-v1

# Start image
docker-machine start docker-ci-v1

About

Docker Infrastructure via docker-compose (Jenkins, SonarQube, Nexus, GitLab)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Groovy 96.4%
  • Shell 3.6%