From 35e09f59dc82f80a057b7ff2aa683f2523494174 Mon Sep 17 00:00:00 2001 From: Ovidio Mallo Date: Mon, 5 Dec 2016 23:29:38 +0100 Subject: [PATCH] Parameterize the template --- deployment/config/app.yaml | 52 +++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 20 deletions(-) diff --git a/deployment/config/app.yaml b/deployment/config/app.yaml index 85183d4..c248b2a 100644 --- a/deployment/config/app.yaml +++ b/deployment/config/app.yaml @@ -5,22 +5,22 @@ objects: kind: DeploymentConfig metadata: labels: - app: frontend - name: frontend + app: ${APP} + name: ${APP} spec: replicas: 1 selector: - app: frontend - deploymentconfig: frontend + app: ${APP} + deploymentconfig: ${APP} template: metadata: labels: - app: frontend - deploymentconfig: frontend + app: ${APP} + deploymentconfig: ${APP} spec: containers: - - image: rubex-dev/${IMAGE_STREAM_TAG} - name: frontend + - image: ${PROJECT_BASE}-${BUILD_ENV}/${APP}:${ENV} + name: ${APP} ports: - containerPort: 8080 protocol: TCP @@ -29,17 +29,17 @@ objects: imageChangeParams: automatic: false containerNames: - - frontend + - ${APP} from: kind: ImageStreamTag name: ${IMAGE_STREAM_TAG} - namespace: rubex-dev + namespace: ${PROJECT_BASE}-${BUILD_ENV} - apiVersion: v1 kind: Service metadata: labels: - app: frontend - name: frontend + app: ${APP} + name: ${APP} spec: ports: - name: 8080-tcp @@ -47,21 +47,33 @@ objects: protocol: TCP targetPort: 8080 selector: - app: frontend - deploymentconfig: frontend + app: ${APP} + deploymentconfig: ${APP} - apiVersion: v1 kind: Route metadata: labels: - app: frontend - name: frontend + app: ${APP} + name: ${APP} spec: port: targetPort: 8080-tcp to: kind: Service - name: frontend + name: ${APP} parameters: -- description: The image stream tag from which to deploy. - displayName: Image Stream Tag - name: IMAGE_STREAM_TAG +- description: The project base name. + displayName: Project base name + name: PROJECT_BASE + value: rubex +- description: The application name. + displayName: Application name + name: APP + value: frontend +- description: The environment in which the image stream is built. + displayName: Build environment + name: BUILD_ENV + value: dev +- description: The environment into which the app is deployed. + displayName: Environment + name: ENV