added fn notify #14
|
|
@ -1,3 +1,24 @@
|
||||||
|
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 '{"context":"${context}","state": "${status}", "description": "${description}"}' \
|
||||||
|
${repositoryUrl}deployer3000/${repositoryName}/statuses/${commitHash}
|
||||||
|
"""
|
||||||
|
}
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
environment {
|
environment {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue