From 09910b160699331f7dc57a838352e941d777c7c3 Mon Sep 17 00:00:00 2001 From: Alice Fage Date: Wed, 9 Aug 2023 16:19:00 +1200 Subject: [PATCH 1/5] wip: publish copy for elevation or imagery --- workflows/imagery/publish-copy.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/workflows/imagery/publish-copy.yaml b/workflows/imagery/publish-copy.yaml index b7025f84f..a0a859704 100644 --- a/workflows/imagery/publish-copy.yaml +++ b/workflows/imagery/publish-copy.yaml @@ -44,7 +44,7 @@ spec: - name: group-size dag: tasks: - - name: create-manifest-linz-imagery + - name: create-manifest-github template: create-manifest arguments: parameters: @@ -62,7 +62,7 @@ spec: value: "{{inputs.parameters.group-size}}" - name: version-argo-tasks value: "{{workflow.parameters.version-argo-tasks}}" - when: "{{=sprig.contains('s3://linz-imagery/', workflow.parameters.target)}}" + when: "{{=sprig.mustRegexMatch('s3://linz-(elevation|imagery)/', workflow.parameters.target)}}" - name: create-manifest template: create-manifest arguments: @@ -81,8 +81,8 @@ spec: value: "{{inputs.parameters.group-size}}" - name: version-argo-tasks value: "{{workflow.parameters.version-argo-tasks}}" - depends: "create-manifest-linz-imagery.Skipped" - - name: copy-linz-imagery + depends: "create-manifest-github.Skipped" + - name: copy-with-github template: copy arguments: parameters: @@ -92,8 +92,8 @@ spec: value: "{{item}}" - name: version-argo-tasks value: "{{workflow.parameters.version-argo-tasks}}" - depends: "create-manifest-linz-imagery.Succeeded" - withParam: "{{tasks.create-manifest-linz-imagery.outputs.parameters.files}}" + depends: "create-manifest-github.Succeeded" + withParam: "{{tasks.create-manifest-github.outputs.parameters.files}}" - name: copy template: copy arguments: @@ -112,7 +112,7 @@ spec: parameters: - name: source value: "{{inputs.parameters.source}}" - depends: "copy-linz-imagery" + depends: "copy-with-github" - name: create-manifest inputs: parameters: From 7874ee3c9cb221368418ab4043936d20d98d9ec9 Mon Sep 17 00:00:00 2001 From: Alice Fage Date: Thu, 10 Aug 2023 17:10:35 +1200 Subject: [PATCH 2/5] fix: get repo-name --- workflows/imagery/publish-copy.yaml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/workflows/imagery/publish-copy.yaml b/workflows/imagery/publish-copy.yaml index a0a859704..8684ecb18 100644 --- a/workflows/imagery/publish-copy.yaml +++ b/workflows/imagery/publish-copy.yaml @@ -62,7 +62,7 @@ spec: value: "{{inputs.parameters.group-size}}" - name: version-argo-tasks value: "{{workflow.parameters.version-argo-tasks}}" - when: "{{=sprig.mustRegexMatch('s3://linz-(elevation|imagery)/', workflow.parameters.target)}}" + when: "{{=sprig.regexMatch('s3://linz-(elevation|imagery)/', workflow.parameters.target)}}" - name: create-manifest template: create-manifest arguments: @@ -185,10 +185,6 @@ spec: env: - name: AWS_ROLE_CONFIG_PATH value: s3://linz-bucket-config/config.json - - name: GIT_AUTHOR_NAME - value: "imagery[bot]" - - name: GIT_AUTHOR_EMAIL - value: "imagery@linz.govt.nz" volumeMounts: - name: secret-volume mountPath: "/root/.ssh/" @@ -201,6 +197,8 @@ spec: "{{=sprig.trim(inputs.parameters.source)}}", "--target", "{{=sprig.trim(workflow.parameters.target)}}", + "--repo-name", + "{{=sprig.nospace(sprig.cat('linz/', sprig.regexFind('(elevation|imagery)', workflow.parameters.target)))}}" ] volumes: - name: secret-volume From 9ba629dbd103c97d8ec6415b1cfd495e22f10b6a Mon Sep 17 00:00:00 2001 From: Alice Fage Date: Mon, 14 Aug 2023 15:06:50 +1200 Subject: [PATCH 3/5] fix: update ssh config --- workflows/imagery/publish-copy.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/workflows/imagery/publish-copy.yaml b/workflows/imagery/publish-copy.yaml index 8684ecb18..cc45f82df 100644 --- a/workflows/imagery/publish-copy.yaml +++ b/workflows/imagery/publish-copy.yaml @@ -167,7 +167,7 @@ spec: command: [node, /app/index.js] env: - name: AWS_ROLE_CONFIG_PATH - value: s3://linz-bucket-config/config-write.imagery.json,s3://linz-bucket-config/config.json + value: s3://linz-bucket-config/config-write.imagery.json,s3://linz-bucket-config/config-write.elevation.json,s3://linz-bucket-config/config.json args: [ "copy", @@ -198,10 +198,10 @@ spec: "--target", "{{=sprig.trim(workflow.parameters.target)}}", "--repo-name", - "{{=sprig.nospace(sprig.cat('linz/', sprig.regexFind('(elevation|imagery)', workflow.parameters.target)))}}" + "{{=sprig.regexFind('(elevation|imagery)', workflow.parameters.target)}}" ] volumes: - name: secret-volume secret: - secretName: github-linz-imagery + secretName: github-linz-"{{=sprig.regexFind('(elevation|imagery)', workflow.parameters.target)}}" defaultMode: 384 From 6c70a2eb8b6f030f3810910e5180b4c1cd6822b0 Mon Sep 17 00:00:00 2001 From: Alice Fage Date: Tue, 15 Aug 2023 14:02:22 +1200 Subject: [PATCH 4/5] fix: formatting --- workflows/imagery/publish-copy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/imagery/publish-copy.yaml b/workflows/imagery/publish-copy.yaml index cc45f82df..aeac339a5 100644 --- a/workflows/imagery/publish-copy.yaml +++ b/workflows/imagery/publish-copy.yaml @@ -198,7 +198,7 @@ spec: "--target", "{{=sprig.trim(workflow.parameters.target)}}", "--repo-name", - "{{=sprig.regexFind('(elevation|imagery)', workflow.parameters.target)}}" + "{{=sprig.regexFind('(elevation|imagery)', workflow.parameters.target)}}", ] volumes: - name: secret-volume From 95da2d3507abbac73d561c245f277ee7c806ed25 Mon Sep 17 00:00:00 2001 From: Alice Fage Date: Tue, 15 Aug 2023 17:00:34 +1200 Subject: [PATCH 5/5] fix: quote marks around whole secret --- workflows/imagery/publish-copy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/imagery/publish-copy.yaml b/workflows/imagery/publish-copy.yaml index aeac339a5..de8cd6c01 100644 --- a/workflows/imagery/publish-copy.yaml +++ b/workflows/imagery/publish-copy.yaml @@ -203,5 +203,5 @@ spec: volumes: - name: secret-volume secret: - secretName: github-linz-"{{=sprig.regexFind('(elevation|imagery)', workflow.parameters.target)}}" + secretName: "github-linz-{{=sprig.regexFind('(elevation|imagery)', workflow.parameters.target)}}" defaultMode: 384