mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-12 10:55:20 +02:00
Streamline implementation githubPublishRelease (#1191)
This commit is contained in:
parent
1b6781c1e9
commit
fd76f721ea
@ -18,10 +18,6 @@ spec:
|
|||||||
- name: githubTokenCredentialsId
|
- name: githubTokenCredentialsId
|
||||||
description: Jenkins 'Secret text' credentials ID containing token to authenticate to GitHub.
|
description: Jenkins 'Secret text' credentials ID containing token to authenticate to GitHub.
|
||||||
type: jenkins
|
type: jenkins
|
||||||
resources:
|
|
||||||
- name: commonPipelineEnvironment
|
|
||||||
resourceSpec:
|
|
||||||
type: piperEnvironment
|
|
||||||
params:
|
params:
|
||||||
- name: addClosedIssues
|
- name: addClosedIssues
|
||||||
description: 'If set to `true`, closed issues and merged pull-requests since the last release will added below the `releaseBodyHeader`'
|
description: 'If set to `true`, closed issues and merged pull-requests since the last release will added below the `releaseBodyHeader`'
|
||||||
|
@ -61,6 +61,6 @@ class GithubPublishReleaseTest extends BasePiperTest {
|
|||||||
// asserts
|
// asserts
|
||||||
assertThat(writeFileRule.files['metadata/githubrelease.yaml'], containsString('name: githubPublishRelease'))
|
assertThat(writeFileRule.files['metadata/githubrelease.yaml'], containsString('name: githubPublishRelease'))
|
||||||
assertThat(withEnvArgs[0], allOf(startsWith('PIPER_parametersJSON'), containsString('"testParam":"This is test content"')))
|
assertThat(withEnvArgs[0], allOf(startsWith('PIPER_parametersJSON'), containsString('"testParam":"This is test content"')))
|
||||||
assertThat(shellCallRule.shell[1], is('./piper githubPublishRelease --token thisIsATestToken'))
|
assertThat(shellCallRule.shell[1], is('./piper githubPublishRelease'))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,8 +34,8 @@ void call(Map parameters = [:]) {
|
|||||||
config = readJSON (text: sh(returnStdout: true, script: "./piper getConfig --contextConfig --stepMetadata '${METADATA_FILE}'"))
|
config = readJSON (text: sh(returnStdout: true, script: "./piper getConfig --contextConfig --stepMetadata '${METADATA_FILE}'"))
|
||||||
|
|
||||||
// execute step
|
// execute step
|
||||||
withCredentials([string(credentialsId: config.githubTokenCredentialsId, variable: 'TOKEN')]) {
|
withCredentials([string(credentialsId: config.githubTokenCredentialsId, variable: 'PIPER_token')]) {
|
||||||
sh "./piper githubPublishRelease --token ${TOKEN}"
|
sh './piper githubPublishRelease'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user