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: Exercise Overview

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. After completing the next steps, you will have configured a job in SAP Continuous Integration and Delivery. The job is the actual automation part of this course.

Task Flow

In this exercise, you will configure a job in the SAP Continuous Integration and Delivery service.

Prerequisite

You have enabled the SAP Continous Integration and Delivery service for your GitHub repository and for deployment into SAP BTP, Cloud Foundry environment.

Watching the Simulation and/or Performing the Steps

Note
In this exercise you find a simulation and a list of all steps, displayed in the simulation. Performing the steps below allows you to follow the simulation in your own trial account.

Configure a CI/CD Job

Task 1: Configure a Job in the SAP Continuous Integration and Delivery Service

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 Source Repository as the Configuration Mode.

      This tells your job, that the actual stages, the work that is to be performed, will be defined within the source repository itself. You are going to configure the stages in a following part.

    4. Choose 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.

    3. Select the ... (More) button and choose Webhook Data.

    4. The following pop-up window appears:

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

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

    7. Choose Add webhook.

    8. 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.

    9. 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.

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