From b685788aea376d69a9c6b8f13b53b870dcebb5a3 Mon Sep 17 00:00:00 2001 From: Alice Fage Date: Fri, 8 Sep 2023 19:18:38 +1200 Subject: [PATCH 1/2] feat: publish to github for nz-imagery target --- workflows/imagery/publish-odr.yaml | 148 ++++++++++++++--------------- 1 file changed, 74 insertions(+), 74 deletions(-) diff --git a/workflows/imagery/publish-odr.yaml b/workflows/imagery/publish-odr.yaml index d6644252..0075598c 100644 --- a/workflows/imagery/publish-odr.yaml +++ b/workflows/imagery/publish-odr.yaml @@ -49,25 +49,25 @@ spec: - name: group-size dag: tasks: - # - name: create-manifest-github - # template: create-manifest - # arguments: - # parameters: - # - name: source - # value: "{{inputs.parameters.source}}" - # - name: target - # value: "{{workflow.parameters.target}}" - # - name: include - # value: "{{inputs.parameters.include}}" - # - name: exclude - # value: "collection.json$" - # - name: group - # value: "{{inputs.parameters.group}}" - # - name: group-size - # value: "{{inputs.parameters.group-size}}" - # - name: version-argo-tasks - # value: "{{workflow.parameters.version-argo-tasks}}" - # when: "{{=sprig.regexMatch('s3://linz-(elevation|imagery)/', workflow.parameters.target)}}" + - name: create-manifest-github + template: create-manifest + arguments: + parameters: + - name: source + value: "{{inputs.parameters.source}}" + - name: target + value: "{{workflow.parameters.target}}" + - name: include + value: "{{inputs.parameters.include}}" + - name: exclude + value: "collection.json$" + - name: group + value: "{{inputs.parameters.group}}" + - name: group-size + value: "{{inputs.parameters.group-size}}" + - name: version-argo-tasks + value: "{{workflow.parameters.version-argo-tasks}}" + when: "{{=sprig.regexMatch('s3://nz-imagery/', workflow.parameters.target)}}" - name: create-manifest template: create-manifest arguments: @@ -86,19 +86,19 @@ spec: value: "{{inputs.parameters.group-size}}" - name: version-argo-tasks value: "{{workflow.parameters.version-argo-tasks}}" - # depends: "create-manifest-github.Skipped" - # - name: copy-with-github - # template: copy - # arguments: - # parameters: - # - name: copy-option - # value: "{{workflow.parameters.copy-option}}" - # - name: file - # value: "{{item}}" - # - name: version-argo-tasks - # value: "{{workflow.parameters.version-argo-tasks}}" - # depends: "create-manifest-github.Succeeded" - # withParam: "{{tasks.create-manifest-github.outputs.parameters.files}}" + depends: "create-manifest-github.Skipped" + - name: copy-with-github + template: copy + arguments: + parameters: + - name: copy-option + value: "{{workflow.parameters.copy-option}}" + - name: file + value: "{{item}}" + - name: version-argo-tasks + value: "{{workflow.parameters.version-argo-tasks}}" + depends: "create-manifest-github.Succeeded" + withParam: "{{tasks.create-manifest-github.outputs.parameters.files}}" - name: copy template: copy arguments: @@ -111,13 +111,13 @@ spec: value: "{{workflow.parameters.version-argo-tasks}}" depends: "create-manifest" withParam: "{{tasks.create-manifest.outputs.parameters.files}}" - # - name: push-to-github - # template: push-to-github - # arguments: - # parameters: - # - name: source - # value: "{{inputs.parameters.source}}" - # depends: "copy-with-github" + - name: push-to-github + template: push-to-github + arguments: + parameters: + - name: source + value: "{{inputs.parameters.source}}" + depends: "copy-with-github" - name: create-manifest inputs: parameters: @@ -180,38 +180,38 @@ spec: "{{workflow.parameters.copy-option}}", "{{inputs.parameters.file}}", ] - # - name: push-to-github - # retryStrategy: - # limit: "2" - # inputs: - # parameters: - # - name: source - # container: - # image: "019359803926.dkr.ecr.ap-southeast-2.amazonaws.com/eks:argo-tasks-{{=sprig.trim(workflow.parameters['version-argo-tasks'])}}" - # env: - # - name: AWS_ROLE_CONFIG_PATH - # value: s3://linz-bucket-config/config.json - # - name: GIT_AUTHOR_NAME - # value: "{{=sprig.regexFind('(elevation|imagery)', workflow.parameters.target)}}[bot]" - # - name: GIT_AUTHOR_EMAIL - # value: "{{=sprig.regexFind('(elevation|imagery)', workflow.parameters.target)}}@linz.govt.nz" - # volumeMounts: - # - name: secret-volume - # mountPath: "/root/.ssh/" - # command: [node, /app/index.js] - # args: - # [ - # "stac", - # "github-import", - # "--source", - # "{{=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-{{=sprig.regexFind('(elevation|imagery)', workflow.parameters.target)}}" - # defaultMode: 384 + - name: push-to-github + retryStrategy: + limit: "2" + inputs: + parameters: + - name: source + container: + image: "019359803926.dkr.ecr.ap-southeast-2.amazonaws.com/eks:argo-tasks-{{=sprig.trim(workflow.parameters['version-argo-tasks'])}}" + env: + - name: AWS_ROLE_CONFIG_PATH + value: s3://linz-bucket-config/config.json + - name: GIT_AUTHOR_NAME + value: "{{=sprig.regexFind('imagery', workflow.parameters.target)}}[bot]" + - name: GIT_AUTHOR_EMAIL + value: "{{=sprig.regexFind('imagery', workflow.parameters.target)}}@linz.govt.nz" + volumeMounts: + - name: secret-volume + mountPath: "/root/.ssh/" + command: [node, /app/index.js] + args: + [ + "stac", + "github-import", + "--source", + "{{=sprig.trim(inputs.parameters.source)}}", + "--target", + "{{=sprig.trim(workflow.parameters.target)}}", + "--repo-name", + "linz/{{=sprig.regexFind('imagery', workflow.parameters.target)}}", + ] + volumes: + - name: secret-volume + secret: + secretName: "github-linz-{{=sprig.regexFind('imagery', workflow.parameters.target)}}" + defaultMode: 384 From 4c7c2bc435c51171880f4541363bd5ac5073132d Mon Sep 17 00:00:00 2001 From: Alice Fage Date: Mon, 11 Sep 2023 08:31:09 +1200 Subject: [PATCH 2/2] fix: remove linz-imagery from publish-copy --- workflows/imagery/publish-copy.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/workflows/imagery/publish-copy.yaml b/workflows/imagery/publish-copy.yaml index 298dd688..d2c59487 100644 --- a/workflows/imagery/publish-copy.yaml +++ b/workflows/imagery/publish-copy.yaml @@ -67,7 +67,7 @@ spec: value: "{{inputs.parameters.group-size}}" - name: version-argo-tasks value: "{{workflow.parameters.version-argo-tasks}}" - when: "{{=sprig.regexMatch('s3://linz-(elevation|imagery)/', workflow.parameters.target)}}" + when: "{{=sprig.regexMatch('s3://linz-elevation/', workflow.parameters.target)}}" - name: create-manifest template: create-manifest arguments: @@ -191,9 +191,9 @@ spec: - name: AWS_ROLE_CONFIG_PATH value: s3://linz-bucket-config/config.json - name: GIT_AUTHOR_NAME - value: "{{=sprig.regexFind('(elevation|imagery)', workflow.parameters.target)}}[bot]" + value: "{{=sprig.regexFind('elevation', workflow.parameters.target)}}[bot]" - name: GIT_AUTHOR_EMAIL - value: "{{=sprig.regexFind('(elevation|imagery)', workflow.parameters.target)}}@linz.govt.nz" + value: "{{=sprig.regexFind('elevation', workflow.parameters.target)}}@linz.govt.nz" volumeMounts: - name: secret-volume mountPath: "/root/.ssh/" @@ -207,10 +207,10 @@ spec: "--target", "{{=sprig.trim(workflow.parameters.target)}}", "--repo-name", - "linz/{{=sprig.regexFind('(elevation|imagery)', workflow.parameters.target)}}", + "linz/{{=sprig.regexFind('elevation', workflow.parameters.target)}}", ] volumes: - name: secret-volume secret: - secretName: "github-linz-{{=sprig.regexFind('(elevation|imagery)', workflow.parameters.target)}}" + secretName: "github-linz-{{=sprig.regexFind('elevation', workflow.parameters.target)}}" defaultMode: 384