Build status of null means success.
buildStatus = buildStatus ?: 'SUCCESS'
def color
if (buildStatus == 'STARTED') {
color = '#D4DADF'
} else if (buildStatus == 'SUCCESS') {
color = '#00c117'
} else if (buildStatus == 'UNSTABLE') {
color = '#FFFE89'
} else {
color = '#FF9FA1'
}
def USER = wrap([$class: 'BuildUser']) {
return env.BUILD_USER
}
def msg = "${buildStatus}: `${JOB_NAME}` #${BUILD_NUMBER};\nProduct name - ${GERRIT_PROJECT_NAME};\nversion ${vars.appVersion};\nNamespace - ${NAMESPACE};\nby user - ${USER}:\nUrl job - ${BUILD_URL}"
slackSend(color: color, message: msg)
}
так делал
спасибо, сейчас попробую
Обсуждают сегодня