-
Notifications
You must be signed in to change notification settings - Fork 74
/
jenkins-slave-builder-template.yaml
72 lines (72 loc) · 1.93 KB
/
jenkins-slave-builder-template.yaml
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
apiVersion: v1
kind: Template
labels:
template: jenkins-slave-builder
metadata:
annotations:
description: Provide a convenient way to convert an image to a Jenkins slave image
iconClass: icon-jenkins
tags: instant-app,jenkins
name: jenkins-slave-builder
objects:
- apiVersion: v1
kind: ImageStream
metadata:
annotations:
slave-directory: /var/lib/jenkins
slave-label: ${SLAVE_LABEL}
labels:
role: jenkins-slave
name: ${SLAVE_LABEL}-jenkins-slave
spec: {}
- apiVersion: v1
kind: BuildConfig
metadata:
annotations:
description: Modifies the ${IMAGE_NAME} to run as Jenkins slave
labels:
name: ${SLAVE_LABEL}-slave
name: ${SLAVE_LABEL}-jenkins-slave
spec:
output:
to:
kind: ImageStreamTag
name: ${SLAVE_LABEL}-jenkins-slave:latest
resources: {}
source:
contextDir: ${SLAVE_REPO_CONTEXTDIR}
git:
ref: ${SLAVE_REPO_REF}
uri: ${SLAVE_REPO_URL}
type: Git
strategy:
dockerStrategy:
from:
kind: DockerImage
name: ${IMAGE_NAME}
type: Docker
triggers:
- type: ConfigChange
parameters:
- description: The name of an image to convert to a Jenkins slave image.
displayName: Image Name
name: IMAGE_NAME
required: true
value: rhel7/rhel
- description: Label for slave pods which are used by Jenkins to discover slave pods and assign jobs to them
displayName: Jenkins Slave Label
name: SLAVE_LABEL
required: true
value: jdk8
- description: Git repository with Dockerfile and slave entrypoint.
displayName: Repository URL
name: SLAVE_REPO_URL
value: https://github.com/siamaksade/jenkins-s2i-example.git
- description: The sub-directory inside the repository.
displayName: Context Directory
name: SLAVE_REPO_CONTEXTDIR
value: slave
- description: The git ref or tag to use for customization.
displayName: Git Reference
name: SLAVE_REPO_REF
value: master