Repository that contains configuration to quickly deploy following tools with docker-compose:
-
nginx
-
jenkins
-
nexus
-
sonarqube
2 VMs with docker and docker-compose installed and static IP addresses
-
Install docker
-
/etc/docker/daemon.json
example{ "storage-driver": "overlay2", "insecure-registries": [ ], "log-driver": "json-file", "log-opts": { "max-size": "100m", "max-file": "3" } }
-
To start docker after VM reboot
systemctl enable docker
-
-
Install docker-compose
-
To be able run sonarqube execute following commands on the VM where sonarcube will be placed
sysctl -w vm.max_map_count=262144 sysctl -w fs.file-max=65536 ulimit -n 65536 ulimit -u 4096
First VM will host only nexus, second is for all other components
-
Execute
mkdir poc cd poc mkdir -p volumes/nexus/nexus-data mkdir volumes/nexus/sonatype-work chmod -R 777 volumes
-
Place
vm1.yaml
topoc
dir -
Execute
docker-compose -f vm1.yaml up -d
-
Verify installation
docker ps
-
Navigate to
<vm1_ip>:8081/nexus
and login. Initial admin password can be seen by commandcat volumes/nexus/sonatype-work/nexus3/admin.password
-
To create any kind of registry - maven/docker/npm and so on - navigate to
Server administration and configuration → Repositories → Create repository
, but we will use defaultmaven-releases
repository that is already in nexus
-
Execute
mkdir poc cd poc mkdir -p volumes/jenkins mkdir -p volumes/sonarqube/conf mkdir volumes/sonarqube/data mkdir volumes/sonarqube/extensions mkdir volumes/sonarqube/logs mkdir volumes/sonarqube/bundled-plugins mkdir volumes/postgresql chmod -R 777 volumes
-
Place
vm2.yaml
andnginx.conf
topoc
dir -
Change ip addresses in
nginx.conf
to yours -
Execute
docker-compose -f vm2.yaml up -d
-
Verify installation
docker ps
-
All tools should be accessible
-
<vm2_ip>/nexus
-
<vm2_ip>/sonarqube
-
<vm2_ip>/jenkins
-
-
Default credentials for sonarqube are
admin/admin
-
In sonarqube navigate to
Administration → Marketplace
and install java and jacoco plugins -
Initial jenkins configuration
-
Following instructions, enter initial admin password that can be displayed using command
cat volumes/jenkins/secrets/initialAdminPassword
-
Following instructions, install default plugins and create first admin user
-
Navigate to 'configure jenkins → manage plugins' and install
Multibranch Scan Webhook Trigger
plugin -
Create jenkins secrets (left panel in main menu)
-
username/password for sonarqube with id
sonarqube
-
username/password for nexus with id
nexus
-
ssh key for git, public key should be added in your github profile settings
-
-
Using the same job multibranch configuration, as in deployed jenkins, create the same job, but in configuration specify your git credentials and fork repository from
https://github.com/TolikT/springboot-sample
-
ip addresses in
gradle.properties
ofspringboot-sample
repository should be changed to yours
-