-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
72 lines (68 loc) · 3.05 KB
/
Jenkinsfile
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
pipeline {
agent none
stages {
stage('cypress parallel tests'){
parallel {
stage('tester A') {
agent {
docker {
image 'cypress/browsers:node12.4.0-chrome76'
//label 'tester A'
args '-u root:sudo'
}
}
steps {
sh 'pwd'
sh 'ls -al'
sh 'whoami'
sh 'npm install --save-dev cypress'
sh './node_modules/.bin/cypress run --spec "cypress/integration/justlog.js" --env host=DevLab'
}
}
stage('tester B') {
agent {
docker {
image 'cypress/browsers:node12.4.0-chrome76'
//label 'tester B'
args '-u root:sudo'
}
}
steps {
sh 'npm install --save-dev cypress'
sh './node_modules/.bin/cypress run --spec "cypress/integration/kk.js" --env host=TestLab'
}
}
}
}
}
post {
always {
//junit 'results/cypress-report-*.xml'
//sh 'rm results/*'
echo 'Build finished'
}
success {
echo 'Build finished successfully'
}
failure {
emailext body: "<b>Project: ${env.JOB_NAME} </b><br>Build Number: ${env.BUILD_NUMBER} <br> URL of build: ${env.BUILD_URL}",
mimeType: 'text/html',
subject: "ERROR CI: Project name -> ${env.JOB_NAME}",
recipientProviders: [developers()]
}
unstable {
emailext body: "<b>Project: ${env.JOB_NAME} </b><br>Build Number: ${env.BUILD_NUMBER} <br> URL of build: ${env.BUILD_URL}",
mimeType: 'text/html',
subject: "Unstable Build: Project name -> ${env.JOB_NAME}",
recipientProviders: [developers()]
}
changed {
// This will run only if the state of the Pipeline has changed
//For example, if the Pipeline was previously failing but is now successful
emailext body: "<b>Project: ${env.JOB_NAME} </b><br>Build Number: ${env.BUILD_NUMBER} <br>URL of build: ${env.BUILD_URL} <br>Build result is: ${currentBuild.result}",
mimeType: 'text/html',
subject: "Build state has changed: Project name -> ${env.JOB_NAME}",
recipientProviders: [developers()]
}
}
}