From 4e147c723442d9361b48b82881f87ef615b579d5 Mon Sep 17 00:00:00 2001 From: Wentao Kuang Date: Tue, 26 Sep 2023 10:40:14 +1300 Subject: [PATCH 1/4] Update the vector etl workflow to use the new create-pr cli. --- workflows/basemaps/vector-etl.yaml | 39 ++++++++++++++++++------------ 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/workflows/basemaps/vector-etl.yaml b/workflows/basemaps/vector-etl.yaml index 68f79838d..2863b8804 100644 --- a/workflows/basemaps/vector-etl.yaml +++ b/workflows/basemaps/vector-etl.yaml @@ -27,12 +27,12 @@ spec: tasks: - name: vector-etl template: vector-etl - - name: create-pr - template: create-pr + - name: create-pull-request + template: create-pull-request arguments: parameters: - - name: layer - value: "{{tasks.vector-etl.outputs.parameters.layer}}" + - name: target + value: "{{tasks.vector-etl.outputs.parameters.target}}" when: "{{workflow.parameters.create-pull-request}} == true" depends: "vector-etl" @@ -58,27 +58,36 @@ spec: ] outputs: parameters: - - name: layer + - name: target valueFrom: - path: "/tmp/layer.json" + path: "/tmp/target" - - name: create-pr + - name: create-pull-request inputs: parameters: - - name: layer + - name: target container: - image: ghcr.io/linz/basemaps/cli:latest + image: 019359803926.dkr.ecr.ap-southeast-2.amazonaws.com/eks:argo-tasks-latest volumeMounts: - name: secret-vol mountPath: "/root/.ssh/" - command: [node, index.cjs] + command: [node, /app/index.js] env: - - name: GIT_USER_EMAIL - value: basemaps@linz.govt.nz - - name: GIT_USER_NAME - value: basemaps[bot] + - name: AWS_ROLE_CONFIG_PATH + value: s3://linz-bucket-config/config.basemaps.json + - name: GITHUB_API_TOKEN + valueFrom: + secretKeyRef: + name: github-bot-pat + key: github-token args: - ["-V", "cog-pr", "--layer", "{{inputs.parameters.layer}}", "--vector"] + [ + "bmc", + "create-pr", + "--target", + "{{inputs.parameters.target}}", + "--vector", + ] volumes: - name: secret-vol secret: From fd10031f4583fbae837645fc417202e807b423dc Mon Sep 17 00:00:00 2001 From: Wentao Kuang Date: Tue, 26 Sep 2023 10:43:08 +1300 Subject: [PATCH 2/4] fix format --- workflows/basemaps/vector-etl.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/basemaps/vector-etl.yaml b/workflows/basemaps/vector-etl.yaml index 2863b8804..0923a8da9 100644 --- a/workflows/basemaps/vector-etl.yaml +++ b/workflows/basemaps/vector-etl.yaml @@ -62,7 +62,7 @@ spec: valueFrom: path: "/tmp/target" - - name: create-pull-request + - name: create-pull-request inputs: parameters: - name: target From ee6a4be133e97e30d09a6d9f5fa4f652985ccf73 Mon Sep 17 00:00:00 2001 From: Wentao Kuang Date: Thu, 28 Sep 2023 13:00:08 +1300 Subject: [PATCH 3/4] Update workflows/basemaps/vector-etl.yaml --- workflows/basemaps/vector-etl.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/workflows/basemaps/vector-etl.yaml b/workflows/basemaps/vector-etl.yaml index 0923a8da9..338e43bd1 100644 --- a/workflows/basemaps/vector-etl.yaml +++ b/workflows/basemaps/vector-etl.yaml @@ -84,8 +84,7 @@ spec: [ "bmc", "create-pr", - "--target", - "{{inputs.parameters.target}}", + "--target={{inputs.parameters.target}}", "--vector", ] volumes: From b8b340de907a3bb520e4f30dd9343024c6fb6fa7 Mon Sep 17 00:00:00 2001 From: Wentao Kuang Date: Tue, 3 Oct 2023 11:26:46 +1300 Subject: [PATCH 4/4] Add changable argo-tasks version. --- workflows/basemaps/vector-etl.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/workflows/basemaps/vector-etl.yaml b/workflows/basemaps/vector-etl.yaml index 338e43bd1..41c0047f7 100644 --- a/workflows/basemaps/vector-etl.yaml +++ b/workflows/basemaps/vector-etl.yaml @@ -8,6 +8,9 @@ spec: entrypoint: main arguments: parameters: + - name: version_argo_tasks + description: Version of the basemaps CLI docker container to use + value: v2 - name: target value: "linz-basemaps" enum: @@ -67,7 +70,7 @@ spec: parameters: - name: target container: - image: 019359803926.dkr.ecr.ap-southeast-2.amazonaws.com/eks:argo-tasks-latest + image: 019359803926.dkr.ecr.ap-southeast-2.amazonaws.com/eks:argo-tasks-{{workflow.parameters.version_argo_tasks}} volumeMounts: - name: secret-vol mountPath: "/root/.ssh/"