forked from zabbix-tooling/k8s-zabbix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
51 lines (46 loc) · 1.23 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
#!groovy
pipeline {
agent any
parameters {
booleanParam(defaultValue: false, description: 'Create release', name: 'RELEASE')
}
triggers {
cron('@daily')
pollSCM('H/15 * * * *')
}
options{
buildDiscarder(logRotator(artifactDaysToKeepStr: '10', artifactNumToKeepStr: '10', daysToKeepStr: '3', numToKeepStr: '20'))
disableConcurrentBuilds()
}
stages {
stage('Prepare') {
when {
environment name: 'RELEASE', value: 'true'
}
steps {
ansiColor('xterm') {
sh 'git fetch --tags'
sh './build.sh cleanup vicoconsulting'
}
}
}
stage('Build and Test') {
steps {
ansiColor('xterm') {
sh 'git fetch --tags'
sh "./build.sh default vicoconsulting"
}
}
}
stage('Release') {
when {
environment name: 'RELEASE', value: 'true'
}
steps {
ansiColor('xterm') {
sh './build.sh publish_image vicoconsulting'
}
}
}
}
}