Enabling SAP Continuous Integration and Delivery

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

After completing this lesson, you will be able to:

  • Enable SAP Continuous Integration and Delivery

Enable SAP Continuous Integration and Delivery

Business Scenario

In this exercise, you will enable the SAP Continuous Integration and Delivery (CI/CD) service for your project.

Continuous integration (CI) describes a software development process in which various team members integrate their contributions frequently into a single main line. Before each integration, the changes are verified through builds and automated testing. Thereby, you can detect errors as quickly as possible and prevent integration problems before completing the development.

Continuous delivery (CD) adds the aspect that any change that has successfully passed the tests is immediately ready to be deployed to production, both from a technical and a qualitative point of view.

For more information about CI/CD such as CI principles and process flows, see:

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
As with the previous exercises, we are recommending that you start performing the exercise in the live environment.

Live Environment

In this exercise, you will perform the following steps:

  1. Create and Administer Continuous Integration and Delivery Service.
  2. Configure Credentials in SAP Continuous Integration and Delivery Service.
  3. Configure the GitHub Repository in SAP Continuous Integration and Delivery Service.

Prerequisite

Please make sure that by this moment you have connected your CAP project to your GitHub repository.

Steps

  1. Create and Administer Continuous Integration and Delivery Service.

    1. Enter your SAP BTP account. In Account Explorer, under Directories and Subaccounts, select your subaccount and navigate to the Services tab in the left navigation bar. Go to Service Marketplace.

    2. Enter Continuous Integration & Delivery in the search box. If the tile is displayed, select it and proceed to substep c.

      If the tile does not display, it must be entitled. To achieve this, select Entitlements in the left bar of your subaccount, then on the upper-right side, select Configure Entitlements, then Add Service Plans. A pop-up displays. On the left side of the pop-up, select the Continuous Integration & Delivery entitlement and on the right side select the trial flag. Confirm the pop-up (select Add 1 Service Plan). Navigate back to the Service Marketplace of your subaccount and try again. The tile should now display.

    3. Choose Create.

    4. Accept the default settings and choose Create.

      Note

      The default settings can change from time to time, so yours might differ from the screenshot.

    5. You can Close the pop-up Creation in Progress.

    6. In your SAP BTP subaccount, choose SecurityUsers.

    7. Choose your username.

    8. On the right side, click on Assign Role Collections.

    9. From the list, select CICD Service Administrator and choose Assign Role Collection.

      Your user is now authorized to use and administer the Continuous Integration and Delivery service.

  2. Configure Credentials in SAP Continuous Integration and Delivery.

    The SAP Continuous Integration and Delivery service will act as an automation tool. It will retrieve the latest state of your GitHub repository, build your project, and deploy it to your SAP BTP, Cloud Foundry environment. You need to configure GitHub and SAP BTP credentials for the service to be able to connect to these environments.

    1. In your SAP BTP subaccount, navigate to Services and then to Instances and Subscriptions.

    2. Choose the Go to Application icon located next to the Continuous Integration & Delivery subscription.

    3. Use your credentials to log in to the application.

    4. In the Credentials tab in SAP Continuous Integration and Delivery, choose + (Create Credentials).

      If your GitHub repository is private, configure credentials for it so that the Continuous Integration & Delivery service can connect to it.

      Note
      If your GitHub repository is not private, you can skip this step.
    5. Enter the following data:

      FieldValue
      Name<a freely chosen name for your credential, which is unique in your SAP BTP subaccount>. In this example, the name of the credential is github.
      Type<select> Basic Authentication
      Username<your GitHub username>
      Password<use the personal access token, which you've created in GitHub in a previous exercise>
    6. To create credentials for deploying to the SAP BTP, Cloud Foundry environment, go to the Credentials tab and choose + (Create Credentials).

    7. Enter the following data:

      FieldValue
      Name<enter a freely chosen name for your credentials, which is unique in your SAP BTP subaccount.> In this example, the name of the credentials is cfdeploy
      Type<select> Basic Authentication
      Username<your username for the SAP BTP cockpit>
      Password<use your password for the SAP BTP cockpit>
    8. Your result will look like this:

  3. Configure the GitHub Repository in SAP Continuous Integration and Delivery.

    The SAP Continuous Integration and Delivery service can manage multiple repositories. You need to configure your GitHub repository so that the service is able to retrieve sources from it.

    1. In the Repositories tab in SAP Continuous Integration and Delivery, choose + (Add repository).

    2. For Name, enter a freely chosen name for your repository, which is unique in your SAP BTP subaccount. In this example, the name of the repository is RiskManagement-Repo.

    3. As Clone URL, enter the HTTPS Clone URL of your GitHub repository. Find it by selecting the green Code button in your GitHub repository. Choose the Clipboard icon to copy the URL.

    4. As Credentials, select github that you created in the previous steps.

    5. Leave the default values in the Webhook Event Receiver section. Make sure that Type is set to GitHub.

    6. Select Add to add the repository to your SAP Continuous Integration and Delivery service.

    Platform Simulation

    Click on the Start button below to open a simulation of the platform. Then follow the step-by-step instructions to enable SAP continuous integration and delivery.

Result

You have enabled SAP Continuous Integration and Delivery for your project.

Reference Links: Enabling SAP Continuous Integration and Delivery

For your convenience, this section contains the external references in this lesson.

If links are used multiple times within the text, only the first location is mentioned in the reference table.

Ref#SectionContext text fragmentBrief descriptionLink
1ScenarioContinuous Integration PrinciplesContinuous Integration principlesContinuous Integration Principles
2ScenarioContinuous Integration and Continuous Delivery GuideOverview of the continuous integration and delivery conceptsContinuous Integration and Continuous Delivery Guide
3Continuous DeliverySAP BTP Trial AccountSAP BTP CockpitSAP BTP trial account
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.

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