donal
2018-04-24 94b1a236779737ffbd642e2c562521238b871b33
commit | author | age
7ad6aa 1 ---
D 2 kind: Template
3 apiVersion: v1
4 metadata:
5   name: jenkins-s2i
6   annotations:
7     openshift.io/display-name: Jenkins S2I
8     description: Jenkins S2I build config to create a Jenkins image with your configuration
9       baked in.
10     iconClass: icon-jenkins
11     tags: instant-app,jenkins
12 objects:
13 - apiVersion: v1
94b1a2 14   stringData:
7ad6aa 15     password: "${SOURCE_REPOSITORY_PASSWORD}"
D 16     username: "${SOURCE_REPOSITORY_USERNAME}"
17   kind: Secret
18   metadata:
19     name: gitlab-auth
20   type: kubernetes.io/basic-auth
21 - kind: ImageStream
22   apiVersion: v1
23   metadata:
24     name: "${NAME}"
25     annotations:
26       description: Keeps track of changes in the application image
27 - kind: ImageStream
28   apiVersion: v1
29   metadata:
30     name: ${BUILDER_IMAGE_STREAM_NAME}
31     annotations:
32       description: Tracks the Red Hat Jenkins base image, since openshift may not ship with the tag we need. Importing the image allows normal users to run the playbook.
33   spec:
34     tags:
35     - annotations: null
36       from:
37         kind: DockerImage
38         name: registry.access.redhat.com/openshift3/jenkins-2-rhel7:${BUILDER_IMAGE_STREAM_TAG_NAME}
39       importPolicy: {}
40       name: ${BUILDER_IMAGE_STREAM_TAG_NAME}
41       referencePolicy:
42         type: Source
43 - kind: BuildConfig
44   apiVersion: v1
45   metadata:
46     name: "${NAME}"
47     labels:
48       build: "${NAME}"
49       type: image
50   spec:
51     triggers:
52     - type: GitHub
53       github:
54         secret: "${BUILD_SECRET}"
55     - type: GitLab
56       gitlab:
57         secret: "${BUILD_SECRET}"
58     - type: Generic
59       generic:
60         secret: "${BUILD_SECRET}"
61         allowEnv: true
62     - type: ConfigChange
63     runPolicy: Serial
64     source:
65       type: Git
66       sourceSecret:
67         name: "gitlab-auth"
68       git:
69         uri: "${SOURCE_REPOSITORY_URL}"
70         ref: "${SOURCE_REPOSITORY_REF}"
71       contextDir: "${SOURCE_REPOSITORY_CONTEXT_DIR}"
72     strategy:
73       type: Source
74       sourceStrategy:
75         env:
76           - name: "GIT_SSL_NO_VERIFY"
77             value: "true"
78         from:
79           kind: ImageStreamTag
80           name: "${BUILDER_IMAGE_STREAM_NAME}:${BUILDER_IMAGE_STREAM_TAG_NAME}"
81           namespace: "${IMAGE_STREAM_NAMESPACE}"
82     output:
83       to:
84         kind: ImageStreamTag
85         name: "${NAME}:latest"
86 parameters:
87 - name: NAME
88   displayName: Name
89   description: The name assigned to all objects and the resulting imagestream.
90   required: true
91   value: jenkins
92 - name: BUILD_SECRET
93   displayName: Webhook Secret for builds
94   description: A secret string used to configure the build webhooks.
95   generate: expression
96   from: "[a-zA-Z0-9]{40}"
97 - name: SOURCE_REPOSITORY_URL
98   displayName: Git Repository URL
99   description: The URL of the repository with your application source code.
100   required: true
101 - name: SOURCE_REPOSITORY_REF
102   displayName: Git Reference
103   description: Set this to a branch name, tag or other ref of your repository if you are not using the default (master) branch.
104   default: master
105 - name: SOURCE_REPOSITORY_CONTEXT_DIR
106   displayName: Git Reference
107   description: The directory in the source repository where the SonarQube docker build is.
108 - name: BUILDER_IMAGE_STREAM_NAME
109   displayName: Builder Image Stream Name
110   description: The Jenkins builder Image Stream Tag (e.g. jenkins)
111   required: true
112   value: jenkins
113 - name: BUILDER_IMAGE_STREAM_TAG_NAME
114   displayName: Builder Image Stream Tag Name
115   description: The Jenkins builder Image Stream Tag Name (e.g. v3.9)
116   required: true
117   value: v3.9 
118 - name: IMAGE_STREAM_NAMESPACE
119   displayName: Builder ImageSteam Tag
120   description: The namespace where the Jenkins builder Image Stream lives
121   required: true
122   value: openshift
123 - name: SOURCE_REPOSITORY_USERNAME
124   displayName: Git Repo Username
125   description: Username to have the builder pod auth against git
126   required: true
127   value: jenkins
128 - name: SOURCE_REPOSITORY_PASSWORD
129   displayName: Git Repo Password
130   description: Password to have the builder pod auth against git
131   required: true
132   value: password