getenv
test-org/trust-module-frontend/pipeline/pr-rc This commit looks good
Details
test-org/trust-module-frontend/pipeline/pr-rc This commit looks good
Details
parent
231bc84ccc
commit
906fc5aae2
|
|
@ -1,13 +1,21 @@
|
|||
def notify(String giteaUser, String giteaPass, String repositoryUrl, String repositoryName, String prId, String buildStatus) {
|
||||
def notify(
|
||||
String context,
|
||||
String giteaUser,
|
||||
String giteaPass,
|
||||
String repositoryUrl,
|
||||
String repositoryName,
|
||||
String commitHash,
|
||||
String buildStatus
|
||||
) {
|
||||
def status = buildStatus == 'success' ? 'success' : 'failure'
|
||||
def description = buildStatus == 'success' ? 'Build succeeded' : 'Build failed'
|
||||
|
||||
|
||||
sh """
|
||||
curl -X POST \
|
||||
-u "${giteaUser}:${giteaPass}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"state": "${status}", "description": "${description}", "context": "ci/jenkins"}' \
|
||||
${repositoryUrl}/api/v1/repos/${repositoryName}/statuses/${prId}
|
||||
-d '{"context":"${context}","state": "${status}", "description": "${description}"}' \
|
||||
${repositoryUrl}${repositoryName}/statuses/${commitHash}
|
||||
"""
|
||||
}
|
||||
|
||||
|
|
@ -22,6 +30,7 @@ pipeline {
|
|||
stage ('Initialize variables') {
|
||||
steps {
|
||||
script {
|
||||
echo sh(script: 'env|sort', returnStdout: true)
|
||||
env.IMAGE_TAG = sh(script: "git describe --tags --abbrev=0", returnStdout: true).trim()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue