首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >s4sdk管道s4sdk-管道. skipped生产部署步骤被跳过

s4sdk管道s4sdk-管道. skipped生产部署步骤被跳过
EN

Stack Overflow用户
提问于 2019-11-07 23:46:21
回答 1查看 285关注 0票数 2

我已经安装了Jenkins项目风笛(https://sap.github.io/jenkins-library/)。然后,我为spaces管道设置了一个基本的spaces编程模型应用程序,该应用程序具有默认配置,并取消了“productionDeployment”级和已完成的云铸造端点/orgs/space等注释。我已将应用程序提交给git中的主分支。

管道成功执行,但正在跳过生产部署步骤。

流水线执行结果

在检查日志时,我看到:

代码语言:javascript
复制
[Pipeline] // stageenter code here
[Pipeline] stage
[Pipeline] { (Production Deployment)
Stage "Production Deployment" skipped due to when conditional

当我查看脚本(https://github.com/SAP/cloud-s4-sdk-pipeline/blob/master/s4sdk-pipeline.groovy)时,我看到:

代码语言:javascript
复制
        stage('Production Deployment') {
        *when { expression { commonPipelineEnvironment.configuration.runStage.PRODUCTION_DEPLOYMENT }* }
        //milestone 80 is set in stageProductionDeployment
        steps { stageProductionDeployment script: this }
    }

有人能解释通过commonPipelineEnvironment.configuration.runStage.PRODUCTION_DEPLOYMENT检查以执行stageProductionDeployment脚本所需的内容吗?

我的pipeline_config.yml文件(匿名)是:

代码语言:javascript
复制
###
# This file configures the SAP Cloud SDK Continuous Delivery pipeline of your project.
# For a reference of the configuration concept and available options, please have a look into its documentation.
#
# The documentation for the most recent pipeline version can always be found at:
#    https://github.com/SAP/cloud-s4-sdk-pipeline/blob/master/configuration.md
# If you are using a fixed version of the pipeline, please make sure to view the corresponding version from the tag
# list of GitHub (e.g. "v15" when you configured pipelineVersion = "v15" in the Jenkinsfile).
#
# For general information on how to get started with Continuous Delivery, visit:
#    https://blogs.sap.com/2017/09/20/continuous-integration-and-delivery
#
# We aim to keep the pipeline configuration as stable as possible. However, major changes might also imply breaking
# changes in the configuration. Before doing an update, please check the the release notes of all intermediate releases
# and adapt this file if necessary.
#
# This is a YAML-file. YAML is a indentation-sensitive file format. Please make sure to properly indent changes to it.
###



### General project setup
general:
  productiveBranch: 'master'


### Step-specific configuration
steps:
  setupCommonPipelineEnvironment:
    collectTelemetryData: true

  cloudFoundryDeploy:
    dockerImage: 'ppiper/cf-cli'
    smokeTestStatusCode: '200'
    cloudFoundry:
      org: 'XXXXXX'
      space: 'XXXXXX'
      appName: 'MTBookshopNode'
      manifest: 'mta.yaml'
      credentialsId: 'CF_CREDENTIALSID'
      apiEndpoint: 'https://api.cf.XX10.hana.ondemand.com'

### Stage-specific configuration
stages:

  # This exclude is required for the example project to be successful in the pipeline
  # Remove it when you have added your first test
  s4SdkQualityChecks:
    jacocoExcludes:
      - '**/OrdersService.class'

#  integrationTests:
#    credentials:
#      - alias: 'mySystemAlias'
#        credentialId: 'mySystemCredentialsId'

#  s4SdkQualityChecks:
#    nonErpDestinations:
#      - 'myCustomDestination'

  productionDeployment:
    cfTargets:
      - org: 'XXXXXX'
        space: 'XXXXXX'
        apiEndpoint: 'https://api.cf.XX10.hana.ondemand.com'
        appName: 'myAppName'
        manifest: 'mta.yaml'
        credentialsId: 'CF_CREDENTIALSID'

我的Jenkins文件未变:

代码语言:javascript
复制
#!/usr/bin/env groovy

/*
 * This file bootstraps the codified Continuous Delivery pipeline for extensions of SAP solutions, such as SAP S/4HANA.
 * The pipeline helps you to deliver software changes quickly and in a reliable manner.
 * A suitable Jenkins instance is required to run the pipeline.
 * The Jenkins can easily be bootstraped using the life-cycle script located inside the 'cx-server' directory.
 *
 * More information on getting started with Continuous Delivery can be found in the following places:
 *   - GitHub repository: https://github.com/SAP/cloud-s4-sdk-pipeline
 *   - Blog Post: https://blogs.sap.com/2017/09/20/continuous-integration-and-delivery
 */

/*
 * Set pipelineVersion to a fixed released version (e.g. "v15") when running in a productive environment.
 * To find out about available versions and release notes, visit: https://github.com/SAP/cloud-s4-sdk-pipeline/releases
 */
String pipelineVersion = "master"

node {
    deleteDir()
    sh "git clone --depth 1 https://github.com/SAP/cloud-s4-sdk-pipeline.git -b ${pipelineVersion} pipelines"
    load './pipelines/s4sdk-pipeline.groovy'
}

有什么想法吗?我在生产部署的脚本中缺少了什么,以及如何通过这个检查?

问候尼尔

EN

回答 1

Stack Overflow用户

发布于 2019-12-02 18:05:20

该管道是为多分支管道构建的,在单分支管道作业中不能正常工作。在多分支管道作业中运行具有单个分支的项目没有问题。为了避免混淆,我们在最近的版本中为管道添加了一个检查,如这里所记录的https://blogs.sap.com/2019/11/21/new-versions-of-sap-cloud-sdk-3.8.0-for-java-1.13.1-for-javascript-and-v26-of-continuous-delivery-toolkit/#cd-toolkit

亲切的问候

佛里安

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58758468

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档