-
Notifications
You must be signed in to change notification settings - Fork 12
/
Jenkinsfile
52 lines (41 loc) · 1.49 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
if (JENKINS_URL == 'https://ci.jenkins.io/') {
def configurations = [
[ platform: "linux", jdk: "8", jenkins: null ],
[ platform: "linux", jdk: "11", jenkins: null, javaLevel: "8" ]
]
buildPlugin(configurations: configurations, timeout: 180, useAci: true)
return
}
def label = "worker-${UUID.randomUUID().toString()}"
podTemplate(label: label, cloud: 'kubernetes',
containers: [
containerTemplate(name: 'wtctl', image: 'registry.cn-beijing.aliyuncs.com/worktile/wtctl:latest', alwaysPullImage: true, ttyEnabled: true, command: 'cat'),
],
volumes: [
hostPathVolume(mountPath: '/var/run/docker.sock', hostPath: '/var/run/docker.sock'),
hostPathVolume(mountPath: '/root/.ssh', hostPath: '/root/.ssh')
]
) {
node(label) {
def scmVars = checkout scm
def commit = scmVars.GIT_COMMIT
def branch = scmVars.GIT_BRANCH
stage('Using Worktile Pipeline') {
script {
if (env.DISABLE_WTCTL != "true") {
if (env.RUN_BETA != "true") {
container('wtctl') {
sh 'wtctl'
}
}
if (env.RUN_BETA == "true") {
echo 'Using Worktile Pipeline'
container('wtctl') {
sh 'export TAG_NAME=$(git describe --tags) && wtctl'
}
}
}
}
}
}
}