eea / eea.docker.jenkins

Docker images for Jenkins master-slave
https://registry.hub.docker.com/u/eeacms/jenkins
31 stars 36 forks source link

Docker orchestration for EEA Jenkins CI

Docker orchestration for EEA Jenkins

Changes

Installation

  1. Install Docker.
  2. Install Docker Compose.

Usage

$ git clone https://github.com/eea/eea.docker.jenkins.git
$ cd eea.docker.jenkins
$ docker-compose up -d

Setup Jenkins at [http://localhost]()

Restore existing jenkins configuration

Production

Deployment

Note: See EEA SVN for answers.txt files

Production data migration

You can access production data for Jenkins Master is within jenkins-master volume:

jenkins-master:/var/jenkins_home

And jenkins-worker volumes:

jenkins-worker:/var/jenkins_home/worker

Thus:

  1. Start rsync client on host where do you want to migrate Jenkins master data (DESTINATION HOST):

    $ docker run -it --rm --name=r-client -v jenkins-master:/var/jenkins_home  eeacms/rsync sh
  2. Start rsync server on host from where do you want to migrate Jenkins master data (SOURCE HOST):

    $ docker run -it --rm --name=r-server -p 2222:22 --v jenkins-master:/var/jenkins_home  \
                 -e SSH_AUTH_KEY="<SSH-KEY-FROM-R-CLIENT-ABOVE>" \
             eeacms/rsync server
  3. Within rsync client container from step 1 run:

    $ rsync -e 'ssh -p 2222' -avz --numeric-ids root@<SOURCE HOST IP>:/var/jenkins_home/ /var/jenkins_home/
  4. Start rsync client on host where do you want to migrate Jenkins worker data (DESTINATION HOST):

    $ docker run -it --rm --name=r-client -v jenkins-worker:/var/jenkins_home/worker eeacms/rsync sh
  5. Start rsync server on host from where do you want to migrate Jenkins worker data (SOURCE HOST):

    $ docker run -it --rm --name=r-server -p 2222:22 -v jenkins-worker:/var/jenkins_home/worker \
                 -e SSH_AUTH_KEY="<SSH-KEY-FROM-R-CLIENT-ABOVE>" \
             eeacms/rsync server
  6. Within rsync client container from step 4 run:

    $ rsync -e 'ssh -p 2222' -avz --numeric-ids --exclude="workspace" root@<SOURCE HOST IP>:/var/jenkins_home/worker/ /var/jenkins_home/worker/

Copyright and license

The Initial Owner of the Original Code is European Environment Agency (EEA). All Rights Reserved.

The Original Code is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Funding

European Environment Agency (EU)