Skip to content

Commit

Permalink
Changes to commonPipelineEnvironment for ABAP (#2035)
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielMieg authored Sep 17, 2020
1 parent 485faed commit 836075e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 22 deletions.
17 changes: 6 additions & 11 deletions cmd/abapEnvironmentCloneGitRepo_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions resources/metadata/abapEnvironmentCloneGitRepo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ spec:
- PARAMETERS
- STAGES
- STEPS
resourceRef:
- name: commonPipelineEnvironment
param: abap/repositories
- name: repositoryName
type: string
description: Specifies a repository (Software Components) on the SAP Cloud Platform ABAP Environment system
Expand Down
10 changes: 5 additions & 5 deletions test/groovy/CommonPipelineEnvironmentTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ class CommonPipelineEnvironmentTest extends BasePiperTest {
nullScript.commonPipelineEnvironment.originalArtifactVersion = '2.0.0'
nullScript.commonPipelineEnvironment.setContainerProperty('image', 'myImage')
nullScript.commonPipelineEnvironment.setValue('custom1', 'customVal1')
nullScript.commonPipelineEnvironment.setAbapRepositoryNames('[\"value1\",\"value2\"]')
nullScript.commonPipelineEnvironment.setAbapAddonDescriptor('[\"value1\",\"value2\"]')
nullScript.commonPipelineEnvironment.writeToDisk(nullScript)


assertThat(writeFileRule.files['.pipeline/commonPipelineEnvironment/artifactVersion'], is('1.0.0'))
assertThat(writeFileRule.files['.pipeline/commonPipelineEnvironment/originalArtifactVersion'], is('2.0.0'))
assertThat(writeFileRule.files['.pipeline/commonPipelineEnvironment/container/image'], is('myImage'))
assertThat(writeFileRule.files['.pipeline/commonPipelineEnvironment/custom/custom1'], is('customVal1'))
assertThat(writeFileRule.files['.pipeline/commonPipelineEnvironment/abap/repositoryNames'], is('[\"value1\",\"value2\"]'))
assertThat(writeFileRule.files['.pipeline/commonPipelineEnvironment/abap/addonDescriptor'], is('[\"value1\",\"value2\"]'))
}

@Test
Expand All @@ -81,7 +81,7 @@ class CommonPipelineEnvironmentTest extends BasePiperTest {
'.pipeline/commonPipelineEnvironment/artifactVersion',
'.pipeline/commonPipelineEnvironment/originalArtifactVersion',
'.pipeline/commonPipelineEnvironment/custom/custom1',
'.pipeline/commonPipelineEnvironment/abap/repositoryNames',
'.pipeline/commonPipelineEnvironment/abap/addonDescriptor',
])

nullScript.metaClass.findFiles {
Expand All @@ -97,15 +97,15 @@ class CommonPipelineEnvironmentTest extends BasePiperTest {
'.pipeline/commonPipelineEnvironment/artifactVersion': '1.0.0',
'.pipeline/commonPipelineEnvironment/originalArtifactVersion': '2.0.0',
'.pipeline/commonPipelineEnvironment/custom': 'customVal1',
'.pipeline/commonPipelineEnvironment/abap/repositoryNames': '[\"value1\",\"value2\"]',
'.pipeline/commonPipelineEnvironment/abap/addonDescriptor': '[\"value1\",\"value2\"]',
])

nullScript.commonPipelineEnvironment.readFromDisk(nullScript)

assertThat(nullScript.commonPipelineEnvironment.artifactVersion, is('1.0.0'))
assertThat(nullScript.commonPipelineEnvironment.originalArtifactVersion, is('2.0.0'))
assertThat(nullScript.commonPipelineEnvironment.valueMap['custom1'], is('customVal1'))
assertThat(nullScript.commonPipelineEnvironment.abapRepositoryNames, is("[\"value1\",\"value2\"]"))
assertThat(nullScript.commonPipelineEnvironment.abapAddonDescriptor, is("[\"value1\",\"value2\"]"))
}

}
6 changes: 3 additions & 3 deletions vars/commonPipelineEnvironment.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class commonPipelineEnvironment implements Serializable {

String mtarFilePath = ""

String abapRepositoryNames
String abapAddonDescriptor

private Map valueMap = [:]

Expand All @@ -63,7 +63,7 @@ class commonPipelineEnvironment implements Serializable {

projectName = null

abapRepositoryNames = null
abapAddonDescriptor = null

appContainerProperties = [:]
artifactVersion = null
Expand Down Expand Up @@ -188,7 +188,7 @@ class commonPipelineEnvironment implements Serializable {
[filename: '.pipeline/commonPipelineEnvironment/git/commitId', property: 'gitCommitId'],
[filename: '.pipeline/commonPipelineEnvironment/git/commitMessage', property: 'gitCommitMessage'],
[filename: '.pipeline/commonPipelineEnvironment/mtarFilePath', property: 'mtarFilePath'],
[filename: '.pipeline/commonPipelineEnvironment/abap/repositoryNames', property: 'abapRepositoryNames'],
[filename: '.pipeline/commonPipelineEnvironment/abap/addonDescriptor', property: 'abapAddonDescriptor'],
]

void writeToDisk(script) {
Expand Down

0 comments on commit 836075e

Please sign in to comment.