├── .gitignore
├── ccjpe
├── cm
│ ├── ref
│ │ └── init.groovy.d
│ │ │ └── 10_no_executor.groovy
│ ├── Dockerfile
│ └── plugins.txt
├── cjoc
│ ├── ref
│ │ ├── jenkins.model.JenkinsLocationConfiguration.xml
│ │ ├── operations-center-analytics-config.xml
│ │ └── init.groovy.d
│ │ │ └── 90_slave_credentials.groovy
│ ├── Dockerfile
│ └── plugins.txt
└── docker-compose.yml
├── cje
├── docker-compose.yml
├── Dockerfile
├── ref
│ └── init.groovy.d
│ │ └── 90_slave_credentials.groovy
└── plugins.txt
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | *~
2 | .*
3 | *.iml
4 | .idea
5 | /data
6 |
--------------------------------------------------------------------------------
/ccjpe/cm/ref/init.groovy.d/10_no_executor.groovy:
--------------------------------------------------------------------------------
1 | import jenkins.model.Jenkins
2 |
3 | Jenkins.instance.setNumExecutors(0)
4 |
--------------------------------------------------------------------------------
/cje/docker-compose.yml:
--------------------------------------------------------------------------------
1 | jenkins:
2 | build: .
3 | volumes:
4 | - cje_jenkins_home:/var/jenkins_home
5 | ports:
6 | - "8080:8080"
7 |
--------------------------------------------------------------------------------
/ccjpe/cm/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM cloudbees/jenkins-enterprise:1.625.3.2
2 | ENV JENKINS_UC http://jenkins-updates.cloudbees.com
3 | COPY plugins.txt /plugins.txt
4 | RUN /usr/local/bin/plugins.sh /plugins.txt
5 |
6 | COPY ref /usr/share/jenkins/ref
7 |
--------------------------------------------------------------------------------
/cje/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM jenkins:1.625.3
2 | COPY plugins.txt /plugins.txt
3 | RUN /usr/local/bin/plugins.sh /plugins.txt
4 |
5 | COPY ref /usr/share/jenkins/ref
6 |
7 | # create a private SSH key to attach slaves
8 | RUN mkdir "/usr/share/jenkins/ref/slaves" && ssh-keygen -N '' -t rsa -f "/usr/share/jenkins/ref/slaves/id_rsa"
9 |
--------------------------------------------------------------------------------
/ccjpe/cjoc/ref/jenkins.model.JenkinsLocationConfiguration.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | address not configured yet <nobody@nowhere>
4 | http://127.0.0.1:8080/
5 |
6 |
--------------------------------------------------------------------------------
/ccjpe/cjoc/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM cloudbees/jenkins-operations-center:1.625.3.2
2 | ENV JENKINS_UC http://jenkins-updates.cloudbees.com
3 | COPY plugins.txt /plugins.txt
4 | RUN /usr/local/bin/plugins.sh /plugins.txt
5 |
6 | COPY ref /usr/share/jenkins/ref
7 |
8 | # create a private SSH key to attach slaves
9 | RUN mkdir "/usr/share/jenkins/ref/slaves" && ssh-keygen -N '' -t rsa -f "/usr/share/jenkins/ref/slaves/id_rsa"
10 |
--------------------------------------------------------------------------------
/ccjpe/docker-compose.yml:
--------------------------------------------------------------------------------
1 | cjoc:
2 | build: ./cjoc
3 | volumes:
4 | - ccjpe_cjoc_home:/var/jenkins_home
5 | environment:
6 | - JENKINS_SLAVE_AGENT_PORT=4000
7 | ports:
8 | - "8080:8080"
9 | - "8081:8081"
10 |
11 | cm1:
12 | build: ./cm
13 | volumes:
14 | - ccjpe_cm_home:/var/jenkins_home
15 | environment:
16 | - JENKINS_SLAVE_AGENT_PORT=4001
17 | - JENKINS_OPTS=--httpPort=8081
18 | net: "container:cjoc"
19 |
--------------------------------------------------------------------------------
/ccjpe/cjoc/ref/operations-center-analytics-config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 127.0.0.1
6 | 127.0.0.1
7 | 9200
8 | 9300
9 | 2000
10 | false
11 | elasticsearch/data
12 | elasticsearch/logs
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/cje/ref/init.groovy.d/90_slave_credentials.groovy:
--------------------------------------------------------------------------------
1 | import com.cloudbees.plugins.credentials.*
2 | import com.cloudbees.plugins.credentials.domains.Domain
3 | import com.cloudbees.jenkins.plugins.sshcredentials.*
4 | import com.cloudbees.jenkins.plugins.sshcredentials.impl.*
5 | import jenkins.model.Jenkins
6 |
7 | def key = new BasicSSHUserPrivateKey.FileOnMasterPrivateKeySource("${Jenkins.instance.rootDir}/slaves/id_rsa")
8 | def cred = new BasicSSHUserPrivateKey(CredentialsScope.GLOBAL, "ssh-slaves", "jenkins", key, "", "")
9 | SystemCredentialsProvider.getInstance().addCredentials(Domain.global(), cred)
10 |
11 | def pubkey = new File("${Jenkins.instance.rootDir}/slaves/id_rsa.pub").text.trim()
12 | Jenkins.instance.setSystemMessage("""
13 | To create a new docker container hosting a SSH slave and get the IP address, run:
14 |
15 | CID=\$(docker run -d jenkinsci/ssh-slave "${pubkey}")
16 | docker inspect --format '{{ .NetworkSettings.IPAddress }}' "\$CID"
17 |
18 | Then use /home/jenkins as "Remote FS root" in the slave configuration
19 | """)
20 |
--------------------------------------------------------------------------------
/ccjpe/cjoc/ref/init.groovy.d/90_slave_credentials.groovy:
--------------------------------------------------------------------------------
1 | import com.cloudbees.plugins.credentials.*
2 | import com.cloudbees.plugins.credentials.domains.Domain
3 | import com.cloudbees.jenkins.plugins.sshcredentials.*
4 | import com.cloudbees.jenkins.plugins.sshcredentials.impl.*
5 | import jenkins.model.Jenkins
6 |
7 | def key = new BasicSSHUserPrivateKey.FileOnMasterPrivateKeySource("${Jenkins.instance.rootDir}/slaves/id_rsa")
8 | def cred = new BasicSSHUserPrivateKey(CredentialsScope.GLOBAL, "ssh-slaves", "jenkins", key, "", "")
9 | SystemCredentialsProvider.getInstance().addCredentials(Domain.global(), cred)
10 |
11 | def pubkey = new File("${Jenkins.instance.rootDir}/slaves/id_rsa.pub").text.trim()
12 | Jenkins.instance.setSystemMessage("""
13 | To create a new docker container hosting a SSH slave and get the IP address, run:
14 |
15 | CID=\$(docker run -d jenkinsci/ssh-slave "${pubkey}")
16 | docker inspect --format '{{ .NetworkSettings.IPAddress }}' "\$CID"
17 |
18 | Then use /home/jenkins as "Remote FS root" in the slave configuration
19 | """)
20 |
--------------------------------------------------------------------------------
/cje/plugins.txt:
--------------------------------------------------------------------------------
1 | ace-editor:1.1:pinned
2 | ant:1.2:pinned
3 | antisamy-markup-formatter:1.3:pinned
4 | authentication-tokens:1.2:pinned
5 | aws-java-sdk:1.10.45:pinned
6 | build-pipeline-plugin:1.5.2:pinned
7 | cloudbees-credentials:3.3:pinned
8 | cloudbees-folder:5.5:pinned
9 | copyartifact:1.37:pinned
10 | create-fingerprint:1.2:pinned
11 | credentials:1.26:pinned
12 | cvs:2.12:pinned
13 | docker-build-publish:1.2.1:pinned
14 | docker-commons:1.3.1:pinned
15 | docker-plugin:0.16.0:pinned
16 | durable-task:1.9:pinned
17 | ec2:1.31:pinned
18 | email-ext:2.41.3:pinned
19 | external-monitor-job:1.4:pinned
20 | git:2.4.4:pinned
21 | git-client:1.19.6:pinned
22 | git-server:1.6:pinned
23 | icon-shim:2.0.3:pinned
24 | instant-messaging:1.35:pinned
25 | ircbot:2.27:pinned
26 | jabber:1.35:pinned
27 | jackson2-api:2.7.3:pinned
28 | javadoc:1.3:pinned
29 | jquery:1.11.2-0:pinned
30 | jquery-detached:1.2.1:pinned
31 | junit:1.11:pinned
32 | ldap:1.11:pinned
33 | mailer:1.16:pinned
34 | mapdb-api:1.0.6.0:pinned
35 | matrix-auth:1.3.2:pinned
36 | matrix-project:1.6:pinned
37 | maven-plugin:2.12.1:pinned
38 | metrics:3.1.2.7:not-pinned
39 | mock-security-realm:1.3:pinned
40 | node-iterator-api:1.5:pinned
41 | nodelabelparameter:1.7.1:pinned
42 | pam-auth:1.2:pinned
43 | parameterized-trigger:2.30:pinned
44 | promoted-builds:2.25:pinned
45 | radiatorviewplugin:1.26:pinned
46 | scm-api:1.1:pinned
47 | script-security:1.17:pinned
48 | skype-notifier:1.1.0:pinned
49 | sms:1.2:pinned
50 | ssh-credentials:1.11:pinned
51 | ssh-slaves:1.10:pinned
52 | subversion:2.5.7:pinned
53 | token-macro:1.12.1:pinned
54 | translation:1.12:pinned
55 | windows-slaves:1.1:pinned
56 | workflow-aggregator:1.14:pinned
57 | workflow-api:1.14:pinned
58 | workflow-basic-steps:1.14:pinned
59 | workflow-cps:1.14:pinned
60 | workflow-cps-global-lib:1.14:pinned
61 | workflow-durable-task-step:1.14:pinned
62 | workflow-job:1.14:pinned
63 | workflow-scm-step:1.14:pinned
64 | workflow-step-api:1.14:pinned
65 | workflow-support:1.14:pinned
66 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Jenkins Certification
2 |
3 | To help you prepare the [Jenkins Certification exam](https://www.cloudbees.com/jenkins-certification), this repository contains Docker compose configuration to quickly spin up Jenkins instances with all plugins listed in study guides provided here:
4 |
5 | * [Certified Jenkins Engineer Study Guide](https://www.cloudbees.com/sites/default/files/cje_study_guide_final.pdf)
6 | * [Certified CloudBees Jenkins Platform Engineer Study Guide](https://www.cloudbees.com/sites/default/files/ccjpe_study_guide_final.pdf)
7 |
8 | **DISCLAIMER**: This is not an **official** repository containing certification material. It's just there to help you train for the certification. Things can be outdated and not aligned with the certification exam.
9 |
10 | ## Pre-requisite
11 |
12 | Docker and Docker compose must be available on your machine.
13 |
14 | ## Launch Jenkins
15 |
16 | For _Certified Jenkins Engineer_ exam:
17 |
18 | cd cje
19 | docker-compose up
20 |
21 | For _Certified CloudBees Jenkins Platform Engineer_ exam:
22 |
23 | cd ccjpe
24 | docker-compose up
25 |
26 | When the container hosting Jenkins is ready, browse http://localhost:8080
27 |
28 | ## Cheat sheet
29 |
30 | To remove docker containers, launch
31 |
32 | docker-compose rm -f
33 |
34 | To clean up volumes, launch
35 |
36 | docker volume rm ccjpe_cjoc_home ccjpe_cm_home cje_jenkins_home
37 |
38 | To rebuild docker images
39 |
40 | docker-compose build
41 | docker-compose up --force-recreate
42 |
43 | ### For mac user
44 |
45 | As we are using `docker-machine` to have our `$DOCKER_HOST`, we cannot access containers through `127.0.0.1`. However, the communication between CJOC and CJE is done inside a private network (see `docker-compose.yml` file). So, in the CJOC global configuration, you **must** keep the `127.0.0.1` even if you access the UI through `docker-machine ip` value. You will have the *reverse proxy warning message* on the manage page, but don't worry about it.
46 |
--------------------------------------------------------------------------------
/ccjpe/cjoc/plugins.txt:
--------------------------------------------------------------------------------
1 | active-directory:1.41:not-pinned
2 | antisamy-markup-formatter:1.3:not-pinned
3 | async-http-client:1.7.24:not-pinned
4 | authentication-tokens:1.2:not-pinned
5 | aws-credentials:1.11:not-pinned
6 | aws-java-sdk:1.10.45:pinned
7 | cloudbees-aws-credentials:1.8.2:not-pinned
8 | cloudbees-folder:5.2.1:pinned
9 | cloudbees-folders-plus:3.0:not-pinned
10 | cloudbees-ha:4.7:not-pinned
11 | cloudbees-license:7.12.1:not-pinned
12 | cloudbees-monitoring:2.4:pinned
13 | cloudbees-plugin-usage:1.6:not-pinned
14 | cloudbees-ssh-slaves:1.3:not-pinned
15 | cloudbees-support:3.6:not-pinned
16 | cloudbees-update-center-plugin:4.18:not-pinned
17 | credentials:1.25:pinned
18 | durable-task:1.7:not-pinned
19 | ec2:1.31:not-pinned
20 | icon-shim:2.0.2:not-pinned
21 | infradna-backup:3.22:not-pinned
22 | jackson2-api:2.5.4:not-pinned
23 | javadoc:1.3:not-pinned
24 | junit:1.10:pinned
25 | ldap:1.11:not-pinned
26 | mailer:1.16:not-pinned
27 | mapdb-api:1.0.6.0:not-pinned
28 | matrix-auth:1.2:not-pinned
29 | matrix-project:1.6:not-pinned
30 | maven-plugin:2.12.1:not-pinned
31 | metrics:3.1.2.7:pinned
32 | mock-security-realm:1.3:pinned
33 | monitoring:1.58.0:pinned
34 | nectar-license:7.3:not-pinned
35 | nectar-rbac:5.5:not-pinned
36 | nectar-vmware:4.3.5:not-pinned
37 | node-iterator-api:1.5:not-pinned
38 | openid:2.1.1:not-pinned
39 | openid-server:2.0:not-pinned
40 | openid4java:0.9.8.0:not-pinned
41 | operations-center-agent:1.8.2:pinned
42 | operations-center-analytics:1.8.7:pinned
43 | operations-center-analytics-config:1.8.7:pinned
44 | operations-center-analytics-dashboards:1.8.7:pinned
45 | operations-center-analytics-feeder:1.8.7:pinned
46 | operations-center-analytics-reporter:1.8.7:pinned
47 | operations-center-analytics-viewer:1.8.7:pinned
48 | operations-center-clusterops:1.8.1:not-pinned
49 | operations-center-context:1.8.7:pinned
50 | operations-center-ec2-cloud:1.8.1:not-pinned
51 | operations-center-elasticsearch-provider:1.8.0:not-pinned
52 | operations-center-embedded-elasticsearch:1.8.0-1.7.1.2:pinned
53 | operations-center-jnlp-controller:1.8.1:pinned
54 | operations-center-license:1.8.1:not-pinned
55 | operations-center-monitoring:1.8.3:pinned
56 | operations-center-openid-cse:1.8.0:not-pinned
57 | operations-center-rbac:1.8.1:not-pinned
58 | operations-center-server:1.8.6:pinned
59 | operations-center-sso:1.8.0:not-pinned
60 | operations-center-updatecenter:1.8.0:not-pinned
61 | pam-auth:1.2:not-pinned
62 | script-security:1.17:pinned
63 | ssh-agent:1.9:not-pinned
64 | ssh-credentials:1.11:not-pinned
65 | ssh-slaves:1.10:not-pinned
66 | support-core:2.31:pinned
67 | suppress-stack-trace:1.4:not-pinned
68 | token-macro:1.12.1:not-pinned
69 | translation:1.12:not-pinned
70 | unique-id:2.1.1:not-pinned
71 | wikitext:3.7:not-pinned
72 | windows-slaves:1.0:not-pinned
73 | workflow-step-api:1.13:not-pinned
74 |
--------------------------------------------------------------------------------
/ccjpe/cm/plugins.txt:
--------------------------------------------------------------------------------
1 | ace-editor:1.0.1:pinned
2 | active-directory:1.41:pinned
3 | ant:1.2:pinned
4 | antisamy-markup-formatter:1.3:pinned
5 | async-http-client:1.7.24:pinned
6 | authentication-tokens:1.2:pinned
7 | aws-credentials:1.11:pinned
8 | aws-java-sdk:1.10.45:pinned
9 | branch-api:1.3:pinned
10 | build-pipeline-plugin:1.4.9:pinned
11 | build-timeout:1.16:pinned
12 | build-view-column:0.2:pinned
13 | cloudbees-aborted-builds:1.7:not-pinned
14 | cloudbees-aws-cli:1.5.5:not-pinned
15 | cloudbees-aws-credentials:1.8.2:pinned
16 | cloudbees-aws-deployer:1.15:not-pinned
17 | cloudbees-bitbucket-branch-source:1.1:pinned
18 | cloudbees-consolidated-build-view:1.5:not-pinned
19 | cloudbees-credentials:3.3:pinned
20 | cloudbees-even-scheduler:3.6:not-pinned
21 | cloudbees-folder:5.1:pinned
22 | cloudbees-folders-plus:3.0:pinned
23 | cloudbees-github-pull-requests:1.1:pinned
24 | cloudbees-groovy-view:1.5:not-pinned
25 | cloudbees-ha:4.7:not-pinned
26 | cloudbees-jsync-archiver:5.5:not-pinned
27 | cloudbees-label-throttling-plugin:3.4:not-pinned
28 | cloudbees-license:7.12.1:pinned
29 | cloudbees-long-running-build:1.6:not-pinned
30 | cloudbees-monitoring:2.4:pinned
31 | cloudbees-nodes-plus:1.14:not-pinned
32 | cloudbees-plugin-usage:1.6:not-pinned
33 | cloudbees-quiet-start:1.2:not-pinned
34 | cloudbees-secure-copy:3.8:not-pinned
35 | cloudbees-ssh-slaves:1.3:not-pinned
36 | cloudbees-support:3.6:pinned
37 | cloudbees-template:4.21
38 | cloudbees-view-creation-filter:1.3:not-pinned
39 | cloudbees-wasted-minutes-tracker:3.8:pinned
40 | cloudbees-workflow-aggregator:1.8:not-pinned
41 | cloudbees-workflow-rest-api:1.8:not-pinned
42 | cloudbees-workflow-template:1.8:not-pinned
43 | cloudbees-workflow-ui:1.8:not-pinned
44 | copyartifact:1.37:pinned
45 | create-fingerprint:1.2:pinned
46 | credentials:1.25:pinned
47 | cvs:2.12:pinned
48 | dashboard-view:2.9.7:pinned
49 | deployed-on-column:1.7:not-pinned
50 | deployer-framework:1.1:not-pinned
51 | docker-build-publish:1.1:pinned
52 | docker-commons:1.3.1:pinned
53 | docker-plugin:0.16.0:pinned
54 | docker-traceability:1.1:pinned
55 | docker-workflow:1.3:pinned
56 | dockerhub-notification:1.0.2:pinned
57 | durable-task:1.7:pinned
58 | ec2:1.31:pinned
59 | email-ext:2.41.2:pinned
60 | external-monitor-job:1.4:pinned
61 | git:2.4.2:pinned
62 | git-client:1.19.5:pinned
63 | git-server:1.6:pinned
64 | git-validated-merge:3.20:pinned
65 | github:1.17.1:pinned
66 | github-api:1.72:pinned
67 | github-branch-source:1.2:pinned
68 | github-pull-request-build:1.7:pinned
69 | icon-shim:2.0.2:pinned
70 | infradna-backup:3.22:pinned
71 | instant-messaging:1.35:pinned
72 | ircbot:2.26:pinned
73 | jabber:1.35:pinned
74 | jackson2-api:2.5.4:pinned
75 | javadoc:1.3:pinned
76 | jquery:1.11.2-0:pinned
77 | jquery-detached:1.2:pinned
78 | junit:1.10:pinned
79 | ldap:1.11:pinned
80 | mailer:1.16:pinned
81 | mapdb-api:1.0.6.0:pinned
82 | matrix-auth:1.2:pinned
83 | matrix-project:1.6:pinned
84 | maven-plugin:2.12.1:pinned
85 | mercurial:1.54:pinned
86 | metrics:3.1.2.7:pinned
87 | mock-security-realm:1.3:pinned
88 | monitoring:1.58.0:pinned
89 | nectar-license:7.3:pinned
90 | nectar-rbac:5.5:pinned
91 | nectar-vmware:4.3.5:not-pinned
92 | node-iterator-api:1.5:pinned
93 | nodelabelparameter:1.7.1:pinned
94 | openid:2.1.1:pinned
95 | openid4java:0.9.8.0:pinned
96 | operations-center-agent:1.8.2:pinned
97 | operations-center-analytics-config:1.8.7:pinned
98 | operations-center-analytics-reporter:1.8.7:pinned
99 | operations-center-client:1.8.5:pinned
100 | operations-center-cloud:1.8.4:pinned
101 | operations-center-context:1.8.7:pinned
102 | operations-center-openid-cse:1.8.0:pinned
103 | pam-auth:1.2:pinned
104 | parameterized-trigger:2.30:pinned
105 | plain-credentials:1.1:pinned
106 | promoted-builds:2.25:pinned
107 | radiatorviewplugin:1.26:pinned
108 | scm-api:1.0:pinned
109 | script-security:1.17:pinned
110 | skip-plugin:3.7:pinned
111 | skype-notifier:1.1.0:pinned
112 | sms:1.2:pinned
113 | ssh-agent:1.9:pinned
114 | ssh-credentials:1.11:pinned
115 | ssh-slaves:1.10:pinned
116 | subversion:2.5.7:pinned
117 | support-core:2.31:pinned
118 | suppress-stack-trace:1.4:pinned
119 | token-macro:1.12.1:pinned
120 | translation:1.12:pinned
121 | unique-id:2.1.1:pinned
122 | wikitext:3.7:pinned
123 | windows-slaves:1.1:pinned
124 | workflow-aggregator:1.13:pinned
125 | workflow-api:1.13:pinned
126 | workflow-basic-steps:1.13:pinned
127 | workflow-cps:1.13:pinned
128 | workflow-cps-checkpoint:1.8:not-pinned
129 | workflow-cps-global-lib:1.13:pinned
130 | workflow-durable-task-step:1.13:pinned
131 | workflow-job:1.13:pinned
132 | workflow-multibranch:1.13:pinned
133 | workflow-scm-step:1.13:pinned
134 | workflow-step-api:1.13:pinned
135 | workflow-support:1.13:pinned
136 |
--------------------------------------------------------------------------------