-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy-openshift.groovy
48 lines (43 loc) · 1.28 KB
/
deploy-openshift.groovy
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
pipeline {
environment {
REGISTRY_URL = ''
REGISTRY_PASSWORD = ''
}
agent any
tools {
maven 'Maven'
jdk 'JDK8'
}
options{
gitLabConnection('gitlab')
}
stages {
stage('Preparation') {
steps {
script {
git(
url: 'GITLAB_URL',
credentialsId: 'GITLAB_CREDENTIALS',
branch: "${BRANCH_NAME}"
)
}
}
}
stage('Build') {
steps {
timeout(30) {
ansiColor('xterm') {
script {
try {
sh "docker login -p ${env.REGISTRY_PASSWORD} -u jenkins ${env.REGISTRY_URL}"
sh "mvn clean install -DskipTests -Ddocker.repository.address=${env.REGISTRY_URL} -Ddocker.repository.project=OPENSHIFT_PROJECT -Ddocker.skipPush=false -Pbuild-docker-image"
}catch(error){
junit '**/target/*-reports/*.xml'
}
}
}
}
}
}
}
}