Skip to content

Commit

Permalink
[jenkins] add pipeline for hourly security solution cypress tests (#7…
Browse files Browse the repository at this point in the history
…5087) (#75110)

* [jenkins] add pipeline for hourly security solution cypress tests

* support customizing email for status emails

* apply review feedback

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 15, 2020
1 parent 7f5b9a4 commit 7d6525e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
21 changes: 21 additions & 0 deletions .ci/Jenkinsfile_security_cypress
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/groovy

library 'kibana-pipeline-library'
kibanaLibrary.load()

kibanaPipeline(timeoutMinutes: 180) {
slackNotifications.onFailure(
disabled: !params.NOTIFY_ON_FAILURE,
channel: '#security-solution-slack-testing'
) {
catchError {
workers.base(size: 's', ramDisk: false) {
kibanaPipeline.bash('test/scripts/jenkins_security_solution_cypress.sh', 'Execute Security Solution Cypress Tests')
}
}
}

if (params.NOTIFY_ON_FAILURE) {
kibanaPipeline.sendMail(to: 'gloria.delatorre@elastic.co')
}
}
10 changes: 6 additions & 4 deletions vars/kibanaPipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def publishJunit() {
}
}

def sendMail() {
def sendMail(Map params = [:]) {
// If the build doesn't have a result set by this point, there haven't been any errors and it can be marked as a success
// The e-mail plugin for the infra e-mail depends upon this being set
currentBuild.result = currentBuild.result ?: 'SUCCESS'
Expand All @@ -212,7 +212,7 @@ def sendMail() {
if (buildStatus != 'SUCCESS' && buildStatus != 'ABORTED') {
node('flyweight') {
sendInfraMail()
sendKibanaMail()
sendKibanaMail(params)
}
}
}
Expand All @@ -228,12 +228,14 @@ def sendInfraMail() {
}
}

def sendKibanaMail() {
def sendKibanaMail(Map params = [:]) {
def config = [to: 'build-kibana@elastic.co'] + params

catchErrors {
def buildStatus = buildUtils.getBuildStatus()
if(params.NOTIFY_ON_FAILURE && buildStatus != 'SUCCESS' && buildStatus != 'ABORTED') {
emailext(
to: 'build-kibana@elastic.co',
config.to,
subject: "${env.JOB_NAME} - Build # ${env.BUILD_NUMBER} - ${buildStatus}",
body: '${SCRIPT,template="groovy-html.template"}',
mimeType: 'text/html',
Expand Down

0 comments on commit 7d6525e

Please sign in to comment.