Running Jenkins ci/cd deployments in an IBM Cloud private environment

Kathryn Alexander
Aug 25, 2017 · 4 min read

In this tutorial, learn how to set up Jenkins in an IBM Cloud private cluster. We will also explore how to use Jenkins to automate the process of building and adding images in your cluster. For more information about Jenkins, see https://jenkins.io/.

Install Jenkins

  1. Log in to the IBM Cloud private console.
  2. From the console, select App Center.
  3. Locate the Jenkins package.
    * To install the package on Linux, select local-charts/jenkins.
    * To install the package on Linux on POWER 64-bit Little Endian (LE), select local-charts/jenkins-ppc64le.
  1. Click Install Package.
  2. Click Review and Install.
  3. Click Install. This process might take a few minutes depending on how long it takes your cluster to load the Jenkins image. During the wait time, you can review pod events to see the progression of your deployment.
  4. OPTIONAL: To see the pod events, from the console, click the application name > pod name > Events tab.

Access the Jenkins UI

  1. From the console, select Workloads > Applications.
  2. Locate the default-jenkins-jenkins application.
  3. To display the application details for the default-jenkins-jenkins application, click its name.
  4. From the Expose Details section of the application details page, click access http endpoint. The Jenkins UI displays.

5. Log in to your Jenkins UI with the default user name and password: admin:admin.

Create a Jenkins Project

  1. From the Jenkins UI, click create new jobs.
  2. From the project page, enter the project name “demo” and select Freestyle project.
  3. Click OK.

Configure your Jenkins project

From the Jenkins configuration page for your demo project, update the source code management, build triggers, and build environment sections.

Source Code Management

  1. From the Source Code Management section, select Git.
  2. Paste the sample repository URL, https://github.com/cfc-cicd/cron-test.git.

Build Triggers

  1. From the Build Triggers section, select Poll SCM.
  2. Input a cron schedule. For example, enter H/5 * * * * to poll the Git repo for new commits every 5 minutes.

Build Environment

In this step, configure Jenkins to use the Dockerfile located in the sample Git repository to build the image cron:latest, and then push the image into the IBM Cloud private Docker registry at master.cfc:8500.

  1. Click Add build step > Docker Build and Publish.
  2. Input the following information:
  • Repository Name : default/cron. This command places a copy of the “cron” image in the “default” repository.
  • Tag: latest.
  • Docker Host URI: unix:///var/run/docker.sock
  • Server credentials: none
  • Docker registry URL: https://master.cfc:8500

Set the Registry credentials

  1. Click Add > Jenkins.
  2. Input the following values:
    Username: admin
    Password: admin
    ID: cfc-user-password
    Description: cfc-user-password
  3. Click Add.

4. From the registry credentials list, select admin/*******(cfc-user-password).

5. Click Save, and then click Build Now.

Review

  1. Review the Build History to see the progress of your build.
  2. Click the build name to view its details.

3. Click Console Output to see the task details.

If the build task is successful, you can find a new image — master.cfc:8500/default/cron:latest — in the IBM Cloud private cluster management console. To view the image, from the console menu bar, select Infrastructure > Images.


Originally published at developer.ibm.com by Shawnique Warren. Republished with permission.

IBM Cloud

Understand how to bring elastic runtimes to the Enterprise with effective security and data protection at scale.

)

Kathryn Alexander

Written by

IBM Cloud

IBM Cloud

Understand how to bring elastic runtimes to the Enterprise with effective security and data protection at scale.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade