CloudBees CasC Server Plugin 2.0

3 minute read

RELEASED: Public: April 5, 2023

CloudBees CasC Server plugin 2.0 introduces bundle branch and tag support. The plugin update changes the folder structure within JENKINS_HOME which stores CasC bundles. In older versions of the CloudBees CasC Server plugin, the folder structure within JENKINS_HOME was organized by bundle name with one folder per bundle. Now the folder structure within JENKINS_HOME can store mutliple versions of each bundle. This makes it easy to maintain bundles for different environments or releases.

Due changes to the JENKINS_HOME folder structure, your existing bundles must be migrated when upgrading to CloudBees CasC Server plugin 2.0. Bundle migration allows you to select bundles ready for update and assign them to the approprite branch within a controller. During the migration process, the original bundle configuration remains until the migration is complete. This prevents the loss of data and misconfiguration of the controller. Bundle migration is handled manually or automatically.

Before upgrading to CloudBees CasC Server plugin 2.0, we strongly recommed to perform a backup of your cluster.

When posible, the migration is automatic. To migrate all the bundles, we strongly recommend configuring the defaultVersion of those bundles that come from a source control manamgement (SCM) repository. You can configure the defaultVersion in jenkins.yaml or in the operations center.

To configure the defaultVersion in jenkins.yaml:

unclassified: bundleStorageService: activated: true purgeOnDeactivation: true pollingPeriod: 12 activeBundle: name: "initial-remote" polling: false retriever: SCM: defaultVersion: "default-branch" (1) scmSource: git: id: "bf0d6af0-87a3-47bc-bd47-b3341d812cb9" remote: "" traits: - "gitBranchDiscovery"
1 Set the defaultVersion value.

To configure the defaultVersion in the operations center:

These steps can only be performed if you have not upgraded to CloudBees CasC Server plugin 2.0.
  1. From the dashboard, select Manage Jenkins  Manage Jenkins  System.

  2. Navigate to Configuration as Code bundle location.

  3. Select Load CasC bundles and then select Configure..

  4. Set the value for defaultVersion for each configured repository. This new value should be the branch your instance is currently using to checkout the CasC bundles.

  5. Select Save.

To view a list of all repositories without the defaultVersion configured, execute the following groovy script in the Script Console.

import com.cloudbees.opscenter.server.casc.config.remotes.RemoteBundles; import com.cloudbees.opscenter.server.casc.config.remotes.SCMBundleRetriever; def remotes = ExtensionList.lookupSingleton(RemoteBundles.class).getBundles(); def remotesWithoutDefVersion = [] as LinkedList remotes.each{ if (it.getRetriever() instanceof SCMBundleRetriever) { def defaultVersion = it.getRetriever().getDefaultVersion() if (!(defaultVersion?.trim())) { remotesWithoutDefVersion.add(it.getName()); } } } if (remotesWithoutDefVersion) { println "The following remote configurations read the bundles from SCM and they do not have a default version:" remotesWithoutDefVersion.each{ println "- " + it } println "You can fix this in Manage Jenkins > Configure System > Load CasC Bundles." } else { println "All your CasC Controller Bundle locations have configured the Default Version or are Local Folders" }

New features

Add branch and tag support for controller bundles (BEE-29562)

When configuring the CasC controller bundle location service, you could only configure a single branch to check out the bundles.

Now, if the source is a git repository, all branches and tags can be checked out depending on the git-plugin configuration. In addition, bundles can now be organized in folders within the repositories.

Add ability for the bundle list in Configuration as Code bundles to support branches and tags (BEE-29566)

The bundle list in Configuration as Code bundles now supports branches and tags. All results are grouped by bundle name and a collapsible row displays the different branches and tags.

Add the ability for the user to click on the filter and it will only show the assigned controller (BEE-30868)

The user can now click on the filter and it will only show the assigned controller. To indicate the activation, there is a cancel button on the right sidebar.

Add the ability to select the default bundle to support branch/tag changes (BEE-31009)

It is now possible to select the default bundle and then branch on the Configuration as Code Bundles page.

Add ability to assign a branch to the bundle when creating a controller (BEE-30871)

When creating a controller you can now assign a branch for the bundle.

Feature enhancements


Resolved issues


Known issues


Upgrade notes