- Log in to the IBM Cloud private console.
- From the console, select App Center.
- 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.
- Click Install Package.
- Click Review and Install.
- 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.
- OPTIONAL: To see the pod events, from the console, click the application name > pod name > Events tab.
Access the Jenkins UI
- From the console, select Workloads > Applications.
- Locate the default-jenkins-jenkins application.
- To display the application details for the default-jenkins-jenkins application, click its name.
- From the Expose Details section of the application details page, click access http endpoint. The Jenkins UI displays.
- Log in to your Jenkins UI with the default user name and password: admin:admin.
Create a Jenkins Project
- From the Jenkins UI, click create new jobs.
- From the project page, enter the project name “demo” and select Freestyle project.
- 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
- From the Source Code Management section, select Git.
- Paste the sample repository URL, https://github.com/cfc-cicd/cron-test.git.
- From the Build Triggers section, select Poll SCM.
- Input a cron schedule. For example, enter H/5 * * * * to poll the Git repo for new commits every 5 minutes.
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.
- Click Add build step > Docker Build and Publish.
- 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
i. Click Add > Jenkins.
ii. Input the following values:
iii. Click Add.
iv. From the registry credentials list, select admin/*******(cfc-user-password).
Click Build Now.
- Review the Build History to see the progress of your build.
- Click the build name to view its details.
- 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.