-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathJenkinsfile
41 lines (29 loc) · 926 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
def MAVEN_CONTAINER = "registry.redhat.io/openshift3/jenkins-agent-maven-35-rhel7:v3.11"
def JNLP_CONTAINER = 'jnlp'
/*
This creates a container to run your build, as you can see using the default
agent has its limitations.
For more info: https://cesarvr.io/post/jenkins-container/
*/
podTemplate(
cloud:'openshift',
label: BUILD_TAG,
/*
Add a Config Map example
volumes: [ configMapVolume(configMapName: "mvn-settings", mountPath: "/cfg")],
*/
containers: [ containerTemplate(name: "jnlp", image: MAVEN_CONTAINER) ] ) {
node(BUILD_TAG) {
stage('Clone Repository'){
checkout scm
}
container(JNLP_CONTAINER) {
stage('Creating Openshift Objects') {
sh "python pipeline/deploy.py project=${PROJECT} name=${APPLICATION_NAME}"
}
stage("Compile and Testing"){
sh 'mvn test package'
}
}
}
}