Skip to Content
Technical Articles
Author's profile photo Sarah Lendle

How to Use Project “Piper” Docker Images for CI/CD with Azure DevOps

Project “Piper”, SAP’s open-source solution for continuous integration and delivery, does not only contain a shared library with steps, scenarios, and utilities for Jenkins pipelines but also a set of Docker images for implementing CI/CD best practice processes. However, just like our shared library, these images were quite limited to Jenkins and typical project “Piper” use cases. But what if you want to use your own CI tool, such as Azure DevOps, together with an SAP-specific pipeline?

If that’s the case, we have good news for you: We’ve started to rework and decouple our Docker images so that as a first result, you can use project “Piper” out-of-the-box together with Azure DevOps. We now provide a CI/CD pipeline with build, test, and deploy steps for classical SAP UI5 applications on Azure DevOps in the Cloud Foundry environment.

How can you use our CI/CD pipeline?

  1. In your project sources, create a yml-file named azure-pipelines.yml and copy the following code into it:
    # Starter pipeline
    # Start with a minimal pipeline that you can customize to build and deploy your code.
    # Add steps that build, run tests, deploy, and more:
    # https://aka.ms/yaml
    
    
    name: cd-openui5-sample-app
    resources:
      containers:
      - container: mta
        image: 'ppiper/mta-archive-builder:latest'
        options: --user 0:0
      - container: cfcli
        image: 'ppiper/cf-cli'
        options: --user 0:0 --privileged
      - container: node
        image: 'geekykaran/headless-chrome-node-docker:latest'
        options: --privileged
    
    
    trigger:
    - master
    
    
    stages:
    - stage: build
      displayName: Build MTA for SAP Cloud Platform
      jobs:
        - job: build
          pool:
            vmImage: 'ubuntu-latest'
          container: mta
          steps:
            - bash: 'mtaBuild --build-target CF --mtar MySampleApp.mtar build'
            - publish: $(System.DefaultWorkingDirectory)/.
              artifact: WebApp
              
    
    
    - stage: test
      displayName: Run Karma Test Suite
      jobs:
        - job: test
          pool:
            vmImage: 'ubuntu-latest'
          container: node
          steps:
            - bash: 'cd MySampleApp && npm config set @sap:registry "https://npm.sap.com" && npm install && npm run-script test'
            - publish: $(System.DefaultWorkingDirectory)/.
              artifact: TestResult
    
    
    - stage: deploy
      displayName: Deployment to SAP Cloud Platform (cf)
      jobs:
        - job: deploy
          pool:
            vmImage: 'ubuntu-latest'
          container: cfcli
          steps:
            - download: current
              artifact: WebApp
            - bash: 'cf login -u "$(CF-USER)" -p "$(CF-PASSWORD)" -a "$(CF-API)" -o "$(CF-ORG)" -s "$(CF-SPACE)" && cf deploy $(Pipeline.Workspace)/WebApp/MySampleApp.mtar -f'
    ​
  2. In Azure DevOps, define variables for the secrets in the code (CF-USER, CF-PASSWORD, CF-API, CF-ORG, CF-SPACE).

Done! And the greatest thing about it? You can extend your pipeline by adding any desired Docker container.

Do you want to know how others have experienced working with our adapted Docker images? We’re currently writing a blog post about our collaboration with the customer who initiated our rework. Stay tuned!

Edit: Here’s the follow-up blog post: Project “Piper” and Azure DevOps: Successful Collaboration with ‘delaware’

Are you new to CI/CD by SAP? Have a look at Continuous Integration and Delivery by SAP.

Are you interested in SAP’s CI/CD offerings? See SAP Solutions for Continuous Integration and Delivery.

Assigned Tags

      18 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Cedric Heisel
      Cedric Heisel

      Hi Sarah,

      thank you for sharing this awesome stuff. I just did copy and paste, and it's working. The magic behind is the docker hub, who is acting as central hub for dependencies in azure devOps

      Great stuff, great post - thank you !

      Regards,

      Cedric

      Author's profile photo Sarah Lendle
      Sarah Lendle
      Blog Post Author

      Thank you, Cedric Heisel! Happy to hear that you like it!

      Author's profile photo Mike Healey
      Mike Healey

      Hello Sarah

      I have been trying to seek a blog on this topic for 18+ months - i.e. SAP confirmation that Azure DevOps Pipeline that can utilise Piper containers. However 99% of SAP CI/CD documentation only references Jenkins for CI / CD outside of SAP tooling. This is brilliant !

      Do you know if SAP will officially confirm that Project Piper can be used with Azure DevOps, and use of docker containers under the control of Azure DevOps Pipelines?

      All previous contact with SAP was that they cannot comment / commit to use of Piper with Azure DevOps, only Jenkins.

      Which means at the moment we are using Azure DevOps Pipelines (strategic for my client) to trigger Jenkins jobs (exceptional use only) on push / pull-request to Git for MTA builds + deployment to Neo / CF / XSA.

      Any feedback on this would be appreciated.

      Thanks

      Mike

       

       

       

      Author's profile photo Sarah Lendle
      Sarah Lendle
      Blog Post Author

      Hi Mike Healey,

      Thanks for your comment!

      Although project "Piper" is generally designed to run on Jenkins, we're currently making several of our Docker images work with other CI/CD infrastructures, as well. At the same time, we offer the Continuous Integration and Delivery Best Practices Guide, which doesn't require a specific CI/CD stack.

      If you like, follow us on Twitter so we can keep you updated - you can find our profiles on our Continuous Integration and Delivery by SAP overview page.

      Also, we would like to contact you personally to learn more about your scenario and see how we can help you. We'll send you an e-mail. 🙂

      Best regards,

      Sarah

      Author's profile photo Manikandan Kannan
      Manikandan Kannan

      Hi Sara,

       

      Thank you for the blog. We are using the similar one . It was working till I use the grunt builder in UI . Now it is no more working with the new UI template and getting the below error. Could you help on this.

       

      ERROR: Failed to build module "Demo". Builder not found: "custom"

       

      Thanks

       

      Author's profile photo Thorsten Duda
      Thorsten Duda

      Hi Manikandan Kannan ,

      could you please provide some more details ?
      Which stage, what have you changed ?

       

      Thanks and best regards,

      Thorsten

      Author's profile photo Manikandan Kannan
      Manikandan Kannan

      Hi Thorsten,

       

      It is failing in the build stage itself.

      Pipeline%20Error

      Pipeline Error

       

      mta.yaml

       

      - name: AllRunID
          type: html5
          path: app/demo/AllRunID
          build-parameters:
            builder: custom
            commands:
              - npm install
              - npm run build
            supported-platforms: []
            build-result: dist
      Author's profile photo Thorsten Duda
      Thorsten Duda

      Hi Manikandan Kannan,

       

      the builder in your mta.yaml seems to be unknown.

      Please have a look at the Cloud MTA Builder documentation: https://sap.github.io/cloud-mta-build-tool/

      I also suggest to use the corresponding new image devxci/mbtci.

       

      Best regards,

      Thorsten

      Author's profile photo Ronnie André Bjørvik Sletta
      Ronnie André Bjørvik Sletta

      Sarah Lendle!, would you be able to update the blog post with the information from Thorsten Duda, so the YAML uses the correct docker image for mbt? This error hit me in the face too, since I didn't read all the comments before executing.  And I wouldn't be surprised if many others will face the same. 😊

      Author's profile photo Himanshu Sharma
      Himanshu Sharma

      Hello Sara, is there any way to include on premise system with project 'piper'. Like the usual SAP Abap Dev system.

      Author's profile photo Thorsten Duda
      Thorsten Duda

      Hi Himanshu,

      it depends on your scenario e.g.

      1.) Hybrid Scenario: UI5 App in SAP Cloud Platform and ODATA Service on prem

      2.) Upload a UI5 App into ABAP Gateway directly

      These are the scenarios including on premise systems. In general all available scenarios and functions are documented here: https://sap.github.io/jenkins-library/

       

      Author's profile photo Himanshu Sharma
      Himanshu Sharma

      Thank you Thorsten for the references, Much appreciated.

      If I say, my scenario is purely ABAP, like I need to perform automated ATC checks and ABAP Unit testing on my ABAP code from On premise while pushing it to Azure Repos. So, that comprises my requirement. This is not clearly mentioned any where. But I am planning to use SAP Docker images to perform this. Let's see if  I get any positive result.

      Author's profile photo Thorsten Duda
      Thorsten Duda

      Hi Himanshu,

       

      have you checked the gcts* Steps ? There is an gctsExecuteABAPTests step available but no ATC.

       

      Best regards,

      Thorsten

      Author's profile photo Himanshu Sharma
      Himanshu Sharma

      Yes, Thank you Thorsten for this.

      Author's profile photo Charles Aylward
      Charles Aylward

      Hi Sarah,

      Great article. This helped me complete a POC to proof we can build, test and deploy SAP Fiori web apps on the Azure DevOps platform.

      However, I would like to know if the containers used supported by SAP and/or ready for production use within a large organization?

      Kind Regards

      Charles

      Author's profile photo Alexander Clen Riva
      Alexander Clen Riva

      Great article Sarah Lendle!

      Any idea how can I implement this set up for Cloud Integration Artifacts?

      We are working on a PoC to have CI/CD pipelines using Azure DevOps.

       

      Author's profile photo Vijay Gonuguntla
      Vijay Gonuguntla

      Hi Alexander Clen Riva Ccaccaycucho

      Did you got any resources for integration artifacts . We are trying to do similar PoC to have CI/CD pipelines using Azure DevOps. Thanks

       

      Regards

      Vijay

      Author's profile photo Alexander Clen Riva
      Alexander Clen Riva

      Hi Vijay Gonuguntla Yes, I did. You are very welcome to visit my blog post.

      Regards,

      Alexander