forked from andreamouraud/gotenberg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
60 lines (52 loc) · 1.43 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
// This Jenkinsfile is dedicated to the jenkins job: MEP Shaun
// cf: https://jenkins.toucantoco.guru/job/Build%20Gotenberg/
//
// The aim of this job is to build a toucan image of the gotenberg project
//
@Library('toucan-jenkins-lib')_
import com.toucantoco.ToucanVars
pipeline {
agent any
options {
// Keep 30 builds
buildDiscarder(logRotator(numToKeepStr: '30'))
// Stop pipeline if any stage is unstable
skipStagesAfterUnstable()
// Avoid concurrent job
disableConcurrentBuilds()
// Enable color in logs
ansiColor('gnome-terminal')
}
parameters {
string(
defaultValue: "7.7.0",
description: 'choose image version',
name: 'GOTENBERG_VERSION'
)
}
stages {
stage('Build and push image') {
steps {
storeStage()
sh """
source ${ToucanVars.JENKINS_SOURCE_SCRIPT}
make build GOTENBERG_VERSION=${params.GOTENBERG_VERSION}
make toucan-docker-tag GOTENBERG_VERSION=${params.GOTENBERG_VERSION}
make toucan-docker-push GOTENBERG_VERSION=${params.GOTENBERG_VERSION}
"""
}
}
}
post {
failure {
postSlackNotif(channel: 'jenkins')
}
cleanup {
deleteDir()
}
always {
// Store build result in a format parsable for our Elastic stack
logKibana()
}
}
}