This repository has been archived by the owner on Feb 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Jenkinsfile
80 lines (68 loc) · 2.21 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
#!/usr/bin/env groovy
pipeline {
agent any
options {
// Discarter après 10 builds
buildDiscarder(logRotator(numToKeepStr: '10'))
// Ajouter les timestamps dans le log
timestamps()
}
environment {
// Pour éviter une erreur: EACCES: permission denied, mkdir '/.npm'
npm_config_cache = 'npm-cache'
DOCKER_REPOSITORY = 'docker-local.maven.at.ulaval.ca/modul'
DOCKER_REPOSITORY_URL = 'https://docker-local.maven.at.ulaval.ca'
}
stages {
stage('Build') {
when {
expression {
env.BRANCH_NAME=='master' || env.BRANCH_NAME=='develop'
}
}
agent {
docker {
image 'node:9.4.0'
}
}
steps {
sh 'npm ci'
sh 'npm run buildWebpack'
// Probablement une étape de publish ici.
}
}
}
stages {
stage('Test') {
when {
expression {
env.BRANCH_NAME=='master' || env.BRANCH_NAME=='develop'
}
}
agent {
docker {
image 'node:9.4.0'
}
}
steps {
sh 'npm ci'
sh 'npm run buildWebpack'
sh 'npm run test'
}
}
}
post {
changed {
echo 'Build status changed'
step([$class: 'Mailer', recipients: ['martin.simard@dti.ulaval.ca', emailextrecipients([[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']])].join(' ')])
}
failure {
echo 'Build failure'
step([$class: 'Mailer', recipients: ['martin.simard@dti.ulaval.ca', emailextrecipients([[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']])].join(' ')])
}
unstable {
echo 'Build unstable'
step([$class: 'Mailer', recipients: ['martin.simard@dti.ulaval.ca', emailextrecipients([[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']])].join(' ')])
}
}
}