donal
2018-04-19 cb933d400035237a65f811748109746a3289504f
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
---
kind: Template
apiVersion: v1
metadata:
  name: todolist-fe-deploy
  annotations:
    openshift.io/display-name: Static react js App Deploy Template
    description: A template to deploy your an App with a HTTP endpoint
    iconClass: icon-cube
    tags: http
objects:
- apiVersion: v1
  kind: ImageStream
  metadata:
    labels:
      build: "${NAME}"
    name: "${NAME}"
  spec: {}
- apiVersion: v1
  kind: DeploymentConfig
  metadata:
    name: "${NAME}"
    labels:
      app: "${NAME}"
  spec:
    replicas: 1
    selector:
      name: "${NAME}"
    strategy:
      activeDeadlineSeconds: 21600
      resources: {}
      rollingParams:
        intervalSeconds: 1
        maxSurge: 25%
        maxUnavailable: 25%
        timeoutSeconds: 600
        updatePeriodSeconds: 1
      type: Rolling
    template:
      metadata:
        creationTimestamp:
        labels:
          name: "${NAME}"
      spec:
        containers:
        - image: "docker-registry.default.svc:5000/${NAMESPACE}/${NAME}:${APP_TAG}"
          imagePullPolicy: Always
          name: "${NAME}"
          ports:
          - containerPort: 8080
            protocol: TCP
          resources: {}
          terminationMessagePath: "/dev/termination-log"
          readinessProbe:
            httpGet:
              path: /
              port: 8080
            initialDelaySeconds: 10
            timeoutSeconds: 1
        dnsPolicy: ClusterFirst
        restartPolicy: Always
        securityContext: {}
        terminationGracePeriodSeconds: 30
    test: false
    triggers: []
- apiVersion: v1
  kind: Service
  metadata:
    labels:
      name: "${NAME}"
    name: "${NAME}"
  spec:
    ports:
    - name: 8080-tcp
      port: 8080
      protocol: TCP
      targetPort: 8080
    selector:
      name: "${NAME}"
    sessionAffinity: None
    type: ClusterIP
- apiVersion: v1
  kind: Route
  metadata:
    labels:
      name: "${NAME}"
    name: "${NAME}"
  spec:
    port:
      targetPort: 8080-tcp
    to:
      kind: Service
      name: "${NAME}"
      weight: 100
    wildcardPolicy: None
- apiVersion: v1
  kind: RoleBinding
  metadata:
    name: edit
  roleRef:
    name: edit
  subjects:
  - kind: ServiceAccount
    name: jenkins
    namespace: "${PIPELINES_NAMESPACE}"
  userNames:
  - system:serviceaccount:${PIPELINES_NAMESPACE}:${DEPLOYER_USER}
parameters:
- name: NAME
  displayName: Name
  description: The name assigned to all objects and the related imagestream.
  required: true
- name: APP_TAG
  displayName: App Tag
  description: The tag of the image to use eg latest.
  required: true
- name: NAMESPACE
  displayName: Docker image namespace
  description: The namespace of the image to use eg js-apps.
  required: true
- name: DEPLOYER_USER
  displayName: Deployer User
  description: The name to the serviceaccount user for deploying apps eg jenkins
  required: true
- name: PIPELINES_NAMESPACE
  displayName: Project/Namespace for Jenkins Pipelines
  description: The project/namespace where the Jenkins executing pipelines is deployed.
  required: true
labels:
  template: todolist-fe-deploy-template