fix(argo): invalid env ref for ArgoApplicationVersionUpdater
Signed-off-by: zhenyus <zhenyus@mathmast.com>
This commit is contained in:
parent
e1bdb89ce6
commit
de0a70d682
@ -25,28 +25,19 @@ class SemanticReleasingExecutor {
|
||||
|
||||
steps.dir(steps.env.workroot) {
|
||||
steps.withCredentials([steps.usernamePassword(credentialsId: credentialsId, passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) {
|
||||
steps.env.GIT_CREDENTIALS = "${steps.env.GIT_USERNAME}:${steps.env.GIT_PASSWORD}"-
|
||||
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"
|
||||
steps.log.warn("SemanticReleasingExecutor", "Setting up git credentials, execute workaround for semantic-release integrate with Azure DevOps")
|
||||
// TODO: This should be supported by semantic-release itself, not a workaround here
|
||||
steps.sh "git config --global http.extraheader \"AUTHORIZATION: Bearer ${steps.env.GIT_PASSWORD}\""
|
||||
steps.writeFile file: '.releaserc.json', text: steps.libraryResource(config)
|
||||
steps.log.info("SemanticReleasingExecutor", "Installing semantic-release plugins...")
|
||||
steps.sh "npm install -g ${plugins.join(' ')}"
|
||||
steps.sh "git config --global --add safe.directory ${steps.env.workroot}"
|
||||
// TODO: Workaround for semantic-release not committing changes
|
||||
steps.sh "git config user.name \"freeleaps-gitops-bot\""
|
||||
steps.sh "git config user.email \"gitops@mathmast.com\""
|
||||
steps.sh "semantic-release --debug --no-ci"
|
||||
steps.sh "semantic-release --debug"
|
||||
steps.log.info("SemanticReleasingExecutor", "Semantic release completed, read latest version from VERSION file")
|
||||
def released = steps.sh(script: 'test -f "VERSION"', returnStatus: true) == 0
|
||||
if (released) {
|
||||
steps.env.LATEST_VERSION = steps.readFile('VERSION').trim()
|
||||
steps.env.SEMANTIC_RELEASED = true
|
||||
// TODO: Workaround for semantic-release not committing changes
|
||||
def repoUrl = steps.sh(script: 'git config --get remote.origin.url', returnStdout: true).trim()
|
||||
steps.sh "git remote add ci_origin ${repoUrl}"
|
||||
steps.sh "git push ci_origin HEAD:master"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user