This repository has been archived by the owner on Jan 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Jenkinsfile
126 lines (109 loc) · 3.47 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
def debianBuildDockerImage
String dockerArgs = '-v /var/run/docker.sock:/var/run/docker.sock --userns host --privileged -v $HOME:$HOME -e "HOME=${HOME}'
pipeline {
agent { label "docker" }
options { disableConcurrentBuilds() }
environment {
PROJECTNAME = "iink-js ${env.BRANCH_NAME}"
PROJECTHOME = '/tmp/iink-js'
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} BUILDID=${env.BUILD_NUMBER} DEV_APPLICATIONKEY=${env.APPLICATION_KEY} DEV_HMACKEY=${env.HMAC_KEY} "
}
stages {
stage('Build docker builder') {
steps {
script {
debianBuildDockerImage = docker.build("iink-js.debian-builder:${env.BUILD_ID}", '-f ./docker/builder/Dockerfile ./')
}
}
}
stage ('purge'){
steps {
script {
debianBuildDockerImage.inside(dockerArgs) {
sh "make ${env.MAKE_ARGS} purge"
}
}
}
}
stage ('prepare'){
steps {
script {
debianBuildDockerImage.inside(dockerArgs) {
sh "make ${env.MAKE_ARGS} prepare"
sh "make ${env.MAKE_ARGS} docker-wait-tcp"
}
}
}
}
stage ('init_examples'){
steps {
script {
debianBuildDockerImage.inside(dockerArgs) {
sh "make ${env.MAKE_ARGS} docker-examples init_examples"
}
}
}
}
stage('test browser with legacy server') {
failFast false
parallel {
stage ('test-chromium'){
steps {
script {
debianBuildDockerImage.inside(dockerArgs) {
sh "BROWSER=chromium make ${env.MAKE_ARGS} test-e2e"
}
}
}
}
stage ('test-webkit'){
steps {
script {
debianBuildDockerImage.inside(dockerArgs) {
sh "BROWSER=webkit make ${env.MAKE_ARGS} test-e2e"
}
}
}
}
stage ('test-firefox'){
steps {
script {
debianBuildDockerImage.inside(dockerArgs) {
sh "BROWSER=firefox make ${env.MAKE_ARGS} test-e2e"
}
}
}
}
}
}
stage ('audit'){
steps {
script {
debianBuildDockerImage.inside(dockerArgs) {
sh "npm audit --production"
}
}
}
}
}
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"
}*/
}
}