This repository has been archived by the owner on Jan 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 63
/
Jenkinsfile
65 lines (57 loc) · 1.82 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
pipeline {
agent any
options { disableConcurrentBuilds() }
environment {
PROJECTNAME = "myscriptjs ${env.BRANCH_NAME}"
PROJECTHOME = '/tmp/myscriptjs'
SELENIUM_ENV = 'chrome'
PROJECT_DIR= "${WORKSPACE.replace('/var/jenkins_home/workspace','/dockervolumes/cloud/master/jenkins/workspace')}"
APPLICATION_KEY = credentials('APPLICATION_KEY')
HMAC_KEY = credentials('HMAC_KEY')
MAKE_ARGS=" PROJECT_DIR=${env.PROJECT_DIR} HOME=${env.PROJECTHOME} SELENIUM_ENV=${env.SELENIUM_ENV} BUILDID=${env.BUILD_NUMBER} DEV_APPLICATIONKEY=${env.APPLICATION_KEY} DEV_HMACKEY=${env.HMAC_KEY} "
}
stages {
stage ('purge'){
steps {
sh "make ${env.MAKE_ARGS} purge"
}
}
stage ('prepare'){
steps {
sh "make ${env.MAKE_ARGS} prepare"
}
}
stage ('docker'){
steps {
sh "make ${env.MAKE_ARGS} docker"
}
}
stage ('test'){
steps {
sh "make ${env.MAKE_ARGS} test"
}
}
stage ('audit'){
steps {
sh "npm audit"
}
}
}
post {
always {
sh "make ${env.MAKE_ARGS} killdocker"
}
success {
slackSend color: "good", message: "${env.PROJECTNAME}: Build success ${env.JOB_NAME} ${env.BUILD_NUMBER}."
}
unstable {
slackSend color: "warning", message: "${env.PROJECTNAME}: Unstable build, ${currentBuild.fullDisplayName} is unstable"
}
failure {
slackSend color: "danger", message: "@group ${env.PROJECTNAME}: FAILURE, ${currentBuild.fullDisplayName} failed see there ${env.BUILD_URL}"
}
/* changed {
slackSend color: "good", message: "${env.PROJECTNAME}: Build changed"
}*/
}
}