This repository has been archived by the owner on Jan 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Jenkinsfile
64 lines (51 loc) · 1.73 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
#!/usr/bin/env groovy
pipeline {
agent any
environment {
DOCKER_REPOSITORY = 'docker-local.maven.at.ulaval.ca/modul'
DOCKER_REPOSITORY_URL = 'https://docker-local.maven.at.ulaval.ca'
}
options {
// Discarter après 10 builds
buildDiscarder(logRotator(numToKeepStr: '10'))
// Ajouter les timestamps dans le log
timestamps()
}
stages {
stage('install, build, lint & test') {
agent {
docker {
image 'node:14'
}
}
when {
expression {
env.BRANCH_NAME=='master' || env.BRANCH_NAME=='develop'
}
}
steps {
sh 'yarn install --frozen-lockfile'
sh 'yarn build'
sh 'yarn lint:ci'
sh 'yarn test:ci'
}
}
}
post {
always {
cleanWs()
}
changed {
echo 'Build status changed'
step([$class: 'Mailer', recipients: ['charles.maheu@dti.ulaval.ca', emailextrecipients([[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']])].join(' ')])
}
failure {
echo 'Build failure'
step([$class: 'Mailer', recipients: ['charles.maheu@dti.ulaval.ca', emailextrecipients([[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']])].join(' ')])
}
unstable {
echo 'Build unstable'
step([$class: 'Mailer', recipients: ['charles.maheu@dti.ulaval.ca', emailextrecipients([[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']])].join(' ')])
}
}
}