-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
68 lines (68 loc) · 2.23 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
pipeline {
agent {
node {
label '!master'
}
}
options {
buildDiscarder(logRotator(numToKeepStr: '15', artifactNumToKeepStr: '15'))
disableConcurrentBuilds()
}
environment {
PATH = "/usr/local/bin:$PATH"
}
stages {
stage('Deploy functional test ') {
agent none
steps {
build job: "OpenLMIS-3.x-deploy-to-functional-test", propagate: true, wait: true
}
}
stage ('build') {
steps {
dir('.openlmis-config') {
git branch: 'master',
credentialsId: 'OpenLMISConfigKey',
url: '[email protected]:villagereach/openlmis-config.git'
}
sh( script: "./ci-runTest.sh")
archiveArtifacts 'build/openlmis.har*,build/errorShots/**,build/WDIO*.xml,build/recordings/**,build/consolelogs/**,build/performanceResults/**'
}
post {
always {
junit 'build/WDIO*.xml'
publishHTML([
allowMissing: false,
alwaysLinkToLastBuild: true,
includes: '**/*.html,**/*.css,**/*.js',
keepAll: true,
reportDir: 'build/performanceResults/',
reportFiles: 'StepPerformanceResults.html',
reportName: 'Performance Report',
reportTitles: ''
])
}
cleanup {
sh 'docker pull openlmis/stop-instance'
sh 'docker run --rm --env-file ./.openlmis-config/functional-test.env openlmis/stop-instance'
sh 'rm -Rf .openlmis-config'
}
}
}
}
post {
unstable {
slackSend channel: '#build',
color: 'danger',
message: "${env.JOB_NAME} - #${env.BUILD_NUMBER} FAILED (<${env.BUILD_URL}|Open>)"
emailext subject: "${env.JOB_NAME} - #${env.BUILD_NUMBER} ${env.STAGE_NAME} FAILED",
body: """<p>${env.JOB_NAME} - #${env.BUILD_NUMBER} ${env.STAGE_NAME} FAILED</p><p>Check console <a href="${env.BUILD_URL}">output</a> to view the results.</p>""",
recipientProviders: [[$class: 'CulpritsRecipientProvider'], [$class: 'DevelopersRecipientProvider']]
}
fixed {
slackSend channel: '#build',
color: 'good',
message: "${env.JOB_NAME} - #${env.BUILD_NUMBER} Back to normal"
}
}
}