Search code examples
s4sdk

How to skip Production Deployment stage for feature branch build when using S/4HANA Cloud SDK Pipeline?


We are using s4sdk pipeline from:

https://github.com/SAP/cloud-s4-sdk-pipeline

When I work on my feature branch, in order to skip the production deployment, usually I remove the configuration below:

    productionDeployment:
      appUrls:
        - 'myUrl'
      cfTargets:
        - org: 'myOrg'
          space: 'mySpace'
          apiEndpoint: 'myEndpoint'
          appName: 'myAppname'
          manifest: 'myManifest.yml'
          credentialsId: 'myCredentialsId'

Is there any existing mechanism/configuration to help distinguish my testing branch and productive branch, so that the deployment happens only for the productive branch build?

Thanks in advance.


Solution

  • You can always mention your productive branch in the general configuration of pipeline_config.yml. When you mention that, pipeline will always check the current branch name with that of value mentioned, deployment is carried out by pipeline only if these values are same.

    #Project Setup
    general:
      productiveBranch: 'master'
      projectName: 'my_project'