donal
2018-04-24 94b1a236779737ffbd642e2c562521238b871b33
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
---
kind: Template
apiVersion: v1
metadata:
  name: jenkins-s2i
  annotations:
    openshift.io/display-name: Jenkins S2I
    description: Jenkins S2I build config to create a Jenkins image with your configuration
      baked in.
    iconClass: icon-jenkins
    tags: instant-app,jenkins
objects:
- apiVersion: v1
  stringData:
    password: "${SOURCE_REPOSITORY_PASSWORD}"
    username: "${SOURCE_REPOSITORY_USERNAME}"
  kind: Secret
  metadata:
    name: gitlab-auth
  type: kubernetes.io/basic-auth
- kind: ImageStream
  apiVersion: v1
  metadata:
    name: "${NAME}"
    annotations:
      description: Keeps track of changes in the application image
- kind: ImageStream
  apiVersion: v1
  metadata:
    name: ${BUILDER_IMAGE_STREAM_NAME}
    annotations:
      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.
  spec:
    tags:
    - annotations: null
      from:
        kind: DockerImage
        name: registry.access.redhat.com/openshift3/jenkins-2-rhel7:${BUILDER_IMAGE_STREAM_TAG_NAME}
      importPolicy: {}
      name: ${BUILDER_IMAGE_STREAM_TAG_NAME}
      referencePolicy:
        type: Source
- kind: BuildConfig
  apiVersion: v1
  metadata:
    name: "${NAME}"
    labels:
      build: "${NAME}"
      type: image
  spec:
    triggers:
    - type: GitHub
      github:
        secret: "${BUILD_SECRET}"
    - type: GitLab
      gitlab:
        secret: "${BUILD_SECRET}"
    - type: Generic
      generic:
        secret: "${BUILD_SECRET}"
        allowEnv: true
    - type: ConfigChange
    runPolicy: Serial
    source:
      type: Git
      sourceSecret:
        name: "gitlab-auth"
      git:
        uri: "${SOURCE_REPOSITORY_URL}"
        ref: "${SOURCE_REPOSITORY_REF}"
      contextDir: "${SOURCE_REPOSITORY_CONTEXT_DIR}"
    strategy:
      type: Source
      sourceStrategy:
        env:
          - name: "GIT_SSL_NO_VERIFY"
            value: "true"
        from:
          kind: ImageStreamTag
          name: "${BUILDER_IMAGE_STREAM_NAME}:${BUILDER_IMAGE_STREAM_TAG_NAME}"
          namespace: "${IMAGE_STREAM_NAMESPACE}"
    output:
      to:
        kind: ImageStreamTag
        name: "${NAME}:latest"
parameters:
- name: NAME
  displayName: Name
  description: The name assigned to all objects and the resulting imagestream.
  required: true
  value: jenkins
- name: BUILD_SECRET
  displayName: Webhook Secret for builds
  description: A secret string used to configure the build webhooks.
  generate: expression
  from: "[a-zA-Z0-9]{40}"
- name: SOURCE_REPOSITORY_URL
  displayName: Git Repository URL
  description: The URL of the repository with your application source code.
  required: true
- name: SOURCE_REPOSITORY_REF
  displayName: Git Reference
  description: Set this to a branch name, tag or other ref of your repository if you are not using the default (master) branch.
  default: master
- name: SOURCE_REPOSITORY_CONTEXT_DIR
  displayName: Git Reference
  description: The directory in the source repository where the SonarQube docker build is.
- name: BUILDER_IMAGE_STREAM_NAME
  displayName: Builder Image Stream Name
  description: The Jenkins builder Image Stream Tag (e.g. jenkins)
  required: true
  value: jenkins
- name: BUILDER_IMAGE_STREAM_TAG_NAME
  displayName: Builder Image Stream Tag Name
  description: The Jenkins builder Image Stream Tag Name (e.g. v3.9)
  required: true
  value: v3.9 
- name: IMAGE_STREAM_NAMESPACE
  displayName: Builder ImageSteam Tag
  description: The namespace where the Jenkins builder Image Stream lives
  required: true
  value: openshift
- name: SOURCE_REPOSITORY_USERNAME
  displayName: Git Repo Username
  description: Username to have the builder pod auth against git
  required: true
  value: jenkins
- name: SOURCE_REPOSITORY_PASSWORD
  displayName: Git Repo Password
  description: Password to have the builder pod auth against git
  required: true
  value: password