From aa5ce92e0662ce708b66a8143a6a2a8f0c87372b Mon Sep 17 00:00:00 2001 From: Beppe Vanrolleghem Date: Tue, 17 Mar 2020 20:28:25 +0100 Subject: [PATCH] pls werk --- Tekton/tasks/deploy-app.yaml | 6 ++--- deploy-example.yaml | 2 +- deploy-example.yaml-e | 43 ++++++++++++++++++++++++++++++++++++ infra/deploy-example.yaml | 0 4 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 deploy-example.yaml-e create mode 100644 infra/deploy-example.yaml diff --git a/Tekton/tasks/deploy-app.yaml b/Tekton/tasks/deploy-app.yaml index e572c35..abd18e8 100644 --- a/Tekton/tasks/deploy-app.yaml +++ b/Tekton/tasks/deploy-app.yaml @@ -8,7 +8,7 @@ metadata: spec: params: - name: yaml-location - default: infra/deploy.yaml + default: infra/deploy-example.yaml - name: command default: apply - name: deploy-name @@ -20,8 +20,8 @@ spec: - name: update-yaml image: alpine script: | - sed -i -e s;DEPLOY_NAME;$(params.deploy-name);g $(params.yaml-location) - sed -i -e s;DEPLOY_VERSION;$(params.deploy-version);g $(params.yaml-location) + sed -i -e 's;DEPLOY_NAME;$(params.deploy-name);g' $(params.yaml-location) + sed -i -e 's;DEPLOY_VERSION;$(params.deploy-version);g' $(params.yaml-location) - name: deploy-new-app image: lachlanevenson/k8s-kubectl command: ["kubectl"] diff --git a/deploy-example.yaml b/deploy-example.yaml index 3249e36..cd271b2 100644 --- a/deploy-example.yaml +++ b/deploy-example.yaml @@ -40,4 +40,4 @@ spec: - name: https protocol: TCP port: 443 - targetPort: 443 \ No newline at end of file + targetPort: 443 diff --git a/deploy-example.yaml-e b/deploy-example.yaml-e new file mode 100644 index 0000000..3249e36 --- /dev/null +++ b/deploy-example.yaml-e @@ -0,0 +1,43 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: DEPLOY_NAME-DEPLOY_VERSION + namespace: default +spec: + replicas: 1 + selector: + matchLabels: + app: DEPLOY_NAME + version: DEPLOY_VERSION + template: + metadata: + labels: + app: DEPLOY_NAME + version: DEPLOY_VERSION + spec: + containers: + - name: main + image: beppev/DEPLOY_NAME:DEPLOY_VERSION + imagePullPolicy: "Always" + ports: + - containerPort: 80 + - containerPort: 443 +--- +apiVersion: v1 +kind: Service +metadata: + name: DEPLOY_NAME-service + namespace: default +spec: + selector: + app: DEPLOY_NAME + ports: + - name: http + protocol: TCP + port: 80 + targetPort: 80 + - name: https + protocol: TCP + port: 443 + targetPort: 443 \ No newline at end of file diff --git a/infra/deploy-example.yaml b/infra/deploy-example.yaml new file mode 100644 index 0000000..e69de29