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:
- Live Environment – using the instructions provided below, you can perform the tasks in the SAP BTP Free Tier account
- Platform Simulation – follow the step-by-step instructions within the simulation
Live Environment
In this exercise, you will perform the following steps:
- Create a job
- 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
Create a Job.
In the Jobs tab in SAP Continuous Integration and Delivery, choose + (Create Job).
Enter the following data:
Key Value Job Name A 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 Scroll down to Stages and select Job Editor as the Configuration Mode.
Scroll down to
Release
and toggleDeploy to Cloud Foundry
.Provide the respective information. You can find these on your SAP BTP subaccount overview page.
Save this Job configuration by clicking on
Create
.
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.
Open the Repositories tab.
Select your repository, in this case risk-management-repo, and click on Webhook Data.
The following pop-up window appears:
Leave it open and, in your project in GitHub, go to the Settings tab.
From the navigation pane, choose Webhooks or Hooks.
Choose Add webhook.
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.
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.
ExerciseStart Exercise
Result
You have configured a SAP Continuous Integration and Delivery job, which automates the build and deployment process of your project.