Skip to content

To implement on QA server

  1. Build the jenkins-blueocean image and spin it up in order to get the SSh key pair is generated:
1
docker-compose -f docker-compose.yml up --force-recreate --build -d jenkins-blueocean
  1. Add the jenkins (@blueocean) SSH pub key to host .env file (so it’s gets picked by the SSH agent agent)
1
echo "JENKINS_SLAVE_SSH_PUBKEY=$(docker exec -it jenkins-blueocean cat /var/jenkins_home/.ssh/id_rsa.pub)" > .env
  1. Finally, run all services:

1
docker-compose -f docker-compose.yml up --force-recreate -d 
If you run docker ps now, you should see all our containers running (hopefully!)

  1. Get the default Jenkins password from the jenkins-blueocean container (and copy it):
1
docker exec -it jenkins-blueocean cat /var/jenkins_home/secrets/initialAdminPassword
  1. Go to jenkins https://jenkins.mobomo.net/ and use the above copied pass to login

  2. Configure Jenkins

  3. Add all the required plugins (for MBN we are using):

    • GitHub Authentication
    • Docker
    • SSH Agent

Useful commands

For the agent

For Jenkins

Backup volume/jenkins_home

1
docker run --volumes-from jenkins-blueocean -v $(pwd):/backup debian tar -zcvf /backup/$(date +%Y-%m-%d)_jenkins-blueocean.tar.gz --exclude=workspace /var/jenkins_home
generates tar.gz file on the host, excluding the workspace dir.

Restore

1
docker run --volumes-from jenkins-blueocean -v $(pwd):/backup debian tar -zxvf /backup/jenkins-blueocean.tar.gz