Skip to content

Commit c659e2e

Browse files
jenkins-core-image ready DEVOPS-253
1 parent cbb6755 commit c659e2e

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

.github/workflows/build-publish-jenkins-image.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
- name: Write to workflow job summary
7979
run: |
8080
SUMMARY=$'# Building jenkins-core-image\n'
81-
SUMMARY=$'[jenkins-core-image available here](https://hub.docker.com/r/dockerofkrishnadhas/jenkins-core-image)'
82-
SUMMARY+=$'**Job Start 📅Time:** ${{ env.JOB_START_TIME }}\n'
83-
SUMMARY+=$'**Job End📅 Time:** ${{ env.JOB_END_TIME }}\n'
81+
SUMMARY=$'[jenkins-core-image available here](https://hub.docker.com/r/dockerofkrishnadhas/jenkins-core-image)\n'
82+
SUMMARY+=$'**Job Start 📅 Time:** ${{ env.JOB_START_TIME }}\n'
83+
SUMMARY+=$'**Job End 📅 Time:** ${{ env.JOB_END_TIME }}\n'
8484
echo "$SUMMARY" >> $GITHUB_STEP_SUMMARY

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ Create jenkins docker images and build them periodicaly and scan using trivy
99

1010
* user.groovy --> This creates a user with name as of `JENKINS_USER` and with password `JENKINS_PASS` who will be the default user and security will be enabled using `Jenkins OWN Databse` by default.
1111

12+
* number_of_executors.groovy --> this script is used to increase the `numOfExecutors` in Jenkins from 2 to `x` where `x` is the value of numberOfExecutors provided in the script.
13+
1214
* get_latest_version_create_tag.sh --> gets the tag to create on github and set it as a github env variable and push tag to github
1315

14-
* config-as-code.yaml --> This uses Configuration as Code plugin from Jenkins to set up some default settings like setting up a GitHub App as a credential, default executors count etc.
16+
* config-as-code.yaml --> This uses Configuration as Code plugin from Jenkins to set up some default settings like setting up a GitHub App as a credential.
1517

1618
* **To use JCasC, you need to install the Configuration as Code plugin.** [configuration-as-code](https://plugins.jenkins.io/configuration-as-code/)
1719

@@ -50,12 +52,14 @@ Eg: docker build --build-arg JENKINS_USER=user --build-arg JENKINS_PASS=passwor
5052
Details can be found here - [github-app-auth](https://docs.cloudbees.com/docs/cloudbees-ci/latest/cloud-admin-guide/github-app-auth)
5153

5254
* Post generating the Private key of GitHub app, this needs to be converted into a specific format
53-
Use the command [here](https://docs.cloudbees.com/docs/cloudbees-ci/latest/cloud-admin-guide/github-app-auth#_converting_the_private_key_for_jenkins)
55+
Use the command [here](https://docs.cloudbees.com/docs/cloudbees-ci/latest/cloud-admin-guide/github-app-auth#_converting_the_private_key_for_jenkins) , This will be the value we will be passing as `GITHUB_APP_KEY`
5456

5557
```
5658
openssl pkcs8 -topk8 -inform PEM -outform PEM -in <key-in-your-downloads-folder.pem> -out <converted-github-app.pem> -nocrypt
5759
```
5860
* <key-in-your-downloads-folder.pem> --> Replace with your pem file path of app private key.
5961
* <converted-github-app.pem> --> The converted output which you need to update to jenkins.
6062

61-
I am passing the `GITHUB_APP_KEY` & `GITHUB_APP_ID` at build time from github secrets and storing it as env variables in image.
63+
I am passing the `GITHUB_APP_KEY` & `GITHUB_APP_ID` at build time from github secrets and storing it as env variables in image.
64+
65+
# Image 👉 [jenkins-core-image available here](https://hub.docker.com/r/dockerofkrishnadhas/jenkins-core-image)

docker-compose.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ services:
1212
environment:
1313
- JENKINS_ADMIN
1414
- JENKINS_ADMIN_PASSWORD
15-
- GITHUB_APP_KEY=${{ secrets.GH_APP_KEY }}
16-
- GITHUB_APP_ID=${{ secrets.GH_APP_ID }}
15+
- GITHUB_APP_KEY
16+
- GITHUB_APP_ID
1717
# - JAVA_OPTS="-Djenkins.install.runSetupWizard=false" this is already passed as an env variable in build time and will be present
1818
volumes:
1919
- jenkins-data:/var/jenkins_home
@@ -23,4 +23,5 @@ volumes:
2323
jenkins-data:
2424
driver: local
2525
networks:
26-
jenkins:
26+
jenkins:
27+
# Using this by providing all necessary variables, we can build and deploy jenkins straight away.

0 commit comments

Comments
 (0)