Skip to content

Commit 2036513

Browse files
committed
Rename jobs within pipeline
1 parent a94d749 commit 2036513

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

.github/workflows/k8s-reset-data.yml

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -82,31 +82,31 @@ jobs:
8282
- name: Verify branch status ${{ inputs.chart-branch }}
8383
working-directory: infrastructure
8484
run: git status
85-
- name: Download helm release values file into /tmp/opencrvs-${{ inputs.environment }}.json
86-
uses: actions/download-artifact@v4
87-
with:
88-
name: opencrvs-${{ inputs.environment }}-values-file
89-
path: /tmp
90-
- name: Create job ${{ matrix.job-name }} from helm template and apply it
91-
run: |
92-
kubectl delete job -n ${namespace} --ignore-not-found=true ${{ matrix.job-name }}
93-
helm template -f ${{ needs.prepare.outputs.values-file }} \
94-
--set data_cleanup.enabled=true \
95-
--set data_seed.enabled=true \
96-
--namespace ${namespace} \
97-
-s templates/${{ matrix.job-name }}-job.yaml \
98-
infrastructure/charts/opencrvs-services | kubectl apply -n ${namespace} --wait=true -f -
99-
- name: Checking ${{ matrix.job-name }} job status
100-
run: |
101-
while true; do
102-
kubectl wait --for=condition=ready pod -ljob-name=${{ matrix.job-name }} --timeout=300s -n ${namespace} && \
103-
kubectl logs job/${{ matrix.job-name }} --all-containers -f -n ${namespace} && \
104-
touch /tmp/logs_stramed-${namespace}-${{ matrix.job-name }}.txt || break;
105-
sleep 1; done &
106-
echo "---------------------- Waiting for job completion ----------------------"
107-
kubectl wait --for=condition=complete job/${{ matrix.job-name }} -n ${namespace} --timeout=600s; status=$? || true
108-
[ $status -ne 0 ] && kubectl get pods -n ${namespace} --show-labels && kubectl describe pod -ljob-name=${job_name} -n ${namespace};
109-
[ ! -f /tmp/logs_stramed-${namespace}-${{ matrix.job-name }}.txt ] && kubectl logs job/${{ matrix.job-name }} --all-containers -n ${namespace} || \
110-
rm -vf /tmp/logs_stramed-${namespace}-${{ matrix.job-name }}.txt
111-
kill %1 2>/dev/null && echo "Stopped log streaming" || true
112-
exit $status
85+
- name: Download helm release values file into /tmp/opencrvs-${{ inputs.environment }}.json
86+
uses: actions/download-artifact@v4
87+
with:
88+
name: opencrvs-${{ inputs.environment }}-values-file
89+
path: /tmp
90+
- name: Create job ${{ matrix.job-name }} from helm template and apply it
91+
run: |
92+
kubectl delete job -n ${namespace} --ignore-not-found=true ${{ matrix.job-name }}
93+
helm template -f ${{ needs.prepare.outputs.values-file }} \
94+
--set data_cleanup.enabled=true \
95+
--set data_seed.enabled=true \
96+
--namespace ${namespace} \
97+
-s templates/${{ matrix.job-name }}-job.yaml \
98+
infrastructure/charts/opencrvs-services | kubectl apply -n ${namespace} --wait=true -f -
99+
- name: Checking ${{ matrix.job-name }} job status
100+
run: |
101+
while true; do
102+
kubectl wait --for=condition=ready pod -ljob-name=${{ matrix.job-name }} --timeout=300s -n ${namespace} && \
103+
kubectl logs job/${{ matrix.job-name }} --all-containers -f -n ${namespace} && \
104+
touch /tmp/logs_stramed-${namespace}-${{ matrix.job-name }}.txt || break;
105+
sleep 1; done &
106+
echo "---------------------- Waiting for job completion ----------------------"
107+
kubectl wait --for=condition=complete job/${{ matrix.job-name }} -n ${namespace} --timeout=600s; status=$? || true
108+
[ $status -ne 0 ] && kubectl get pods -n ${namespace} --show-labels && kubectl describe pod -ljob-name=${job_name} -n ${namespace};
109+
[ ! -f /tmp/logs_stramed-${namespace}-${{ matrix.job-name }}.txt ] && kubectl logs job/${{ matrix.job-name }} --all-containers -n ${namespace} || \
110+
rm -vf /tmp/logs_stramed-${namespace}-${{ matrix.job-name }}.txt
111+
kill %1 2>/dev/null && echo "Stopped log streaming" || true
112+
exit $status

0 commit comments

Comments
 (0)