Building a Pipeline item- Digital Transformation with IBM API Connect
With the plugin loaded, you are now able to create a new item and choose Pipeline to begin setting up your pipeline:
- Click on New Item and a new page will display:
Figure 14.19 – Creating the Jenkins Pipeline
You begin by providing an item name. As shown in Figure 14.20, APICv10 Pipeline was entered. You will want to select the Pipeline project plugin that you installed. If Pipeline is not visible, scroll until you find it. Select it and click OK at the bottom of the page.
2. Once the page refreshes, you will see the new project in Dashboard:
Figure 14.20 – The new pipeline is created
From this point forward, you will be working exclusively within the Project pipeline. Now you need to configure the project to utilize Pipeline as Code by referencing your GitHub repository and providing your credentials.
3. Click on your project to enter configuration mode. The screen will bring up the configuration panel. When you create the Pipeline, you have the capabilities to configure various options. For the simple case that you are working on, the only important option is setting the GitHub project where you will store your resources. Scroll down to the Pipeline section and choose the Pipeline script from SCM, shown as follows:
Figure 14.21 – Pipeline as code setup with GitHub
As shown in Figure 14.21, you will have to choose Git from the SCM dropdown and provide your Repository URL and Credentials details. Repository URL follows the format of https://github.com/[your userid]/[project].git.
4. Click Apply and then Save. You are now ready to learn about configuring your Jenkinsfile to execute the requisite stages for your DevOps pipeline.
You should take some time to map out the steps you will be needing to build your pipeline. To sum up, here is what you need to consider:
- Plan on creating in your Jenkins workspace a folder to check out your Git resources using the Git clone command.
- Determine which catalog you will publish to as your Dev environment.
- Determine the apic CLI commands to issue to perform the step within your Jenkins stage.
- Capture the test URL that you will use to perform the unit test.
- Plan on what action you will take in the event of a failure.
These steps were considered when the Jenkinsfile was created so you will be able to observe how this is done by reviewing the Jenkinsfile provided. Let’s see that next.