-
Notifications
You must be signed in to change notification settings - Fork 10
/
Jenkinsfile
46 lines (38 loc) · 1012 Bytes
/
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
@Library('sd')_
def kubeLabel = getKubeLabel()
pipeline {
agent none
parameters {
booleanParam(name: 'BUILD_DOCKER_IMAGES', defaultValue: false,
description: 'Triggers the building of docker images required for development')
}
triggers { cron('@daily') }
options {
timeout(time: 1, unit: 'HOURS')
buildDiscarder(logRotator(numToKeepStr: '5'))
}
stages{
stage('build') {
agent { label 'java11' }
steps {
git(url: 'https://github.com/italiangrid/voms-admin-server.git', branch: env.BRANCH_NAME)
sh 'mvn -B -U -P prod,EMI clean package'
}
}
stage('build-docker-images') {
agent { label 'docker' }
when {
expression { return params.BUILD_DOCKER_IMAGES }
}
steps {
sh '''
pushd docker/voms-admin-server
sh build-image.sh && sh push-image.sh
popd
push docker/voms/centos6
sh build-image.sh && sh push-image.sh
popd'''
}
}
}
}