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,4 +1,12 @@
|
||||||
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 status = buildStatus == 'success' ? 'success' : 'failure'
|
||||||
def description = buildStatus == 'success' ? 'Build succeeded' : 'Build failed'
|
def description = buildStatus == 'success' ? 'Build succeeded' : 'Build failed'
|
||||||
|
|
||||||
|
|
@ -6,8 +14,8 @@ def notify(String giteaUser, String giteaPass, String repositoryUrl, String repo
|
||||||
curl -X POST \
|
curl -X POST \
|
||||||
-u "${giteaUser}:${giteaPass}" \
|
-u "${giteaUser}:${giteaPass}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d '{"state": "${status}", "description": "${description}", "context": "ci/jenkins"}' \
|
-d '{"context":"${context}","state": "${status}", "description": "${description}"}' \
|
||||||
${repositoryUrl}/api/v1/repos/${repositoryName}/statuses/${prId}
|
${repositoryUrl}${repositoryName}/statuses/${commitHash}
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -22,6 +30,7 @@ pipeline {
|
||||||
stage ('Initialize variables') {
|
stage ('Initialize variables') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
|
echo sh(script: 'env|sort', returnStdout: true)
|
||||||
env.IMAGE_TAG = sh(script: "git describe --tags --abbrev=0", returnStdout: true).trim()
|
env.IMAGE_TAG = sh(script: "git describe --tags --abbrev=0", returnStdout: true).trim()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue