-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathJenkinsfile
63 lines (58 loc) · 1.61 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
// The library version is controled from the Jenkins configuration
// To force a version add after lib '@' followed by the version.
@Library('msaas-shared-lib') _
def ibpMavenSettingsFileCredential = 'ibp-maven-settings-file'
node {
// setup the global static configuration
config = setupMsaasPipeline('msaas-config.yaml')
}
pipeline {
agent {
kubernetes {
label "mypod-${UUID.randomUUID().toString()}"
defaultContainer "maven"
yaml """
apiVersion: v1
kind: Pod
spec:
containers:
- name: maven
image: docker.intuit.com/docker-rmt/maven:3.5.3-jdk-8
command:
- cat
tty: true
- name: docker
image: docker.intuit.com/docker-rmt/docker:18.09.1
tty: true
command: [ "cat" ]
volumeMounts:
- name: dind-volume
mountPath: /var/run/docker.sock
volumes:
- name: dind-volume
hostPath:
path: /var/run/dind/docker.sock
"""
}
}
environment {
IBP_MAVEN_SETTINGS_FILE = credentials("${ibpMavenSettingsFileCredential}")
}
stages {
stage('master build') {
when { allOf { branch 'master'; not {changeRequest()} } }
steps {
container('maven') {
echo "Running Build for master branch"
sh "./build-release.sh"
sh "mvn -s ${IBP_MAVEN_SETTINGS_FILE} clean deploy"
}
}
post {
always {
jacoco exclusionPattern: "**/*Test*", inclusionPattern: "**/*.class,**/*.java"
}
}
}
}
}