Managing Pipeline Template Catalogs across a large number of managed controllers using the graphical user interface (GUI) is time consuming and prone to human error due to the repetitive nature of the task.
Configuration as Code (CasC) for CloudBees CI allows for managing Pipeline Template Catalogs as code across multiple managed controllers, which reduces efforts and ensures consistency across all of your teams, while increasing the security and traceability of changes by managing the configuration as code.
This lab will explore how to manage CloudBees CI Pipeline Template Catalogs with the CloudBees CI Configuration as Code. This will be a brief introduction to CloudBees CI Configuration as Code which we will explore more in the next section.
cloudbees-ci-config-bundle
repository in your workshop GitHub Organization, open the jenkins.yaml
file in the bundle
folder and scroll down to the globalCloudBeesPipelineTemplateCatalog
CasC entry:globalCloudBeesPipelineTemplateCatalog:
catalogs:
- branchOrTag: "main"
scm:
github:
configuredByUrl: true
credentialsId: "cloudbees-ci-workshop-github-app"
repoOwner: "${GITHUB_ORGANIZATION}"
repository: "pipeline-template-catalog"
repositoryUrl: "https://github.com/${GITHUB_ORGANIZATION}/pipeline-template-catalog.git"
traits:
- gitHubBranchDiscovery:
strategyId: 1
- gitHubPullRequestDiscovery:
strategyId: 1
- gitHubForkDiscovery:
strategyId: 1
trust: "gitHubTrustPermissions"
updateInterval: "1d"
Notice the ${GITHUB_ORGANIZATION}
variable placeholders. These will be replaced by environmental variables applied to your controller when it was provisioned and is similar to how secrets can be injected into a Jenkins Configuration as Code file, as we will see in the next section on CloudBees CI Configuration as Code.
The CloudBees CI Folders Plus plugin includes the ability to restrict the type of items/jobs allowed to be created in a folder. When this capability is used with CloudBees CI RBAC you can easily enforce the use of approved (and tested) Pipeline templates across all your CloudBees CI users.
In this lab you will create a Multibranch Pipeline job from a Pipeline template on your CloudBees CI managed controller to automatically update the CloudBees CI configuration bundle for your CloudBees CI managed controller.
For instructor led workshops please return to the workshop slides