Skip to content

Commit ff38ee2

Browse files
committed
Update workflow, fix typo in script
1 parent 8aa881e commit ff38ee2

File tree

2 files changed

+23
-32
lines changed

2 files changed

+23
-32
lines changed

generateCIVariables.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ echo "Replacement text: ${REPLACEMENT_TEXT}"
5656
printf "${REPO}" > target_repo.out
5757
printf "${BRANCH}" > target_branch.out
5858
printf "${TEMPLATE_PATH}" > target_template_filepath.out
59-
printf "${OUTPUT_PATH}" > target_putput_filepath.out
59+
printf "${OUTPUT_PATH}" > target_output_filepath.out
6060
printf "${SEARCH_STRING}" > target_search_string.out
6161
printf "${REPLACEMENT_TEXT}" > target_replacement.out
6262
printf "${COMMIT}" > target_commit_message.out

workflow/workflow.yaml

+22-31
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,14 @@ spec:
2727
tasks:
2828
- name: select-parameters
2929
template: select-parameters
30-
inputs:
31-
artifacts:
32-
- name: repo
33-
path: /tmp/repo
34-
git:
35-
repo: '{{ inputs.parameters.REPO }}'
36-
revision: '{{ inputs.parameters.REVISION }}'
37-
usernameSecret:
38-
name: '{{ inputs.parameters.GIT_TOKEN_SECRET }}'
39-
key: token
40-
parameters:
41-
- name: REPO
42-
value: '{{ inputs.parameters.AUTOMATION_REPO }}'
43-
- name: REVISION
44-
value: '{{ inputs.parameters.REVISON }}'
45-
- name: GIT_TOKEN_SECRET
46-
value: '{{ inputs.parameters.GIT_TOKEN_SECRET }}'
30+
arguments:
31+
parameters:
32+
- name: REPO
33+
value: '{{ inputs.parameters.AUTOMATION_REPO }}'
34+
- name: REVISION
35+
value: '{{ inputs.parameters.REVISION }}'
36+
- name: GIT_TOKEN_SECRET
37+
value: '{{ inputs.parameters.GIT_TOKEN_SECRET }}'
4738

4839
# Update deploy repo, promote deployment to next environment
4940
# --------------------
@@ -65,12 +56,14 @@ spec:
6556
template: update-repo
6657
arguments:
6758
parameters:
68-
- name: IMAGE
69-
value: '{{ inputs.parameters.IMAGE }}'
70-
- name: PROMOTE_TO
71-
value: '{{ inputs.parameters.PROMOTE_TO }}'
72-
- name: APP_PATH_PREFIX
73-
value: '{{ inputs.parameters.APP_PATH_PREFIX }}'
59+
- name: SEARCH_STRING
60+
value: '{{ tasks.select-parameters.outputs.parameters.TARGET_SEARCH_STRING }}'
61+
- name: SEARCH_FILE
62+
value: '{{ tasks.select-parameters.outputs.parameters.TARGET_SEARCH_FILEPATH }}'
63+
- name: SEARCH_REPLACEMENT
64+
value: '{{ tasks.select-parameters.outputs.parameters.TARGET_REPLACEMENT }}'
65+
- name: OUTPUT_FILE
66+
value: '{{ tasks.select-parameters.outputs.parameters.TARGET_OUTPUT_FILEPATH }}'
7467
artifacts:
7568
- name: repo
7669
from: "{{ tasks.clone-code-repo.outputs.artifacts.repo }}"
@@ -107,11 +100,8 @@ spec:
107100
key: token
108101
parameters:
109102
- name: REPO
110-
value: '{{ inputs.parameters.AUTOMATION_REPO }}'
111103
- name: REVISION
112-
value: '{{ inputs.parameters.REVISON }}'
113104
- name: GIT_TOKEN_SECRET
114-
value: '{{ inputs.parameters.GIT_TOKEN_SECRET }}'
115105
- name: SCRIPT
116106
value: generateCIVariables.sh
117107
outputs:
@@ -139,11 +129,12 @@ spec:
139129
- name: TARGET_COMMIT_MESSAGE
140130
valueFrom:
141131
path: /tmp/repo/target_commit_message.out
142-
image: ubuntu:20.04
143-
cmd: [ bash ]
144-
script: |
145-
chmod +x {{ inputs.artifacts.repo.path }}/{{ inputs.parameters.SCRIPT }}
146-
{{ inputs.artifacts.repo.path }}/{{ inputs.parameters.SCRIPT }}
132+
script:
133+
image: ubuntu:20.04
134+
command: [ bash ]
135+
source: |
136+
chmod +x {{ inputs.artifacts.repo.path }}/{{ inputs.parameters.SCRIPT }}
137+
{{ inputs.artifacts.repo.path }}/{{ inputs.parameters.SCRIPT }}
147138
148139
- name: update-repo
149140
serviceAccountName: argo-hub.git.0.0.2

0 commit comments

Comments
 (0)