Technical Articles
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?
- 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'
- 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.
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
Thank you, Cedric Heisel! Happy to hear that you like it!
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
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
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
Hi Manikandan Kannan ,
could you please provide some more details ?
Which stage, what have you changed ?
Thanks and best regards,
Thorsten
Hi Thorsten,
It is failing in the build stage itself.
Pipeline Error
mta.yaml
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
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. 😊
Hello Sara, is there any way to include on premise system with project 'piper'. Like the usual SAP Abap Dev system.
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/
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.
Hi Himanshu,
have you checked the gcts* Steps ? There is an gctsExecuteABAPTests step available but no ATC.
Best regards,
Thorsten
Yes, Thank you Thorsten for this.
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
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.
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
Hi Vijay Gonuguntla Yes, I did. You are very welcome to visit my blog post.
Regards,
Alexander