Skip to content
This repository has been archived by the owner on Nov 2, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
s4sdkJenkinsBot committed Jul 21, 2020
2 parents 56a62f4 + f7b03b5 commit 94dc66c
Show file tree
Hide file tree
Showing 16 changed files with 82 additions and 150 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ test {
}

task downloadPiper(type: Download) {
src 'https://github.com/SAP/jenkins-library/releases/download/v1.54.0/jenkins-library.jar'
src 'https://github.com/SAP/jenkins-library/releases/download/v1.58.0/jenkins-library.jar'
dest 'libs/jenkins-library.jar'
onlyIfModified true
}
Expand Down
4 changes: 2 additions & 2 deletions resources/containers_map.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ containerMaps:
- executeNpm
endToEndTests:
- mavenExecute
- executeNpm
- npmExecuteScripts
- cloudFoundryDeploy
- neoDeploy
- cloudFoundryCreateService
Expand All @@ -62,7 +62,7 @@ containerMaps:
- sonarExecuteScan
productionDeployment:
- mavenExecute
- executeNpm
- npmExecuteScripts
- cloudFoundryDeploy
- neoDeploy
- cloudFoundryCreateService
14 changes: 13 additions & 1 deletion resources/default_s4_pipeline_environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,14 @@ steps:
testsPublishResults:
junit:
active: true
pattern: '**/target/surefire-reports/*.xml,s4hana_pipeline/reports/backend-unit/**,s4hana_pipeline/reports/frontend-integration/**/*.xml'
pattern: '**/target/surefire-reports/*.xml,s4hana_pipeline/reports/backend-unit/**,s4hana_pipeline/reports/frontend-integration/**/*.xml,s4hana_pipeline/reports/e2e/*.xml'
jacoco:
active: false
cobertura:
active: false
cucumber:
active: false
pattern: 's4hana_pipeline/reports/e2e/*.json'

checkFindbugs:
includeFilterFile: s4hana_findbugs_include_filter.xml
Expand Down Expand Up @@ -132,3 +135,12 @@ stages:

s4SdkQualityChecks:
disabledChecks: []

endToEndTests:
stageLocking: true
lockingResource: 'endToEndTest'

productionDeployment:
stageLocking: true
lockingResource: 'productionDeployment'
ordinal: 80
14 changes: 0 additions & 14 deletions src/com/sap/cloud/sdk/s4hana/pipeline/E2ETestCommandHelper.groovy

This file was deleted.

12 changes: 0 additions & 12 deletions src/com/sap/cloud/sdk/s4hana/pipeline/EndToEndTestType.groovy

This file was deleted.

53 changes: 53 additions & 0 deletions vars/checkLegacyConfiguration.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ def call(Map parameters) {
checkArtifactSetVersion(script)
checkAutomaticVersioning(script)
checkGlobalExtensionConfiguration(script)
checkTmsUpload(script)
checkEndToEndTestsAppUrl(script)
}

void checkGlobalExtensionConfiguration(Script script) {
Expand Down Expand Up @@ -84,6 +86,16 @@ void checkStaticCodeChecksConfig(Script script) {
}
}

void checkTmsUpload(Script script) {
if (loadEffectiveStageConfiguration(script: script, stageName: 'productionDeployment').tmsUpload) {
failWithConfigError("Your pipeline configuration contains an entry tmsUpload in the stage productionDeployment. " +
"This configuration option was removed in version v39. " +
"Please configure the step tmsUpload instead. " +
"Details can be found in the release notes at https://github.com/SAP/cloud-s4-sdk-pipeline/releases/tag/v39 as well as in the step documentation: https://sap.github.io/jenkins-library/steps/tmsUpload/."
)
}
}

void checkSharedConfig(Script script) {
if (script.commonPipelineEnvironment.configuration.general?.sharedConfiguration) {
failWithConfigError("Your pipeline configuration contains an entry for the sharedConfiguration in the general section. " +
Expand Down Expand Up @@ -123,6 +135,47 @@ void checkAutomaticVersioning(Script script){
}
}

void checkEndToEndTestsAppUrl(Script script) {
Map e2eStageConfig = loadEffectiveStageConfiguration(script: script, stageName: 'endToEndTests')
Map prodStageConfig = loadEffectiveStageConfiguration(script: script, stageName: 'productionDeployment')

if (e2eStageConfig?.appUrls instanceof String) {
failWithConfigError("The configuration key appUrls in the endToEndTests stage configuration must not be a string anymore. " +
"Please configure appUrls as a list of maps. For example:\n" +
"appUrls: \n" + " - url: 'https://my-url.com'\n" + " credentialId: myCreds\n" +
"More details can be found in the documentation: https://sap.github.io/jenkins-library/steps/npmExecuteEndToEndTests/#parameters")
}
if (prodStageConfig?.appUrls instanceof String) {
failWithConfigError("The configuration key appUrls in the productionDeployment stage configuration must not be a string anymore. " +
"Please configure appUrls as a list of maps. For example:\n" +
"appUrls: \n" + " - url: 'https://my-url.com'\n" + " credentialId: myCreds\n" +
"More details can be found in the documentation: https://sap.github.io/jenkins-library/steps/npmExecuteEndToEndTests/#parameters")
}

if (e2eStageConfig?.appUrls) {
for (int i = 0; i < e2eStageConfig.appUrls.size(); i++) {
Map appUrl = e2eStageConfig.appUrls[i]
if (appUrl.parameters instanceof String) {
failWithConfigError("The configuration key parameters in the endToEndTests stage configuration must not be a string anymore. " +
"Please configure parameters as a list of strings. For example:\n" +
"appUrls: \n" + " - url: 'https://my-url.com'\n" + " parameters: ['--tag', 'scenario1']\n" +
"More details can be found in the documentation: https://sap.github.io/jenkins-library/steps/npmExecuteEndToEndTests/#parameters")
}
}
}
if (prodStageConfig?.appUrls) {
for (int i = 0; i < prodStageConfig.appUrls.size(); i++) {
Map appUrl = prodStageConfig.appUrls[i]
if (appUrl.parameters instanceof String) {
failWithConfigError("The configuration key parameters in the productionDeployment stage configuration must not be a string anymore. " +
"Please configure parameters as a list of strings. For example:\n" +
"appUrls: \n" + " - url: 'https://my-url.com'\n" + " parameters: ['--tag', 'scenario1']\n" +
"More details can be found in the documentation: https://sap.github.io/jenkins-library/steps/npmExecuteEndToEndTests/#parameters")
}
}
}
}

private checkRenamedStep(Script script, String oldName, String newName) {
if (loadEffectiveStepConfiguration(script: script, stepName: oldName)) {
failWithConfigError("The configuration key ${oldName} in the steps configuration may not be used anymore. " +
Expand Down
2 changes: 1 addition & 1 deletion vars/checkoutAndInitLibrary.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def call(Map parameters) {

Map scmCheckoutResult = checkout(parameters.checkoutMap ?: scm)

initS4SdkPipelineLibrary script: script, configFile: parameters.configFile, customDefaults: parameters.customDefaults
initS4SdkPipelineLibrary script: script, configFile: parameters.configFile, customDefaults: parameters.customDefaults, customDefaultsFromFiles: parameters.customDefaultsFromFiles

if (scmCheckoutResult.GIT_COMMIT) {
ReportAggregator.instance.reportVersionControlUsed('Git')
Expand Down
6 changes: 3 additions & 3 deletions vars/cloudSdkPipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void call(parameters) {
parallel {
stage("End to End Tests") {
when { expression { parameters.script.commonPipelineEnvironment.configuration.runStage.E2E_TESTS } }
steps { stageEndToEndTests script: parameters.script }
steps { piperPipelineStageAcceptance script: parameters.script, stageName: 'endToEndTests' }
}
stage("Performance Tests") {
when { expression { parameters.script.commonPipelineEnvironment.configuration.runStage.PERFORMANCE_TESTS } }
Expand Down Expand Up @@ -110,8 +110,8 @@ void call(parameters) {

stage('Production Deployment') {
when { expression { parameters.script.commonPipelineEnvironment.configuration.runStage.PRODUCTION_DEPLOYMENT } }
//milestone 80 is set in stageProductionDeployment
steps { stageProductionDeployment script: parameters.script }
// "ordinal 80" is configured for stage "productionDeployment" in pipeline defaults
steps { piperPipelineStageRelease script: parameters.script, stageName: 'productionDeployment' }
}

}
Expand Down
90 changes: 0 additions & 90 deletions vars/executeEndToEndTest.groovy

This file was deleted.

6 changes: 4 additions & 2 deletions vars/initS4sdkPipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,18 @@ def call(Map parameters) {

script.commonPipelineEnvironment.gitCommitId = getGitCommitId()

script.commonPipelineEnvironment.projectName = projectName
String prefix = projectName

script.commonPipelineEnvironment.configuration.currentBuildResultLock = "${prefix}/currentBuildResult"
script.commonPipelineEnvironment.configuration.performanceTestLock = "${prefix}/performanceTest"
script.commonPipelineEnvironment.configuration.endToEndTestLock = "${prefix}/endToEndTest"
script.commonPipelineEnvironment.configuration.productionDeploymentLock = "${prefix}/productionDeployment"
script.commonPipelineEnvironment.configuration.stashFiles = "${prefix}/stashFiles/${env.BUILD_TAG}"

initNpmModules()

//todo load with customized default config for now until issue 8490 is resolved
piperInitRunStageConfiguration script: script, stageConfigResource: 'com.sap.piper/pipeline/cloudSdkStageDefaults.yml'

initStageSkipConfiguration script: script
}

Expand Down
2 changes: 1 addition & 1 deletion vars/initStageSkipConfiguration.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -156,5 +156,5 @@ private boolean endToEndTestsShouldRun(script) {
return false
}

return stageConfig && script.fileExists('package.json')
return stageConfig.appUrls && script.fileExists('package.json')
}
2 changes: 1 addition & 1 deletion vars/loadPiper.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def call(Map parameters = [:]) {
Script script = parameters.script

// If you change the version please also update the version in build.gradle. They must always be at the same commit/tag/version.
String piperOsVersion = 'v1.54.0'
String piperOsVersion = 'v1.58.0'

String piperIdentifier = 'None'

Expand Down
12 changes: 0 additions & 12 deletions vars/runClosures.groovy

This file was deleted.

3 changes: 1 addition & 2 deletions vars/stageEndToEndTests.groovy
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import com.sap.cloud.sdk.s4hana.pipeline.QualityCheck
import com.sap.cloud.sdk.s4hana.pipeline.ReportAggregator
import com.sap.piper.ConfigurationLoader
import com.sap.cloud.sdk.s4hana.pipeline.EndToEndTestType

def call(Map parameters = [:]) {
def stageName = 'endToEndTests'
Expand All @@ -22,7 +21,7 @@ def call(Map parameters = [:]) {
script: script,
stage: stageName
)
executeEndToEndTest script: script, appUrls: stageConfiguration.appUrls, endToEndTestType: EndToEndTestType.END_TO_END_TEST, stage: stageName
npmExecuteEndToEndTests script: script, runScript: 'ci-e2e', stageName: stageName
ReportAggregator.instance.reportTestExecution(QualityCheck.EndToEndTests)
}
}
Expand Down
2 changes: 1 addition & 1 deletion vars/stageInitS4sdkPipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def call(Map parameters) {
deleteDir()
// The checkout has to happen outside of initS4sdkPipeline, in order for it to be extensible.
// (An extension to "initS4sdkPipeline" has to exist in the workspace before entering piperStageWrapper.)
checkoutAndInitLibrary(script: script, configFile: parameters.configFile, customDefaults: parameters.customDefaults)
checkoutAndInitLibrary(script: script, configFile: parameters.configFile, customDefaults: parameters.customDefaults, customDefaultsFromFiles: parameters.customDefaultsFromFiles)

stash allowEmpty: true, excludes: '', includes: '**', useDefaultExcludes: false, name: 'INIT'
script.commonPipelineEnvironment.configuration.stageStashes = [ initS4sdkPipeline: [ unstash : ["INIT"]]]
Expand Down
8 changes: 1 addition & 7 deletions vars/stageProductionDeployment.groovy
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import com.sap.cloud.sdk.s4hana.pipeline.ReportAggregator
import com.sap.piper.ConfigurationLoader
import com.sap.cloud.sdk.s4hana.pipeline.EndToEndTestType
import com.sap.cloud.sdk.s4hana.pipeline.BuildToolEnvironment

def call(Map parameters = [:]) {
Expand Down Expand Up @@ -44,12 +43,7 @@ def call(Map parameters = [:]) {
)
}
finally {
executeEndToEndTest(
script: script,
appUrls: stageConfiguration.appUrls,
endToEndTestType: EndToEndTestType.SMOKE_TEST,
stage: stageName
)
npmExecuteEndToEndTests script: script, runScript: 'ci-smoke', stageName: stageName
}
} else {
multicloudDeploy(
Expand Down

0 comments on commit 94dc66c

Please sign in to comment.