This repository was archived by the owner on Jan 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
78 lines (71 loc) · 2.33 KB
/
Copy pathJenkinsfile
File metadata and controls
78 lines (71 loc) · 2.33 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
@Library('meshkorea') _
pipeline {
agent {
kubernetes {
yaml """
apiVersion: v1
kind: Pod
spec:
containers:
- name: git
image: alpine/git:v2.26.2
command:
- cat
tty: true
- name: corretto-jdk
image: 200327251464.dkr.ecr.ap-northeast-2.amazonaws.com/devops/corretto:17-al2-full.v.1.0
command:
- cat
tty: true
volumeMounts:
- mountPath: /root
name: jdk
- mountPath: /var/run/docker.sock
name: dockersock
volumes:
- name: dockersock
hostPath:
path: /var/run/docker.sock
- name: jdk
hostPath:
path: /local
serviceAccountName: jenkins
hostAliases:
- ip: "10.5.1.45"
hostnames:
- "nexus.mm.meshkorea.net"
"""
defaultContainer 'git'
}
}
options {
timeout(time: 1, unit: 'HOURS')
}
environment {
JOB = "${env.JOB_NAME.split('/')[0]}"
}
stages {
stage('Init') {
steps {
script {
env.GLOBAL_STAGE_NAME = 'Init'
echo "git tag: ${env.BRANCH_NAME}"
}
}
}
stage('Gradle build') {
steps {
script {
env.GLOBAL_STAGE_NAME = 'Gradle build'
container('corretto-jdk') {
withCredentials([file(credentialsId: 'nexus', variable: 'nexus')]) {
sh "[ ! -d \"~/.gradle\" ] && mkdir -p ~/.gradle"
sh "cp \$nexus ~/.gradle/gradle.properties"
}
sh "./gradlew clean build -x order:clients:clean -x order:clients:build -x product:clients:clean -x product:clients:build -x delivery:clients:clean -x delivery:clients:build -x payment:clients:clean -x payment:clients:build"
}
}
}
}
}
}