feat(pipeline): add credentials support for semantic release in SemanticReleasingExecutor
Signed-off-by: 孙振宇 <>
This commit is contained in:
parent
80dd57433c
commit
d8f04dda6d
@ -19,11 +19,13 @@ class SemanticReleasingExecutor {
|
||||
this.config = 'com/freeleaps/devops/builtins/semantic-release/releaserc.json'
|
||||
}
|
||||
|
||||
def release() {
|
||||
def release(credentialsId) {
|
||||
steps.log.warn("SemanticReleasingExecutor", "Configuration file customization is not supported yet, using builtin release rules as fallback")
|
||||
steps.log.info("SemanticReleasingExecutor", "Releasing with config: ${config}")
|
||||
|
||||
steps.dir(steps.env.workroot) {
|
||||
steps.withCredentials(credentialsId: credentialsId, passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME') {
|
||||
steps.env.GIT_CREDENTIALS = "${steps.env.GIT_USERNAME}:${steps.env.GIT_PASSWORD}"
|
||||
steps.writeFile file: 'releaserc.json', text: steps.libraryResource(config)
|
||||
steps.log.info("SemanticReleasingExecutor", "Installing semantic-release requirements...")
|
||||
steps.sh "apt-get -y update && apt-get install -y --no-install-recommends git apt-transport-https ca-certificates curl wget gnupg"
|
||||
@ -34,4 +36,5 @@ class SemanticReleasingExecutor {
|
||||
steps.env.LATEST_VERSION = steps.readFile('VERSION').trim()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -265,7 +265,7 @@ def generateComponentStages(component, configurations) {
|
||||
def sourceFetcher = new SourceFetcher(this)
|
||||
sourceFetcher.fetch(configurations)
|
||||
|
||||
def semanticReleasingExecutor = new SemanticReleasingExecutor(this, env.workroot + "/" + component.root + "/")
|
||||
def semanticReleasingExecutor = new SemanticReleasingExecutor(this, env.workroot)
|
||||
semanticReleasingExecutor.release()
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user