-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
75 lines (69 loc) · 1.66 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
pipeline {
agent none
triggers {
cron('H * * * *')
}
options {
timestamps()
timeout(10)
}
stages {
stage('Build') {
agent {
docker {
image 'epitechcontent/epitest-docker'
}
}
steps {
timeout(time: 60) {
sh 'make fclean'
sh 'make'
sh 'make clean'
sh 'make re && make fclean'
sh 'make plazza && make fclean'
sh 'make all && make fclean'
}
}
}
stage('Tests') {
agent {
docker {
image 'epitechcontent/epitest-docker'
}
}
steps {
sh 'mkdir coverage_build'
retry(count: 3) {
timeout(time: 60) {
sh 'make tests_run'
}
}
sh 'gcovr -x > coverage_build/coverage.xml'
cobertura coberturaReportFile: 'coverage_build/coverage.xml', conditionalCoverageTargets: '70, 0, 0', failNoReports: false, failUnhealthy: false, failUnstable: false, lineCoverageTargets: '80, 0, 0', maxNumberOfBuilds: 10, methodCoverageTargets: '80, 0, 0', onlyStable: false, sourceEncoding: 'ASCII'
junit 'report/*.xml'
}
}
stage('Deploy') {
agent any
when {
anyOf {
branch 'master'
branch 'dev'
}
allOf {
not {
changeRequest()
}
not {
triggeredBy('TimerTrigger')
}
}
}
steps {
sshagent (credentials: ['epitech-global']) {
sh "git push git@git.epitech.eu:/florent.poinsard@epitech.eu/CCP_plazza_2018 --force ${env.BRANCH_NAME}:${env.BRANCH_NAME}"
}
}
}
}
}