-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile.dc2.demo
45 lines (45 loc) · 2.43 KB
/
Jenkinsfile.dc2.demo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
pipeline {
agent any
triggers {
upstream(upstreamProjects: '../Demo jobs/3-tag-demo-stable-project', threshold: hudson.model.Result.SUCCESS)
}
options {
timeout(time: 30, unit: 'MINUTES')
timestamps()
}
environment {
HOME = "./"
CYPRESS_CREDENTIALS = credentials('temmpo-cypress-test-account')
NO_COLOR = 1
}
stages {
stage('Demo: Cypress tests') {
agent {
docker {
image 'cypress/included:13.17.0'
args '--add-host app-dc2-tmpo-d0.epi.bris.ac.uk:172.26.10.141 --entrypoint=""'
}
}
steps {
sh 'cypress run --browser chrome --config baseUrl=https://app-dc2-tmpo-d0.epi.bris.ac.uk'
}
post {
success {
mail bcc: '', body: "Please go to ${BUILD_URL} to review the output of the successful job.", cc: '', from: '', replyTo: '', subject: "${JOB_NAME} Jenkins pipeline was successful", to: '[email protected]'
}
failure {
archiveArtifacts artifacts: 'cypress/screenshots/**, cypress/videos/*', allowEmptyArchive: true, fingerprint: true
mail bcc: '', body: "Please go to ${BUILD_URL} to review the output of the failure. Go to ${RUN_ARTIFACTS_DISPLAY_URL} to view any artifacts, such as Cypress screenshots or videos.", cc: '', from: '', replyTo: '', subject: "${JOB_NAME} Jenkins pipeline failed", to: '[email protected]'
}
aborted {
archiveArtifacts artifacts: 'cypress/screenshots/**, cypress/videos/*', allowEmptyArchive: true, fingerprint: true
mail bcc: '', body: "Please go to ${BUILD_URL} to review the output of the aborted job.", cc: '', from: '', replyTo: '', subject: "${JOB_NAME} Jenkins pipeline was aborted", to: '[email protected]'
}
unsuccessful {
archiveArtifacts artifacts: 'cypress/screenshots/**, cypress/videos/*', allowEmptyArchive: true, fingerprint: true
mail bcc: '', body: "Please go to ${BUILD_URL} to review the output of the unsuccesful job.", cc: '', from: '', replyTo: '', subject: "${JOB_NAME} Jenkins pipeline was unsuccessful", to: '[email protected]'
}
}
}
}
}