getenv
test-org/trust-module-frontend/pipeline/pr-rc This commit looks good Details

test
yuobrezkov 2025-03-10 16:58:38 +03:00
parent 231bc84ccc
commit 906fc5aae2
1 changed files with 13 additions and 4 deletions

17
Jenkinsfile vendored
View File

@ -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()
}
}