kind: Template apiVersion: v1 metadata: name: startx-php-build-template annotations: openshift.io/display-name: Startx PHP Server (ephemeral build & deploy workflow) description: Build and deployement workflow of a dynamic PHP web application using ephemeral storage for logs records. Use apache with various underlying linux distribution. See https://hub.docker.com/r/startx/sv-php iconClass: icon-php tags: startx,os,fedora,php,httpd openshift.io/provider-display-name: STARTX openshift.io/documentation-url: https://hub.docker.com/r/startx/sv-php openshift.io/support-url: https://gitlab.com/startx1/containers/issues/new message: |- Your application ${APP_NAME} is building and will be soon deployed. Monitor the deployement for application availability and Follow created route to browse running application Source : ${SOURCE_BRANCH}@${SOURCE_GIT} Application : ${APP_NAME} Stage : ${APP_STAGE} Builder : ${BUILDER_TAG} labels: template: startx-php-build-template provider: startx objects: - kind: ImageStream apiVersion: v1 metadata: name: startx-php annotations: openshift.io/display-name: Startx PHP WebServer openshift.io/generated-by: STARTX labels: app: "${APP_NAME}" stage: "${APP_STAGE}" spec: tags: - name: fc26 annotations: openshift.io/display-name: S2I Startx PHP WebServer (Fedora 26) description: PHP with fpm + apache engine container builder for dynamic web application running under Fedora 26 iconClass: icon-php tags: builder,startx,fedora,php,httpd supports: http version: fc26 sampleRepo: https://gitlab.com/startx1/containers-example-php.git from: kind: DockerImage name: startx/sv-php:fc26 - name: fc27 annotations: openshift.io/display-name: S2I Startx PHP WebServer (Fedora 27) description: PHP with fpm + apache engine container builder for dynamic web application running under Fedora 27 iconClass: icon-php tags: builder,startx,fedora,php,httpd supports: http version: fc27 sampleRepo: https://gitlab.com/startx1/containers-example-php.git from: kind: DockerImage name: startx/sv-php:fc27 - name: fc28 annotations: openshift.io/display-name: S2I Startx PHP WebServer (Fedora 28) description: PHP with fpm + apache engine container builder for dynamic web application running under Fedora 28 iconClass: icon-php tags: builder,startx,fedora,php,httpd supports: http version: fc28 sampleRepo: https://gitlab.com/startx1/containers-example-php.git from: kind: DockerImage name: startx/sv-php:fc28 - name: fc29 annotations: openshift.io/display-name: S2I Startx PHP WebServer (Fedora 29) description: PHP with fpm + apache engine container builder for dynamic web application running under Fedora 29 iconClass: icon-php tags: builder,startx,fedora,php,httpd supports: http version: fc29 sampleRepo: https://gitlab.com/startx1/containers-example-php.git from: kind: DockerImage name: startx/sv-php:fc29 - name: fc30 annotations: openshift.io/display-name: S2I Startx PHP WebServer (Fedora 30) description: PHP with fpm + apache engine container builder for dynamic web application running under Fedora 30 iconClass: icon-php tags: builder,startx,fedora,php,httpd supports: http version: fc30 sampleRepo: https://gitlab.com/startx1/containers-example-php.git from: kind: DockerImage name: startx/sv-php:fc30 - name: fc31 annotations: openshift.io/display-name: S2I Startx PHP WebServer (Fedora 31) description: PHP with fpm + apache engine container builder for dynamic web application running under Fedora 31 iconClass: icon-php tags: builder,startx,fedora,php,httpd supports: http version: fc31 sampleRepo: https://gitlab.com/startx1/containers-example-php.git from: kind: DockerImage name: startx/sv-php:fc31 - name: fc32 annotations: openshift.io/display-name: S2I Startx PHP WebServer (Fedora 32) description: PHP with fpm + apache engine container builder for dynamic web application running under Fedora 32 iconClass: icon-php tags: builder,startx,fedora,php,httpd supports: http version: fc32 sampleRepo: https://gitlab.com/startx1/containers-example-php.git from: kind: DockerImage name: startx/sv-php:fc32 - name: fc33 annotations: openshift.io/display-name: S2I Startx PHP WebServer (Fedora 33) description: PHP with fpm + apache engine container builder for dynamic web application running under Fedora 33 iconClass: icon-php tags: builder,startx,fedora,php,httpd supports: http version: fc33 sampleRepo: https://gitlab.com/startx1/containers-example-php.git from: kind: DockerImage name: startx/sv-php:fc33 - name: fc34 annotations: openshift.io/display-name: S2I Startx PHP WebServer (Fedora 34) description: PHP with fpm + apache engine container builder for dynamic web application running under Fedora 34 iconClass: icon-php tags: builder,startx,fedora,php,httpd supports: http version: fc34 sampleRepo: https://gitlab.com/startx1/containers-example-php.git from: kind: DockerImage name: startx/sv-php:fc34 - name: rawhide annotations: openshift.io/display-name: S2I Startx PHP WebServer (Fedora rawhide) description: PHP with fpm + apache engine container builder for dynamic web application running under Fedora rawhide iconClass: icon-php tags: builder,startx,fedora,php,httpd supports: http version: rawhide sampleRepo: https://gitlab.com/startx1/containers-example-php.git from: kind: DockerImage name: startx/sv-php:latest - name: ubi8 annotations: openshift.io/display-name: S2I Startx PHP WebServer (RedHat UBI 8) description: PHP with fpm + apache engine container builder for dynamic web application running under RedHat UBI 8 iconClass: icon-php tags: builder,startx,ubi,php,httpd supports: http version: "8" sampleRepo: https://gitlab.com/startx1/containers-example-php.git from: kind: DockerImage name: startx/sv-php:ubi8 - name: alma8 annotations: openshift.io/display-name: S2I Startx PHP WebServer (Alma 8) description: PHP with fpm + apache engine container builder for dynamic web application running under Alma 8 iconClass: icon-php tags: builder,startx,alma,php,httpd supports: http version: "8" sampleRepo: https://gitlab.com/startx1/containers-example-php.git from: kind: DockerImage name: startx/sv-php:alma8 - name: rocky8 annotations: openshift.io/display-name: S2I Startx PHP WebServer (Rocky 8) description: PHP with fpm + apache engine container builder for dynamic web application running under Rocky 8 iconClass: icon-php tags: builder,startx,rocky,php,httpd supports: http version: "8" sampleRepo: https://gitlab.com/startx1/containers-example-php.git from: kind: DockerImage name: startx/sv-php:rocky8 - name: centos8 annotations: openshift.io/display-name: S2I Startx PHP WebServer (Centos 8) description: PHP with fpm + apache engine container builder for dynamic web application running under Centos 8 iconClass: icon-php tags: builder,startx,centos,php,httpd supports: http version: "8" sampleRepo: https://gitlab.com/startx1/containers-example-php.git from: kind: DockerImage name: startx/sv-php:centos8 - name: centos7 annotations: openshift.io/display-name: S2I Startx PHP WebServer (Centos 7) description: PHP with fpm + apache engine container builder for dynamic web application running under Centos 7 iconClass: icon-php tags: builder,startx,centos,php,httpd supports: http version: "7" sampleRepo: https://gitlab.com/startx1/containers-example-php.git from: kind: DockerImage name: startx/sv-php:centos7 - name: centos6 annotations: openshift.io/display-name: S2I Startx PHP WebServer (Centos 6) description: PHP with fpm + apache engine container builder for dynamic web application running under Centos 6 iconClass: icon-php tags: builder,startx,centos,php,httpd supports: http version: "6" sampleRepo: https://gitlab.com/startx1/containers-example-php.git from: kind: DockerImage name: startx/sv-php:centos6 - name: alpine3 annotations: openshift.io/display-name: S2I Startx PHP WebServer (Alpine 3) description: PHP with fpm + apache engine container builder for dynamic web application running under Alpine 3 iconClass: icon-php tags: builder,startx,alpine,php,httpd supports: http version: "3" sampleRepo: https://gitlab.com/startx1/containers-example-php.git from: kind: DockerImage name: startx/sv-php:alpine3 - name: latest annotations: openshift.io/display-name: S2I Startx PHP WebServer (latest) description: PHP with fpm + apache engine container builder for dynamic web application running under Fedora latest iconClass: icon-php tags: builder,startx,alpine,php,httpd supports: http sampleRepo: https://gitlab.com/startx1/containers-example-php.git from: kind: ImageStreamTag name: rawhide - name: dev annotations: openshift.io/display-name: S2I Startx PHP WebServer (dev) description: PHP with fpm + apache engine container builder for dynamic web application (developpement) iconClass: icon-php tags: builder,startx,alpine,php,httpd supports: http version: "dev" sampleRepo: https://gitlab.com/startx1/containers-example-php.git from: kind: ImageStreamTag name: rawhide - name: test annotations: openshift.io/display-name: S2I Startx PHP WebServer (test) description: PHP with fpm + apache engine container builder for dynamic web application (testing) iconClass: icon-php tags: builder,startx,alpine,php,httpd supports: http version: "test" sampleRepo: https://gitlab.com/startx1/containers-example-php.git from: kind: ImageStreamTag name: centos8 - name: preprod annotations: openshift.io/display-name: S2I Startx PHP WebServer (preprod) description: PHP with fpm + apache engine container builder for dynamic web application (pre-production) iconClass: icon-php tags: builder,startx,alpine,php,httpd supports: http version: "pre-prod" sampleRepo: https://gitlab.com/startx1/containers-example-php.git from: kind: ImageStreamTag name: alpine3 - name: prod annotations: openshift.io/display-name: S2I Startx PHP WebServer (prod) description: PHP with fpm + apache engine container builder for dynamic web application (production) iconClass: icon-php tags: builder,startx,alpine,php,httpd supports: http version: "prod" sampleRepo: https://gitlab.com/startx1/containers-example-php.git from: kind: ImageStreamTag name: alpine3 - kind: ImageStream apiVersion: v1 metadata: name: "${APP_NAME}" annotations: openshift.io/display-name: Application ${APP_NAME} openshift.io/generated-by: STARTX labels: app: "${APP_NAME}" stage: "${APP_STAGE}" spec: tags: - name: latest annotations: openshift.io/display-name: Application ${APP_NAME} description: Base image for the application ${APP_NAME} iconClass: icon-php tags: startx,fedora,php,httpd,application,${APP_NAME} supports: http version: latest - kind: ConfigMap apiVersion: v1 metadata: name: "${APP_NAME}-config" annotations: openshift.io/display-name: Application ${APP_NAME} configuration openshift.io/generated-by: STARTX labels: app: "${APP_NAME}" stage: "${APP_STAGE}" data: SX_ID: ${APP_NAME}/${APP_STAGE} SX_TYPE: ${APP_STAGE} SX_SERVICE: ${APP_NAME} SX_NAME: Dynamic web application ${APP_NAME} SX_SUMMARY: Dynamic web application ${APP_NAME} based on ${BUILDER_TAG} container SX_VERSION: 0.0.1 - kind: BuildConfig apiVersion: v1 metadata: name: "${APP_NAME}" labels: app: "${APP_NAME}" stage: "${APP_STAGE}" annotations: openshift.io/generated-by: STARTX spec: triggers: - type: GitHub github: secret: "${WEBHOOK_TOKEN}_${APP_NAME}" - type: Generic generic: secret: "${WEBHOOK_TOKEN}_${APP_NAME}" - type: ImageChange imageChange: {} - type: ConfigChange runPolicy: SerialLatestOnly source: type: Git git: uri: "${SOURCE_GIT}" ref: "${SOURCE_BRANCH}" strategy: type: Source sourceStrategy: from: kind: ImageStreamTag name: startx-php:${BUILDER_TAG} env: - name: SX_VERBOSE value: "true" output: to: kind: ImageStreamTag name: "${APP_NAME}:latest" postCommit: command: - "/bin/sx-php" - post-build - kind: DeploymentConfig apiVersion: v1 metadata: name: "${APP_NAME}" labels: app: "${APP_NAME}" stage: "${APP_STAGE}" annotations: openshift.io/generated-by: STARTX spec: strategy: type: Rolling rollingParams: updatePeriodSeconds: 1 intervalSeconds: 1 timeoutSeconds: 50 maxUnavailable: 25% maxSurge: 25% pre: failurePolicy: Ignore execNewPod: containerName: "${APP_NAME}" command: - "/bin/sx-php" - pre-deploy env: - name: SX_VERBOSE value: "true" - name: SX_DEBUG value: "true" envFrom: - configMapRef: name: ${APP_NAME}-config post: failurePolicy: Ignore execNewPod: containerName: "${APP_NAME}" command: - "/bin/sx-php" - post-deploy env: - name: SX_VERBOSE value: "true" - name: SX_DEBUG value: "true" envFrom: - configMapRef: name: ${APP_NAME}-config triggers: - type: ImageChange imageChangeParams: automatic: true containerNames: - "${APP_NAME}" from: kind: ImageStreamTag name: "${APP_NAME}:latest" - type: ConfigChange postCommit: script: "/bin/sx-php info" replicas: 1 test: false selector: app: "${APP_NAME}" deploymentconfig: "${APP_NAME}" template: metadata: labels: app: "${APP_NAME}" deploymentconfig: "${APP_NAME}" annotations: openshift.io/generated-by: STARTX spec: containers: - name: "${APP_NAME}" image: " " env: - name: SX_VERBOSE value: "true" envFrom: - configMapRef: name: ${APP_NAME}-config command: - "/bin/sx-php" args: - run ports: - containerPort: 8080 protocol: TCP livenessProbe: exec: command: - "/bin/sx-php" - isLive initialDelaySeconds: 4 timeoutSeconds: 2 periodSeconds: 10 successThreshold: 1 failureThreshold: 2 readinessProbe: exec: command: - "/bin/sx-php" - isReady initialDelaySeconds: 4 timeoutSeconds: 2 periodSeconds: 10 successThreshold: 1 failureThreshold: 2 resources: limits: cpu: 8000m memory: "${MEMORY_LIMIT}" requests: cpu: 200m memory: "${MEMORY_LIMIT}" terminationMessagePath: "/dev/termination-log" imagePullPolicy: Always volumeMounts: - name: "${APP_NAME}-log" mountPath: "/var/log/httpd" volumes: - name: "${APP_NAME}-log" emptyDir: medium: "" restartPolicy: Always terminationGracePeriodSeconds: 30 securityContext: {} dnsPolicy: ClusterFirst - kind: Service apiVersion: v1 metadata: name: "${APP_NAME}" labels: app: "${APP_NAME}" stage: "${APP_STAGE}" annotations: openshift.io/generated-by: STARTX spec: ports: - protocol: TCP port: 8080 targetPort: 8080 selector: app: "${APP_NAME}" deploymentconfig: "${APP_NAME}" type: ClusterIP sessionAffinity: None - kind: Route apiVersion: v1 metadata: name: "${APP_NAME}" labels: app: "${APP_NAME}" stage: "${APP_STAGE}" annotations: openshift.io/generated-by: STARTX spec: to: kind: Service name: "${APP_NAME}" weight: 100 parameters: - name: APP_NAME displayName: Application name description: The name of the created application value: php required: true - name: APP_STAGE displayName: Application stage description: "Stage of the application deployed (ex: dev, test, prod, example, demo, poc, ...)" value: example required: true - name: BUILDER_TAG displayName: Builder image stage description: "Image tag of the startx php builder image used. Could be : latest, dev, test, preprod, prod - rawhide, fc31, fc30, fc29, fc28 - alpine3 - ubi8 - centos8, centos7, centos6, alma8, rocky8)" value: latest required: true - name: SOURCE_GIT displayName: Source repository description: URL to the source code to use during build process value: https://gitlab.com/startx1/containers-example-php.git required: true - name: SOURCE_BRANCH displayName: Source branch description: Name of the default branch value: master required: true - name: WEBHOOK_TOKEN displayName: Webhook token description: Secret token to use for webhook to github or generic generate: expression from: "[a-zA-Z0-9]{24}" required: true - name: MEMORY_LIMIT displayName: Memory Limit description: Maximum amount of memory the container can use. e.g. 512Mi, 2Gi. value: 512Mi required: true