-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathJenkinsfile.tests
More file actions
56 lines (56 loc) · 1.36 KB
/
Jenkinsfile.tests
File metadata and controls
56 lines (56 loc) · 1.36 KB
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
pipeline {
agent any
stages {
stage('Init') {
steps {
/* FIXME(sileht): Put this in Jenkins lib to be able to load it in all projects
script {
def common = load("ci/Jenkinsfile.common")
common.cancelPreviousBuilds()
}
*/
sh 'printenv | sort'
}
}
stage('Test and build') {
steps {
script {
def img = docker.image('node:18.18.2')
img.pull()
img.inside() {
sh 'node --version'
sh 'yarn --version'
sh 'yarn'
/* sh 'CI=True yarn test' */
sh 'yarn build'
}
}
}
}
}
post {
always {
cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, cleanupMatrixParent: true, deleteDirs: true)
}
success {
catchError {
rocketSend(channel: 'build', message: 'Build succeed' ,color: 'green' )
}
}
aborted {
catchError {
rocketSend(channel: 'build', message: 'Build superseded or aborted')
}
}
unstable {
catchError {
rocketSend(channel: 'build', message: 'Build failed', color: 'red')
}
}
failure {
catchError {
rocketSend(channel: 'build', message: 'Build failed', color: 'red')
}
}
}
}