diff --git a/.github/workflows/build-publish-jenkins-image.yaml b/.github/workflows/build-publish-jenkins-image.yaml index 85460ea..c143bbf 100644 --- a/.github/workflows/build-publish-jenkins-image.yaml +++ b/.github/workflows/build-publish-jenkins-image.yaml @@ -78,7 +78,7 @@ jobs: - name: Write to workflow job summary run: | SUMMARY=$'# Building jenkins-core-image\n' - SUMMARY=$'[jenkins-core-image available here](https://hub.docker.com/r/dockerofkrishnadhas/jenkins-core-image)' - SUMMARY+=$'**Job Start πŸ“…Time:** ${{ env.JOB_START_TIME }}\n' - SUMMARY+=$'**Job EndπŸ“… Time:** ${{ env.JOB_END_TIME }}\n' + SUMMARY=$'[jenkins-core-image available here](https://hub.docker.com/r/dockerofkrishnadhas/jenkins-core-image)\n' + SUMMARY+=$'**Job Start πŸ“… Time:** ${{ env.JOB_START_TIME }}\n' + SUMMARY+=$'**Job End πŸ“… Time:** ${{ env.JOB_END_TIME }}\n' echo "$SUMMARY" >> $GITHUB_STEP_SUMMARY \ No newline at end of file diff --git a/README.md b/README.md index 7ecba96..4859d9f 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,11 @@ Create jenkins docker images and build them periodicaly and scan using trivy * 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. +* 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. + * 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 -* 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. +* 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. * **To use JCasC, you need to install the Configuration as Code plugin.** [configuration-as-code](https://plugins.jenkins.io/configuration-as-code/) @@ -50,7 +52,7 @@ Eg: docker build --build-arg JENKINS_USER=user --build-arg JENKINS_PASS=passwor Details can be found here - [github-app-auth](https://docs.cloudbees.com/docs/cloudbees-ci/latest/cloud-admin-guide/github-app-auth) * Post generating the Private key of GitHub app, this needs to be converted into a specific format - Use the command [here](https://docs.cloudbees.com/docs/cloudbees-ci/latest/cloud-admin-guide/github-app-auth#_converting_the_private_key_for_jenkins) + 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` ``` openssl pkcs8 -topk8 -inform PEM -outform PEM -in -out -nocrypt @@ -58,4 +60,6 @@ Eg: docker build --build-arg JENKINS_USER=user --build-arg JENKINS_PASS=passwor * --> Replace with your pem file path of app private key. * --> The converted output which you need to update to jenkins. -I am passing the `GITHUB_APP_KEY` & `GITHUB_APP_ID` at build time from github secrets and storing it as env variables in image. \ No newline at end of file +I am passing the `GITHUB_APP_KEY` & `GITHUB_APP_ID` at build time from github secrets and storing it as env variables in image. + +# Image πŸ‘‰ [jenkins-core-image available here](https://hub.docker.com/r/dockerofkrishnadhas/jenkins-core-image) \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index 9938704..a5f140e 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -12,8 +12,8 @@ services: environment: - JENKINS_ADMIN - JENKINS_ADMIN_PASSWORD - - GITHUB_APP_KEY=${{ secrets.GH_APP_KEY }} - - GITHUB_APP_ID=${{ secrets.GH_APP_ID }} + - GITHUB_APP_KEY + - GITHUB_APP_ID # - JAVA_OPTS="-Djenkins.install.runSetupWizard=false" this is already passed as an env variable in build time and will be present volumes: - jenkins-data:/var/jenkins_home @@ -23,4 +23,5 @@ volumes: jenkins-data: driver: local networks: - jenkins: \ No newline at end of file + jenkins: +# Using this by providing all necessary variables, we can build and deploy jenkins straight away. \ No newline at end of file