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 SAP Continuous Integration and Delivery job that executes different tasks, such as building or deploying your application. The job is the actual automation part of this course.
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
In this exercise, you will perform the following steps:
- Create a job
- Configure a webhook
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.
Create a job.
On the Jobs tab in SAP Continuous Integration and Delivery, choose + (Create Job).
Enter the following data:
Key Value Job Name risk-management-job Repository RiskManagement-Repo (prefilled) Branch main Pipeline SAP Cloud Application Programming Model
Scroll down to Stages and select Job Editor as the Configuration Mode.
Scroll down to
Deploy to Cloud Foundry.
Please be careful here and do not confuse
Provide the respective information. You can find these on your SAP BTP subaccount overview page.
To save this Job configuration, choose 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 use 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 choose Webhook Data.
The Webhook Creation 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.
You have configured a SAP Continuous Integration and Delivery job, which automates the build and deployment process of your project.