Blob Blame History Raw
---
kind: Template
apiVersion: v1
metadata:
  name: php-fedora
  annotations:
    description: Php source to image builder
    tags: php s2i
    iconClass: icon-php
labels:
  template: php
  role: php_application_builder
objects:
  - kind : ImageStream
    apiVersion : v1
    metadata :
        name : ${APP_NAME}
        labels :
          appid : php-${APP_NAME}
  - kind : ImageStream
    apiVersion : v1
    metadata :
      name : ${APP_NAME}-s2i
      labels :
        appid : php-${APP_NAME}
    spec :
      tags :
        - name : latest
          from :
            kind : DockerImage
            name : modularitycontainers/php
  - kind : BuildConfig
    apiVersion : v1
    metadata :
      name : ${APP_NAME}
      labels :
        appid : php-${APP_NAME}
    spec :
      triggers :
        - type : ConfigChange
        - type : ImageChange
        - type : GitHub
          github:
            secret: secret101
      source :
        type : Git
        git :
          uri : ${SOURCE_REPOSITORY}
          contextDir : ${SOURCE_REPOSITORY}
      strategy :
        type : Source
        sourceStrategy :
          from :
            kind : ImageStreamTag
            name : ${APP_NAME}-s2i:latest
      output :
        to :
          kind : ImageStreamTag
          name : ${APP_NAME}:latest
  - kind : DeploymentConfig
    apiVersion : v1
    metadata :
      name: ${APP_NAME}
      labels :
        appid : php-${APP_NAME}
    spec :
      strategy :
        type : Rolling
      triggers :
         - type : ConfigChange
         - type : ImageChange
           imageChangeParams :
             automatic : true
             containerNames :
               - ${APP_NAME}
             from :
               kind : ImageStreamTag
               name : ${APP_NAME}:latest
      replicas : 1
      selector :
        deploymentconfig : ${APP_NAME}
      template :
        metadata :
          labels :
            appid: php-${APP_NAME}
            deploymentconfig : ${APP_NAME}
        spec :
          containers :
            - name : ${APP_NAME}
              image : ${APP_NAME}:latest
              ports :
                - containerPort : 8080
                  protocol : TCP
              livenessProbe:
                tcpSocket:
                  port: 8080
                initialDelaySeconds: 15
                timeoutSeconds: 1
              readinessProbe:
                httpGet:
                  path: /
                  port: 8080
                initialDelaySeconds: 15
                timeoutSeconds: 1
  - kind : Service
    apiVersion : v1
    metadata :
      name : ${APP_NAME}
      labels :
        appid : php-${APP_NAME}
    spec :
      ports :
        - name: 8080-tcp
          protocol : TCP
          port : 8080
          targetPort : 8080
      selector :
        deploymentconfig : ${APP_NAME}
  - kind : Route
    apiVersion : v1
    metadata :
      name : ${APP_NAME}
      labels :
        appid : php-${APP_NAME}
    spec :
      host :
      to :
        kind : Service
        name : ${APP_NAME}
        weight : 100
      port :
        targetPort : 8080-tcp
parameters :
  - name : APP_NAME
    description : Name of application
    value :
    required : true
  - name : SOURCE_REPOSITORY
    description : Git source repository
    value :
    required : true