Configuring a CI/CD Job

Objectives
After completing this lesson, you will be able to:

After completing this lesson, you will be able to:

  • Configure a job in the SAP Continous Integration and Delivery service

Configure a CI/CD Job

Usage Scenario

You have enabled SAP Continuous Integration and Delivery for your GitHub repository and for deployment into SAP BTP, Cloud Foundry environment. But until now, you have not told the service what exactly it is supposed to do for you. In this exercise, you will configure a CI/CD job which executes different tasks like building or deploying your application. The job is the actual automation part of this course.

Exercise Options

You can perform this exercise in two ways:

  1. Live Environment – using the instructions provided below, you can perform the tasks in the SAP BTP Free Tier account
  2. Platform Simulation – follow the step-by-step instructions within the simulation
Note
Recommendation: start with the live environment.

Live Environment

In this exercise, you will perform the following steps:

  1. Create a job
  2. Configure a webhook

Prerequisite

Make sure that by now you have enabled the SAP Continuous Integration and Delivery service for your GitHub repository and for deployment into SAP BTP, Cloud Foundry environment.

Steps

  1. Create a Job.

    1. In the Jobs tab in SAP Continuous Integration and Delivery, choose + (Create Job).

    2. Enter the following data:

      KeyValue
      Job NameA freely chosen name for your job, which is unique in your SAP BTP subaccount. In this example, the name of the job is risk-management-job.
      Repository<Choose the repository you created earlier from the dropdown> (for example, risk-management-repo).
      Branch<Enter the GitHub branch from which you want to receive push events. In this example, the name of the branch is main.>
      Pipeline<Choose> SAP Cloud Application Programming Model
    3. Scroll down to Stages and select Job Editor as the Configuration Mode.

      General Information
    4. Scroll down to Release and toggle Deploy to Cloud Foundry.

    5. Provide the respective information. You can find these on your SAP BTP subaccount overview page.

      Configure Cloud Foundry Deployment Release stage
    6. Save this Job configuration by clicking on Create.

  2. Configure a Webhook.

    The goal is for your SAP Continuous Integration and Delivery service job to run whenever there is a change on the main branch of your GitHub repository. To retrieve the information about a change on the repository, you make use of a webhook. There is a Webhook Event Receiver for your repository in the SAP Continuous Integration and Delivery service, and you need to configure the webhook itself in your GitHub repository.

    1. Open the Repositories tab.

    2. Select your repository, in this case risk-management-repo, and click on Webhook Data.

    3. The following pop-up window appears:

    4. Leave it open and, in your project in GitHub, go to the Settings tab.

    5. From the navigation pane, choose Webhooks or Hooks.

    6. Choose Add webhook.

    7. Enter the Payload URL, Content type, and Secret from the Webhook Creation pop-up in SAP Continuous Integration and Delivery. For all other settings, leave the default values.

    8. Choose Add webhook.

      Now, whenever there is a push event to any branch of your repository, the webhook will be triggered. The webhook then notifies your SAP Continuous Integration and Delivery service, using the specified Payload URL and Secret.

    Platform Simulation

    Click on the Start button below to open a simulation of the platform. Then follow the step-by-step instructions to create and configure a CI/CD job.

Result

You have configured a SAP Continuous Integration and Delivery job, which automates the build and deployment process of your project.

Save progress to your learning plan by logging in or creating an account

Login or Register