Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
1 contributor

Users who have contributed to this file

73 lines (72 sloc) 1.93 KB
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
You can’t perform that action at this time.