Configuring the operations center on traditional platforms using CasC

2 minute readScalabilityAutomation

Once you have created a CasC bundle, you can use it to configure the operations center on traditional platforms by adding the Java system property to the Jenkins service configuration file.

To configure the operations center using CasC:

  1. Install the operations center on your chosen hardware or virtual machine. For more information, refer to Installing CloudBees CI on traditional platforms.

  2. Add the -Dcore.casc.config.bundle=/path/to/oc-casc-bundle Java system property to the service configuration file. For more information, refer to Adding the Java system property below.

  3. Restart the operations center.

    CasC bundle validation is automatically performed when the instance is started and the bundle is applied. If an error is returned, the instance does not start and the validation error is included in the operations center’s log file. For more information, refer to Troubleshooting CasC for the operations center.

Adding the Java system property

After installing the operations center, you must add the -Dcore.casc.config.bundle=/path/to/oc-casc-bundle Java system property to the Jenkins service configuration file, replacing /path/to/oc-casc-bundle with the path to the CasC bundle.

You may need elevated privileges to modify the Jenkins service configuration file.

Adding the Java system property on Ubuntu or Debian

  1. Locate the Jenkins service configuration file. For most Linux distributions, the service configuration file is located here: /etc/default/cloudbees-core-oc

  2. In your service configuration file, look for the argument JAVA_ARGS. It should look like this:

    JAVA_ARGS="-Djava.awt.headless=true"
  3. Add the arguments:

    JAVA_ARGS="-Dcore.casc.config.bundle=/path/to/oc-casc-bundle -Djava.awt.headless=true"

Adding the Java system property on Red Hat and CentOS

  1. Locate the Jenkins service configuration file. For most RedHat and CentOS distributions, the service configuration file is located here: /etc/sysconfig/cloudbees-core-oc

  2. In your service configuration file, look for the argument JENKINS_JAVA_OPTIONS. It should look like this:

    JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true"
  3. Add the arguments:

    JENKINS_JAVA_OPTIONS="-Dcore.casc.config.bundle=/path/to/oc-casc-bundle -Djava.awt.headless=true"

Adding the Java system property on Microsoft Windows

  1. Locate the Jenkins service configuration file. For Windows operating systems, the service configuration file is located here: C:\Program Files\CloudBeesCoreOC\jenkins.xml

  2. In your service configuration file, add the arguments into the <arguments> tag:

    <arguments>--Dcore.casc.config.bundle=/path/to/oc-casc-bundle -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=8080</arguments>

Running the WAR file directly

  1. When starting the operations center, add the argument to the Java command:

    java -Dcore.casc.config.bundle=/path/to/oc-casc-bundle -jar cloudbees-core-oc.war

Adding the Java system property in Docker

  1. Pass the JAVA_OPTS to the container via --env JAVA_OPTS="…​":

    docker run --name myjenkins -p 8080:8080 -p 50000:50000 --env JAVA_OPTS=-Dcore.casc.config.bundle=/path/to/oc-casc-bundle jenkins/jenkins:lts

Adding the Java system property in Apache Tomcat

  1. Use the environment variable CATALINA_OPTS:

    export CATALINA_OPTS="-DJENKINS_HOME=/path/to/jenkins_home/ -Dcore.casc.config.bundle=/path/to/oc-casc-bundle"