From 2713629c09043f3111359ed8230c0f4464e289ee Mon Sep 17 00:00:00 2001 From: Alice Fage Date: Thu, 17 Aug 2023 15:15:05 +1200 Subject: [PATCH] feat: add elevation repo to publish-copy TDE-833 (#150) --- workflows/imagery/publish-copy.yaml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/workflows/imagery/publish-copy.yaml b/workflows/imagery/publish-copy.yaml index b7025f84f..746d8d367 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.regexMatch('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: @@ -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", @@ -186,9 +186,9 @@ spec: - name: AWS_ROLE_CONFIG_PATH value: s3://linz-bucket-config/config.json - name: GIT_AUTHOR_NAME - value: "imagery[bot]" + value: "{{=sprig.regexFind('(elevation|imagery)', workflow.parameters.target)}}[bot]" - name: GIT_AUTHOR_EMAIL - value: "imagery@linz.govt.nz" + value: "{{=sprig.regexFind('(elevation|imagery)', workflow.parameters.target)}}@linz.govt.nz" volumeMounts: - name: secret-volume mountPath: "/root/.ssh/" @@ -201,9 +201,11 @@ spec: "{{=sprig.trim(inputs.parameters.source)}}", "--target", "{{=sprig.trim(workflow.parameters.target)}}", + "--repo-name", + "linz/{{=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