Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: publish to github for nz-imagery target TDE-801 #171

Merged
merged 2 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions workflows/imagery/publish-copy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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/"
Expand All @@ -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
148 changes: 74 additions & 74 deletions workflows/imagery/publish-odr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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
Loading