Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ pipeline {
PIPELINE_LOG_LEVEL = 'INFO'
SUFFIX_ARN_FILE = 'arn-file.md'
ELASTIC_LAYER_NAME = 'apm-lambda-extension'
RELEASE_URL_MESSAGE = "(<https://github.com/elastic/${env.REPO}/releases/tag/${env.TAG_NAME}|${env.TAG_NAME}>)"
SLACK_CHANNEL = '#apm-serverless'
NOTIFY_TO = '[email protected]'
Comment on lines +13 to +15
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a similar approach done in some other APM Agents.

}
options {
timeout(time: 1, unit: 'HOURS')
Expand All @@ -27,6 +30,9 @@ pipeline {
stages {
stage('Checkout') {
steps {
whenTrue(isTag()) {
notifyStatus(slackStatus: 'good', subject: "[${env.REPO}] Release tag *${env.TAG_NAME}* has been created", body: "Build: (<${env.RUN_DISPLAY_URL}|here>) for further details.")
}
deleteDir()
gitCheckout(basedir: "${BASE_DIR}")
stash allowEmpty: true, name: 'source', useDefaultExcludes: false
Expand Down Expand Up @@ -169,5 +175,24 @@ pipeline {
cleanup {
notifyBuildResult(prComment: true)
}
success {
whenTrue(isTag()) {
notifyStatus(slackStatus: 'good', subject: "[${env.REPO}] Release *${env.TAG_NAME}* published", body: "Build: (<${env.RUN_DISPLAY_URL}|here>)\nRelease URL: ${env.RELEASE_URL_MESSAGE}")
}
}
unsuccessful {
whenTrue(isTag()) {
notifyStatus(slackStatus: 'warning', subject: "[${env.REPO}] Release *${env.TAG_NAME}* could not be published.", body: "Build: (<${env.RUN_DISPLAY_URL}|here>)")
}
}
}
}

def notifyStatus(def args = [:]) {
releaseNotification(slackChannel: "${env.SLACK_CHANNEL}",
slackColor: args.slackStatus,
slackCredentialsId: 'jenkins-slack-integration-token',
to: "${env.NOTIFY_TO}",
subject: args.subject,
body: args.body)
}