Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member535766
Participant
With SAP Continuous Integration and Delivery, we strive for simplicity: Our service on SAP BTP offers ready-made pipelines for various SAP-specific development scenarios. With them, we want to help you implement CI/CD quickly and without having to care about the underlying infrastructure. Simplicity, however, shouldn’t mean inflexibility. That’s why we’ve added additional configuration options to our pipelines to make sure they work for your purposes.

In different stages of your CI/CD pipelines, you can now add additional credentials and variables. This lets you, for example, access a private repository when building your application or set a DEBUG flag when running your tests.

Have a look at the following example to see how our new feature works:

Use Private npm Packages in Your CI/CD Job


Add an access token to the Build stage of your SAP Continuous Integration and Delivery job to access private npm packages during its execution.

Procedure



  1. In your source code repository, create a custom .npmrc file with the following content:
    //registry.npmjs.org/:_authToken=${NPM_TOKEN}​

    Note:
    You specify a literal value of ${NPM_TOKEN}. The npm CLI will replace this value with the contents of the NPM_TOKEN environment variable. Do not put a token in this file.

  2. Check in your .npmrc file.

  3. In SAP Continuous Integration and Delivery, create a new or edit an existing SAP Cloud Application Programming Model job.

  4. In the Build stage, choose + (Add credentials variable) next to Additional Credentials.
    As a result, the Add Credentials Variable pop-up window opens.

  5. For Name, enter NPM_TOKEN.

  6. Open the Credentials Name drop-down list and choose Create Credentials.
    As a result, the Create Credentials pop-up window opens.

  7. For Credentials Name, enter mynpmtoken.

  8. From the Type drop-down list, choose Secret Text.

  9. In the Secret text field, enter your token.

  10. Choose Create.
    As a result, your newly created credential is used for Credentials Name.

  11. Choose OK.

  12. Create and run your job.


Result


You can now use private npm packages with your SAP Continuous Integration and Delivery job.

That’s cool, isn’t it? Have a look at our documentation and try it out yourself: Adding Environment Variables to Stages | SAP Help Portal

We’re also working on adding even more flexibility to our pipelines. Stay tuned!