├── jenkins-ci ├── config │ ├── .ssh │ │ ├── config │ │ ├── id_rsa.pub │ │ └── id_rsa │ ├── openshift-settings.xml │ ├── sonar-settings.xml │ ├── maven-settings.xml │ ├── job-test-func.xml │ ├── job-deploy-systest.xml │ ├── job-deploy-perftest.xml │ ├── job-deploy-preprod.xml │ ├── job-deploy-dev.xml │ ├── job-test-int.xml │ ├── job-build.xml │ ├── job-analysis.xml │ ├── job-test-sys.xml │ ├── job-test-perf.xml │ ├── jenkins-config.xml │ └── job-release.xml └── Dockerfile ├── images ├── cd-openshift.png ├── jenkins-config.png └── delivery-pipeline.png ├── docker-compose.yml ├── .demo.yaml ├── .demo-config.json └── README.md /jenkins-ci/config/.ssh/config: -------------------------------------------------------------------------------- 1 | Host * 2 | StrictHostKeyChecking no 3 | -------------------------------------------------------------------------------- /images/cd-openshift.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbossdemocentral/continuous-delivery-demo/HEAD/images/cd-openshift.png -------------------------------------------------------------------------------- /images/jenkins-config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbossdemocentral/continuous-delivery-demo/HEAD/images/jenkins-config.png -------------------------------------------------------------------------------- /images/delivery-pipeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbossdemocentral/continuous-delivery-demo/HEAD/images/delivery-pipeline.png -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | sonar: 2 | image: siamaksade/sonar 3 | ports: 4 | - "9000:9000" 5 | nexus: 6 | image: siamaksade/nexus:2.8.1 7 | ports: 8 | - "8081:8081" 9 | jenkins: 10 | build: ./jenkins-ci 11 | links: 12 | - nexus:nexus 13 | - sonar:sonar 14 | ports: 15 | - "8080:8080" 16 | 17 | -------------------------------------------------------------------------------- /jenkins-ci/config/.ssh/id_rsa.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDIAkG/mLT+PWcN8zpwOL9BWSsHeBhXXksjCtixxIsRFmKBxIP4UysUGHeCmtdjVc3xBfZD16ugQ/rHR3KPl5bfSv5W5NTBLHf9dAzBZrbcz54hgVgZvrhK5d3Rbv59V6Fjyo82EXWjHMem793rG5D7Ph1SDHXXrVhQDivtN/SqhHvnv0SEfUUtWYhzUhhxDrLNcdEs33PxIz0qt8e4BNlTQTKnuZvwiQwPl2BDfr06sx5Tvy/C+32FdgQ4+Kxd0uOX0LBovXA0DX007Y8/X0MM+GrB7tfK+65LR9MpZb1IOE9J7sUj/G8F9wCg3FjzgJfm1uLEJ1qaAB5552yydba/ rhdemoss@gmail.com 2 | -------------------------------------------------------------------------------- /jenkins-ci/config/openshift-settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | /var/lib/jenkins/.ssh/id_rsa.pub 4 | 5 | 6 | openshift 7 | openshift.redhat.com 8 | demo 9 | demo 10 | 11 | 12 | -------------------------------------------------------------------------------- /.demo.yaml: -------------------------------------------------------------------------------- 1 | id: continuous-delivery-eap 2 | title: Continuous delivery demo using JBoss EAP 3 | github_repo_url: https://github.com/jbossdemocentral/continuous-delivery-demo 4 | technologies: 5 | - Jenkins 6 | - Nexus 7 | - Sonar 8 | summary: This demo sets up a complete Continuous Delivery environment running in Docker containers and uses OpenShift as the deployment environment. As the artifact moves forward in the delivery pipeline, new containers (gears) are created on OpenShift and the artifact gets deployed onto these containers which represent Dev, System Test, Performance Test and Pre-Production environments. 9 | level: Advanced 10 | product: eap 11 | content: https://raw.githubusercontent.com/jbossdemocentral/continuous-delivery-demo/master/README.md 12 | author: Thomas Qvarnstrom & Siamak Sadeghianfar 13 | -------------------------------------------------------------------------------- /jenkins-ci/config/sonar-settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Sonar 7 | false 8 | http://sonar:9000 9 | 10 | jdbc:postgresql://sonar:5432/sonar 11 | org.postgresql.Driver 12 | 13 | 14 | 15 | 16 | false 17 | false 18 | 19 | 20 | admin 21 | YWRtaW4= 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /.demo-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"Continuous delivery demo using JBoss EAP", 3 | "summary":"This demo sets up a complete Continuous Delivery environment running in Docker containers and uses OpenShift as the deployment environment. As the artifact moves forward in the delivery pipeline, new containers (gears) are created on OpenShift and the artifact gets deployed onto these containers which represent Dev, System Test, Performance Test and Pre-Production environments.", 4 | "author":"Thomas Qvarnstrom & Siamak Sadeghianfar", 5 | "category":"eap", 6 | "level":"Advanced", 7 | "published":true, 8 | "prerequisites":"Docker natively or boot2docker (or similar)", 9 | "targetProduct":"JBoss EAP", 10 | "productVersion":"JBoss EAP 6.3", 11 | "technologies": ["Jenkins","Nexus", "Sonar" ], 12 | "img_src":"https://raw.githubusercontent.com/jbossdemocentral/continuous-delivery-demo/master/images/cd-openshift.png", 13 | "links": [ 14 | { 15 | "name":"Code", 16 | "url":"https://github.com/jbossdemocentral/continuous-delivery-demo" 17 | }, 18 | { 19 | "name":"Video", 20 | "url":"https://youtu.be/28ijmCAaWc0" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /jenkins-ci/config/maven-settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | deployment 5 | admin 6 | admin123 7 | 8 | 9 | 10 | 11 | 12 | nexus 13 | * 14 | http://nexus:8081/nexus/content/groups/public 15 | 16 | 17 | 18 | 19 | nexus 20 | 21 | 22 | 23 | 24 | central 25 | http://central 26 | true 27 | true 28 | 29 | 30 | 31 | 32 | central 33 | http://central 34 | true 35 | true 36 | 37 | 38 | 39 | 40 | 41 | 42 | nexus 43 | 44 | -------------------------------------------------------------------------------- /jenkins-ci/config/.ssh/id_rsa: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEowIBAAKCAQEAyAJBv5i0/j1nDfM6cDi/QVkrB3gYV15LIwrYscSLERZigcSD 3 | +FMrFBh3gprXY1XN8QX2Q9eroEP6x0dyj5eW30r+VuTUwSx3/XQMwWa23M+eIYFY 4 | Gb64SuXd0W7+fVehY8qPNhF1oxzHpu/d6xuQ+z4dUgx1161YUA4r7Tf0qoR7579E 5 | hH1FLVmIc1IYcQ6yzXHRLN9z8SM9KrfHuATZU0Eyp7mb8IkMD5dgQ369OrMeU78v 6 | wvt9hXYEOPisXdLjl9CwaL1wNA19NO2PP19DDPhqwe7XyvuuS0fTKWW9SDhPSe7F 7 | I/xvBfcAoNxY84CX5tbixCdamgAeeedssnW2vwIDAQABAoIBAQC/fCmmXXUq026O 8 | lIcmWa4BynS/ueLUApq8+e1shFcADQZSZupSHI3pt2Lzz3rWx5dbYfHcEedmkK7P 9 | iz/K6b6wGQRX/M0UBJb8ONbdcpEv5jXmrgbC3y1hx6EOmc1cA0GoYI2rnhuaBju/ 10 | P3afWMz9PQKlQvivfG5IdsjnW+MKPAryTaNRI2TvUdZTeJL8NT9gKUgQdMVtfQBh 11 | FeBZ4as6Bo4dVVtfCPNhHZWcjCLCzD52ND5Orb48Pr5XRnyVN16cXO46CysduVT1 12 | fC3odj1zUqE/yAldoE2TWzAlnB8VY8DFXKaT3eTfn9gKbN3rUarZFGAKKsIzsePP 13 | 0z+mUFABAoGBAO3jTcHQRkUf5BA3DaXk56v2Gyf5+rrECVQHpFmQSrs2fYDELoGS 14 | wlxdjWMMwFebpmuL7MrY+6Y/UEYDl+8Lvd66BSzdFJZ+2RGNuZhfNhb5gFAinCSW 15 | Hto/dYiOhj3y7jrA8EXY9rghdfz1WoAFJ3fpXnaA7hY9X/JvSGAF9/kBAoGBANc8 16 | peiMK40dMlZuRveSKEj7RepXoINgE2yF6y25Q1my77n3xDBADjl+2svJjcxHvXl8 17 | gk73uXr9spvxqWG3USjznfg9Ybz7ATqqGnVOZ1xpDWp75xytfs92KUwBWNX82sAv 18 | 9g9VcvWa8gzM0C7wLX3zfE10sgTyj0yDCUOZ+++/AoGAXdeGLAe6QLiE4jSliKTV 19 | E0wBiHKfix+cQm7FUaOPJ20mcy5w3iKD06YACWvVUHoRW2mWXqrcEsf1JblzLRSn 20 | sP4W3ozT+05M2RTcexRMJSIFkRcmG3Sw9Q2FkvoOUM/NVJYZ8qPVJ+vjPIeZTNk7 21 | qZ0A66SOx20stVla5q5UFQECgYBi2RWQ0R8HNctyaj7pYBRkQBIB57Bt5WfGRVKW 22 | syi9PzJdg+50AlcGDL5LLQuUL7ZS3t2xio+CbpTijX+uwtPhLND1uqrycYxE9u4j 23 | xZguloh0yOaBAyTj/m5E27GCxRdpgB1POX0MUtarDjzl8aPS3knOALPpFcS97MgK 24 | ZeOQXQKBgHbsWXuYymBIgmeA4IG95EZxXTES6IweNOHZ10K3uk3oXz0OVqRpfqUP 25 | 6XLAbU0dI6iWHB7WJHu8K/E41D3TBZbeX3NnNHfIYJS+uvVydXdoKis5iVFuGe1S 26 | +meS3z4hNAI8Q6oG/1afZxGdFyo3hnnK40bjUqcrS5q77XMjmf/1 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /jenkins-ci/config/job-test-func.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | false 6 | 7 | 8 | Run functional tests 9 | DEV 10 | 11 | 12 | 13 | true 14 | false 15 | false 16 | false 17 | 18 | false 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | ARTIFACT_VERSION=${PIPELINE_VERSION} 27 | 28 | 29 | ticket-monster-deploy-systest, 30 | SUCCESS 31 | false 32 | 33 | 34 | 35 | 36 | ARTIFACT_VERSION=${PIPELINE_VERSION} 37 | 38 | 39 | ticket-monster-deploy-perftest, 40 | SUCCESS 41 | false 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /jenkins-ci/config/job-deploy-systest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | false 6 | 7 | 8 | 9 | 10 | ARTIFACT_VERSION 11 | 12 | 13 | 14 | 15 | 16 | 17 | Deploy to SYS TEST 18 | SYS TEST 19 | 20 | 21 | 22 | true 23 | false 24 | false 25 | false 26 | 27 | false 28 | 29 | 30 | openshift 31 | jbosseap-6 32 | smx 33 | small 34 | systicketmonster 35 | http://nexus:8081/nexus/service/local/artifact/maven/redirect?r=releases&g=org.jboss.examples&a=ticket-monster&v=${ENV,var="ARTIFACT_VERSION"}&e=war 36 | 37 | false 38 | GIT 39 | src/main/resources/openshift 40 | 41 | 42 | 43 | 44 | ticket-monster-test-sys 45 | 46 | SUCCESS 47 | 0 48 | BLUE 49 | true 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /jenkins-ci/config/job-deploy-perftest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | false 6 | 7 | 8 | 9 | 10 | ARTIFACT_VERSION 11 | 12 | 13 | 14 | 15 | 16 | 17 | Deploy to PERF TEST 18 | PERF TEST 19 | 20 | 21 | 22 | true 23 | false 24 | false 25 | false 26 | 27 | false 28 | 29 | 30 | openshift 31 | jbosseap-6 32 | smx 33 | small 34 | perfticketmonster 35 | http://nexus:8081/nexus/service/local/artifact/maven/redirect?r=releases&g=org.jboss.examples&a=ticket-monster&v=${ENV,var="ARTIFACT_VERSION"}&e=war 36 | 37 | false 38 | GIT 39 | src/main/resources/openshift 40 | 41 | 42 | 43 | 44 | ticket-monster-test-perf 45 | 46 | SUCCESS 47 | 0 48 | BLUE 49 | true 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /jenkins-ci/config/job-deploy-preprod.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | false 6 | 7 | 8 | 9 | 10 | ARTIFACT_VERSION 11 | 12 | 13 | 14 | 15 | 16 | 17 | Deploy to PREPROD 18 | PREPROD 19 | 20 | 21 | 22 | true 23 | false 24 | false 25 | true 26 | 27 | 28 | 29 | ticket-monster-test-perf, ticket-monster-test-sys, 30 | 31 | SUCCESS 32 | 0 33 | BLUE 34 | true 35 | 36 | 37 | 38 | false 39 | 40 | 41 | openshift 42 | jbosseap-6 43 | smx 44 | small 45 | preprodticketmonster 46 | http://nexus:8081/nexus/service/local/artifact/maven/redirect?r=releases&g=org.jboss.examples&a=ticket-monster&v=${ENV,var="ARTIFACT_VERSION"}&e=war 47 | 48 | false 49 | GIT 50 | src/main/resources/openshift 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /jenkins-ci/config/job-deploy-dev.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | false 6 | 7 | 8 | 9 | 10 | ARTIFACT_VERSION 11 | 12 | 13 | 14 | 15 | 16 | 17 | Deploy to DEV 18 | DEV 19 | 20 | 21 | 22 | true 23 | false 24 | false 25 | false 26 | 27 | false 28 | 29 | 30 | openshift 31 | jbosseap-6 32 | smx 33 | small 34 | devticketmonster 35 | http://nexus:8081/nexus/service/local/artifact/maven/redirect?r=releases&g=org.jboss.examples&a=ticket-monster&v=${ENV,var="ARTIFACT_VERSION"}&e=war 36 | 37 | false 38 | GIT 39 | src/main/resources/openshift 40 | 41 | 42 | 43 | 44 | ticket-monster-test-func 45 | 46 | SUCCESS 47 | 0 48 | BLUE 49 | true 50 | 51 | 52 | 53 | 54 | 55 | ${ENV,var="ARTIFACT_VERSION"} 56 | false 57 | 58 | 59 | -------------------------------------------------------------------------------- /jenkins-ci/config/job-test-int.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | false 6 | 7 | 8 | Run integration tests 9 | BUILD 10 | 11 | 12 | 13 | 2 14 | 15 | 16 | https://github.com/jbossdemocentral/continuous-delivery-demo-app.git 17 | 18 | 19 | 20 | 21 | */master 22 | 23 | 24 | false 25 | 26 | 27 | 28 | true 29 | false 30 | false 31 | false 32 | 33 | false 34 | 35 | org.jboss.examples 36 | ticket-monster 37 | 38 | package test deploy 39 | true 40 | false 41 | false 42 | false 43 | false 44 | false 45 | false 46 | false 47 | -1 48 | false 49 | false 50 | 51 | 52 | 53 | 54 | 55 | ticket-monster-release 56 | 57 | SUCCESS 58 | 0 59 | BLUE 60 | true 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | FAILURE 69 | 2 70 | RED 71 | true 72 | 73 | -------------------------------------------------------------------------------- /jenkins-ci/config/job-build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | false 6 | 7 | 8 | Build and package 9 | BUILD 10 | 11 | 12 | 13 | 2 14 | 15 | 16 | https://github.com/jbossdemocentral/continuous-delivery-demo-app.git 17 | 18 | 19 | 20 | 21 | */master 22 | 23 | 24 | false 25 | 26 | 27 | 28 | true 29 | false 30 | false 31 | false 32 | 33 | false 34 | 35 | org.jboss.examples 36 | ticket-monster 37 | 38 | package 39 | true 40 | false 41 | false 42 | false 43 | false 44 | false 45 | false 46 | false 47 | -1 48 | false 49 | false 50 | 51 | 52 | 53 | 54 | 55 | ticket-monster-analysis,ticket-monster-test-int 56 | 57 | SUCCESS 58 | 0 59 | BLUE 60 | true 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | FAILURE 69 | 2 70 | RED 71 | true 72 | 73 | -------------------------------------------------------------------------------- /jenkins-ci/config/job-analysis.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | false 6 | 7 | 8 | Static Code Analysis 9 | BUILD 10 | 11 | 12 | 13 | 2 14 | 15 | 16 | https://github.com/jbossdemocentral/continuous-delivery-demo-app.git 17 | 18 | 19 | 20 | 21 | */master 22 | 23 | 24 | false 25 | 26 | 27 | 28 | true 29 | false 30 | false 31 | false 32 | 33 | false 34 | 35 | org.jboss.examples 36 | ticket-monster 37 | 38 | package 39 | true 40 | false 41 | false 42 | false 43 | false 44 | false 45 | false 46 | false 47 | -1 48 | false 49 | false 50 | 51 | 52 | 53 | 54 | 55 | (Inherit From Job) 56 | 57 | 58 | 59 | 60 | 61 | 62 | false 63 | 64 | 65 | 66 | 67 | 68 | 69 | FAILURE 70 | 2 71 | RED 72 | true 73 | 74 | -------------------------------------------------------------------------------- /jenkins-ci/config/job-test-sys.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | false 6 | 7 | 8 | Run system tests 9 | SYS TEST 10 | 11 | 12 | 13 | 2 14 | 15 | 16 | https://github.com/jbossdemocentral/continuous-delivery-demo-app.git 17 | 18 | 19 | 20 | 21 | */master 22 | 23 | 24 | false 25 | 26 | 27 | 28 | true 29 | false 30 | false 31 | false 32 | 33 | false 34 | 35 | 36 | 37 | 38 | 39 | 40 | ARTIFACT_VERSION=${PIPELINE_VERSION} 41 | 42 | 43 | ticket-monster-deploy-preprod, 44 | SUCCESS 45 | false 46 | 47 | 48 | 49 | 50 | 51 | org.jboss.examples 52 | ticket-monster 53 | 54 | package test deploy 55 | true 56 | false 57 | false 58 | false 59 | false 60 | false 61 | false 62 | false 63 | -1 64 | false 65 | false 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | FAILURE 74 | 2 75 | RED 76 | true 77 | 78 | -------------------------------------------------------------------------------- /jenkins-ci/config/job-test-perf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | false 6 | 7 | 8 | Run performance tests 9 | PERF TEST 10 | 11 | 12 | 13 | 2 14 | 15 | 16 | https://github.com/jbossdemocentral/continuous-delivery-demo-app.git 17 | 18 | 19 | 20 | 21 | */master 22 | 23 | 24 | false 25 | 26 | 27 | 28 | true 29 | false 30 | false 31 | false 32 | 33 | false 34 | 35 | 36 | 37 | 38 | 39 | 40 | ARTIFACT_VERSION=${PIPELINE_VERSION} 41 | 42 | 43 | ticket-monster-deploy-preprod, 44 | SUCCESS 45 | false 46 | 47 | 48 | 49 | 50 | 51 | org.jboss.examples 52 | ticket-monster 53 | 54 | package test deploy 55 | true 56 | false 57 | false 58 | false 59 | false 60 | false 61 | false 62 | false 63 | -1 64 | false 65 | false 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | FAILURE 74 | 2 75 | RED 76 | true 77 | 78 | -------------------------------------------------------------------------------- /jenkins-ci/config/jenkins-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1.0 5 | 2 6 | NORMAL 7 | true 8 | 9 | 10 | false 11 | 12 | ${JENKINS_HOME}/workspace/${ITEM_FULLNAME} 13 | ${ITEM_ROOTDIR}/builds 14 | 15 | 16 | JDK 17 | /usr/lib/jvm/java-1.7.0 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 5 26 | 0 27 | 28 | 29 | 30 | All 31 | false 32 | false 33 | 34 | 35 | 36 | 37 | Delivery Pipeline 38 | false 39 | false 40 | 41 | 42 | 43 | Ticket Monster 44 | ticket-monster-build 45 | 46 | 47 | 3 48 | false 49 | 3 50 | none 51 | false 52 | 2 53 | false 54 | true 55 | 56 | 57 | 58 | 59 | Build Pipeline 60 | false 61 | false 62 | 63 | 64 | ticket-monster-build 65 | 66 | 3 67 | 68 | Lightbox 69 | 70 | false 71 | false 72 | false 73 | false 74 | false 75 | 3 76 | false 77 | 78 | 79 | All 80 | 0 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /jenkins-ci/Dockerfile: -------------------------------------------------------------------------------- 1 | ####################################################################### 2 | # # 3 | # Creates a Jenkins image with TicketMonster job configured # 4 | # # 5 | ####################################################################### 6 | 7 | FROM siamaksade/jenkins:1.587 8 | 9 | MAINTAINER Siamak Sadeghianfar 10 | 11 | # Copy SSH Key Pair 12 | ADD config/.ssh /var/lib/jenkins/.ssh 13 | RUN chown -R jenkins:jenkins /var/lib/jenkins/.ssh/ 14 | RUN chmod 755 /var/lib/jenkins/.ssh/ 15 | RUN chmod 600 /var/lib/jenkins/.ssh/id_rsa* 16 | 17 | # Install Plugins 18 | RUN wget -O /var/lib/jenkins/plugins/openshift-deployer.hpi http://updates.jenkins-ci.org/download/plugins/openshift-deployer/1.2.0/openshift-deployer.hpi 19 | RUN wget -O /var/lib/jenkins/plugins/build-pipeline-plugin.hpi http://updates.jenkins-ci.org/download/plugins/build-pipeline-plugin/1.4.3/build-pipeline-plugin.hpi 20 | RUN wget -O /var/lib/jenkins/plugins/jquery.hpi http://updates.jenkins-ci.org/download/plugins/jquery/1.7.2-1/jquery.hpi 21 | RUN wget -O /var/lib/jenkins/plugins/parameterized-trigger.hpi http://updates.jenkins-ci.org/download/plugins/parameterized-trigger/2.25/parameterized-trigger.hpi 22 | RUN wget -O /var/lib/jenkins/plugins/sonar.hpi http://updates.jenkins-ci.org/download/plugins/sonar/2.1/sonar.hpi 23 | RUN wget -O /var/lib/jenkins/plugins/javadoc.hpi http://updates.jenkins-ci.org/download/plugins/javadoc/1.2/javadoc.hpi 24 | RUN wget -O /var/lib/jenkins/plugins/delivery-pipeline-plugin.hpi https://updates.jenkins-ci.org/download/plugins/delivery-pipeline-plugin/0.8.6/delivery-pipeline-plugin.hpi 25 | RUN wget -O /var/lib/jenkins/plugins/token-macro.hpi https://updates.jenkins-ci.org/download/plugins/token-macro/1.9/token-macro.hpi 26 | RUN wget -O /var/lib/jenkins/plugins/jquery-ui.hpi https://updates.jenkins-ci.org/download/plugins/jquery-ui/1.0.2/jquery-ui.hpi 27 | 28 | # Jenkins Settings 29 | ADD config/jenkins-config.xml /var/lib/jenkins/config.xml 30 | 31 | # Maven Global Settings 32 | ADD config/maven-settings.xml /usr/share/apache-maven/conf/settings.xml 33 | 34 | # SonarQube Settings 35 | ADD config/sonar-settings.xml /var/lib/jenkins/hudson.plugins.sonar.SonarPublisher.xml 36 | 37 | # OpenShift Deployer Settings 38 | ADD config/openshift-settings.xml /var/lib/jenkins/org.jenkinsci.plugins.openshift.DeployApplication.xml 39 | 40 | # Build Jobs 41 | RUN mkdir -p /var/lib/jenkins/jobs/ticket-monster-{analysis,build,deploy-dev,func-test,release,test} 42 | 43 | ADD config/job-analysis.xml /var/lib/jenkins/jobs/ticket-monster-analysis/config.xml 44 | ADD config/job-build.xml /var/lib/jenkins/jobs/ticket-monster-build/config.xml 45 | ADD config/job-release.xml /var/lib/jenkins/jobs/ticket-monster-release/config.xml 46 | ADD config/job-deploy-dev.xml /var/lib/jenkins/jobs/ticket-monster-deploy-dev/config.xml 47 | ADD config/job-deploy-systest.xml /var/lib/jenkins/jobs/ticket-monster-deploy-systest/config.xml 48 | ADD config/job-deploy-perftest.xml /var/lib/jenkins/jobs/ticket-monster-deploy-perftest/config.xml 49 | ADD config/job-deploy-preprod.xml /var/lib/jenkins/jobs/ticket-monster-deploy-preprod/config.xml 50 | ADD config/job-test-func.xml /var/lib/jenkins/jobs/ticket-monster-test-func/config.xml 51 | ADD config/job-test-int.xml /var/lib/jenkins/jobs/ticket-monster-test-int/config.xml 52 | ADD config/job-test-sys.xml /var/lib/jenkins/jobs/ticket-monster-test-sys/config.xml 53 | ADD config/job-test-perf.xml /var/lib/jenkins/jobs/ticket-monster-test-perf/config.xml 54 | 55 | # Disable SNI Extension 56 | RUN sed -i "s/JENKINS_JAVA_OPTIONS/#JENKINS_JAVA_OPTIONS/g" /etc/sysconfig/jenkins 57 | RUN echo "JENKINS_JAVA_OPTIONS=\"-Djava.awt.headless=true -Djsse.enableSNIExtension=false\"" >> /etc/sysconfig/jenkins 58 | 59 | # Set Permissions 60 | RUN chown -R jenkins:jenkins /var/lib/jenkins -------------------------------------------------------------------------------- /jenkins-ci/config/job-release.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | false 6 | 7 | 8 | Release 9 | DEV 10 | 11 | 12 | 13 | 2 14 | 15 | 16 | https://github.com/jbossdemocentral/continuous-delivery-demo-app.git 17 | 18 | 19 | 20 | 21 | */master 22 | 23 | 24 | false 25 | 26 | 27 | 28 | 29 | master 30 | 31 | 32 | 33 | true 34 | false 35 | false 36 | true 37 | false 38 | 39 | org.jboss.examples 40 | ticket-monster 41 | 42 | release:prepare release:perform --batch-mode 43 | true 44 | false 45 | true 46 | false 47 | false 48 | false 49 | false 50 | false 51 | -1 52 | false 53 | false 54 | true 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | ${WORKSPACE}/buildparams.properties 65 | false 66 | false 67 | false 68 | 69 | 70 | ticket-monster-deploy-dev 71 | SUCCESS 72 | false 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | echo "ARTIFACT_VERSION=${POM_VERSION/-SNAPSHOT/}" > ${WORKSPACE}/buildparams.properties 82 | 83 | 84 | 85 | FAILURE 86 | 2 87 | RED 88 | true 89 | 90 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Continuous Delivery Demo on OpenShift 2 | ================= 3 | 4 | This demo sets up a complete Continuous Delivery environment running in Docker containers and uses OpenShift as the deployment environment. As the artifact moves forward in the delivery pipeline, new containers (gears) are created on OpenShift and the artifact gets deployed onto these containers which represent _Dev_, _System Test_, _Performance Test_ and _Pre-Production_ environments. 5 | 6 | ![](https://raw.githubusercontent.com/jbossdemocentral/continuous-delivery-demo/master/images/cd-openshift.png) 7 | 8 | This demo uses Fig as a simple orchestration tool to create the Docker containers required for this demo. Docker is used for simplicity in this demo and is not essential to the delivery pipeline. 9 | 10 | Infrastructure 11 | ====== 12 | This demo uses the following components to create the delivery pipeline. Jenkins, Nexus and Sonar run in their own Docker containers while GitHub is used as an external Git-based source repository. 13 | 14 | **Jenkins** 15 | Description: continuous delivery orchestration engine 16 | Address: http://DOCKER_HOST:8080/jenkins 17 | 18 | **Sonatype Nexus** 19 | Description: artifact repository for archiving release binaries 20 | Address: http://DOCKER_HOST:8081/nexus 21 | 22 | **SonarQube** 23 | Description: static code analysis engine extracting various quality metrics from the code 24 | Address: http://DOCKER_HOST:9000 25 | 26 | **Git** 27 | Description: source repository hosting the ticket-monster Java application 28 | Address: [https://github.com/jbossdemocentral/continuous-delivery-demo-app.git](https://github.com/jbossdemocentral/continuous-delivery-demo-app.git) 29 | 30 | Note: if running _boot2docker_ on Mac OSX, _DOCKER_HOST_ is the ip of boot2docker virtual machine. 31 | 32 | Delivery Pipeline 33 | ================= 34 | The delivery pipeline in this demo is divided into five phases each containing a number of activities (jobs) that need to succeed in order to promote the artefact to the next phase. Each change in the application is a potential production release according to Continuous Delivery principles and can go in production if it successfully passes through all the phases in the pipeline. 35 | 36 | 1. Build: compilation and unit test, integration tests and static code analysis 37 | 2. Dev: release to Nexus, create release tag in Git, deploy to DEV server (on OpenShift) and running functional tests 38 | 3. System Test: deploy to System Test server (on OpenShift) and running system tests 39 | 4. Perf Test: deploy to Performance Test server (on OpenShift) and running performance tests 40 | 5. Pre Production (Stage): deploy to Pre-Production server (on OpenShift) 41 | 42 | ![Delivery Pipeline](https://raw.githubusercontent.com/jbossdemocentral/continuous-delivery-demo/master/images/delivery-pipeline.png) 43 | 44 | Instructions 45 | ============ 46 | 47 | 1. Install [Docker Compose](https://docs.docker.com/compose/install/) 48 | 2. Clone Continuous Delivery demo git repo 49 | 50 | ``` 51 | git clone https://github.com/jbossdemocentral/continuous-delivery-demo.git 52 | cd continuous-delivery-demo 53 | ``` 54 | 55 | 3. Start the containers 56 | ``` 57 | docker-compose up -d 58 | ``` 59 | This step will download the required Docker images from Docker registery and start Jenkins, Nexus and Sonar containers. Depending on your internet connection, it might take some minutes. 60 | 4. Browse to http://DOCKER_HOST:8080/jenkins and go to _Manage Jenkins > Configure System_. Scroll down to _OpenShift_ section and enter your OpenShift configs. If using OpenShift Online, enter your username and password in the respective textboxes. If using OpenShift Enterprise, also enter the address to your broker. Click on "Check Login" to validate your username and password. If successfull, click on "Upload SSH Public Key" to upload the Jenkins SSH keys to OpenShift. 61 | 62 | ![Jenkins Config](https://raw.githubusercontent.com/jbossdemocentral/continuous-delivery-demo/master/images/jenkins-config.png) 63 | 64 | 5. Go to jobs list and start the _ticket-monster-build_ job. 65 | 6. Go to the _Delivery Pipeline_ tab to see how the build progresses in the delivery pipeline. 66 | 67 | ## Recognitions 68 | Special thanks to my collegue Siamak Sadeghianfar, who wrote the OpenShift Jenkins plugin and who implemented most of this demo. 69 | 70 | 71 | --------------------------------------------------------------------------------