diff --git a/bundle-workflow/Jenkinsfile b/bundle-workflow/Jenkinsfile index 8bf3823b42..a0a00f4a0a 100644 --- a/bundle-workflow/Jenkinsfile +++ b/bundle-workflow/Jenkinsfile @@ -24,6 +24,11 @@ pipeline { } } stage('build') { + agent { + node { + label 'Jenkins-Agent-al2-x64-m5xlarge' + } + } stages { stage('build-snapshots') { environment { @@ -87,6 +92,14 @@ pipeline { } } } + post() { + success { + publishNotification(":white_check-mark:", "Successful Build") + } + failure { + publishNotification(":warning:", "Failed Build") + } + } } } } @@ -102,4 +115,10 @@ void build() { s3Upload(file: 'artifacts', bucket: "${ARTIFACT_BUCKET_NAME}", path: "builds/${manifest.build.version}/${OPENSEARCH_BUILD_ID}/${manifest.build.architecture}") s3Upload(file: "bundle", bucket: "${ARTIFACT_BUCKET_NAME}", path: "bundles/${manifest.build.version}/${OPENSEARCH_BUILD_ID}/${manifest.build.architecture}") } -} \ No newline at end of file +} + +void publishNotification(icon, msg) { + withCredentials([string(credentialsId: 'BUILD_NOTICE_WEBHOOK', variable: 'TOKEN')]) { + sh """curl -XPOST --header "Content-Type: application/json" --data '{"result_text": "$icon ${env.JOB_NAME} [${env.BUILD_NUMBER}] $msg ${env.BUILD_URL}\nManifest: ${BUILD_MANIFEST}"}' $TOKEN""" + } +}