Skip to content

Commit

Permalink
[patch] Update name of finally task and set max_retries correctly (#1246
Browse files Browse the repository at this point in the history
)
  • Loading branch information
whitfiea authored Sep 18, 2024
1 parent 9e9c7fd commit b0d13c5
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 18 deletions.
5 changes: 4 additions & 1 deletion image/cli/app-root/src/wait-for-tekton.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ done

echo "Completion Time = $COMPLETION_TIME"
echo "Retries Used = $RETRIES_USED"
RESULT=$(oc -n ${NAMESPACE} get ${TYPE}/$NAME -o jsonpath='{.status.conditions[0].status}')
RESULT=""
while [[ "$RESULT" == "" ]]; do
RESULT=$(oc -n ${NAMESPACE} get ${TYPE}/$NAME -o jsonpath='{.status.conditions[0].status}')
done

if [[ "$RESULT" == "True" ]]; then
echo "Result = ${TYPE} completed successfully"
Expand Down
5 changes: 4 additions & 1 deletion image/cli/mascli/functions/gitops_mas_fvt_preparer
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,11 @@ function gitops_mas_fvt_preparer() {
export SYNC_WITH_INSTALL=false
#If this is the FVT Core run then don't call finalize at the end of this run
if [[ "$LAUNCHER_ID" == "core" ]]; then
export RUN_FINALIZE=false
export FINALIZE=false
export SET_FINISHED=false
fi
export DEPROVISION=false

#FVT pipeline to run
export PIPELINE_NAME=$FVT_PIPELINE_NAME
ansible-playbook ibm.mas_fvt.setup_pipeline
Expand Down
2 changes: 1 addition & 1 deletion image/cli/masfvt/finally.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# Pipeline Run Info
devops_build_number: "{{ lookup('env', 'DEVOPS_BUILD_NUMBER') | default('0', True) }}"
pipelinerun_name: "{{ lookup('env', 'PIPELINERUN_NAME') | default('mas-fvt-finally', True) }}-{{ devops_build_number }}"
pipelinerun_name: "{{ lookup('env', 'PIPELINERUN_NAME') | default('mas-fvt-finally-' ~ devops_build_number, True) }}"
mas_instance_id: "{{ lookup('env', 'MAS_INSTANCE_ID') }}"
pipelinerun_namespace: "{{ lookup('env', 'PIPELINERUN_NAMESPACE') | default('mas-' ~ mas_instance_id ~ '-pipelines', True) }}"
tasks:
Expand Down
2 changes: 1 addition & 1 deletion tekton/src/pipelines/fvt-deprovision-after.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ spec:
value: $(params.pipelinerun_name)
- name: delay
value: 1200 # 20 minutes between checking the status of the pipelinerun
- name: retries
- name: max_retries
value: 60 # attempts before giving up (approximately 20 hours)
- name: ignore_failure
value: $(params.ignore_failure)
Expand Down
8 changes: 7 additions & 1 deletion tekton/src/pipelines/fvt-launcher.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ spec:
type: string
default: "true"
description: "Set this to 'false' to stop the finalize task from running for this launcher"
- name: set_finished
type: string
default: "true"
description: "Set this to 'false' to stop the the fvt test being marked as complete"

# Deprovision Resources
# -------------------------------------------------------------------------
Expand Down Expand Up @@ -936,10 +940,12 @@ spec:
value: "$(params.deprovision)"
- name: finalize
value: "$(params.finalize)"
- name: set_finished
value: "$(params.set_finished)"
- name: image_pull_policy
value: $(params.image_pull_policy)
- name: pipelinerun_name
value: "$(params.mas_instance_id)-fvt-finally"
value: "$(context.pipelineRun.name)-fvt-finally"

workspaces:
# The generated configuration files
Expand Down
4 changes: 2 additions & 2 deletions tekton/src/pipelines/gitops/deprovision-cluster.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ spec:
value: $(params.pipelinerun_name)
- name: delay
value: 120 # seconds between checking the status of the pipelinerun
- name: retries
value: 50 # attempts before giving up
- name: max_retries
value: 120 # attempts before giving up
- name: ignore_failure
value: $(params.ignore_failure) # fails and exit once the first failure is detected
{% endif %}
Expand Down
4 changes: 2 additions & 2 deletions tekton/src/pipelines/gitops/deprovision-mas-deps.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ spec:
value: $(params.pipelinerun_name)
- name: delay
value: 120 # seconds between checking the status of the pipelinerun
- name: retries
value: 50 # attempts before giving up
- name: max_retries
value: 120 # attempts before giving up
- name: ignore_failure
value: $(params.ignore_failure) # fails and exit once the first failure is detected
{% endif %}
Expand Down
4 changes: 2 additions & 2 deletions tekton/src/pipelines/gitops/gitops-mas-deps.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ spec:
value: $(params.pipelinerun_name)
- name: delay
value: 120 # seconds between checking the status of the pipelinerun
- name: retries
value: 50 # attempts before giving up
- name: max_retries
value: 120 # attempts before giving up
- name: ignore_failure
value: $(params.ignore_failure) # fails and exit once the first failure is detected
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ spec:

- name: mas_workspace_id
type: string
- name: mas_channel
type: string

- name: launchfvt_core
type: string
Expand Down Expand Up @@ -229,6 +231,8 @@ spec:

- name: mas_workspace_id
value: $(params.mas_workspace_id)
- name: mas_channel
value: $(params.mas_channel)

- name: launchfvt_core
value: $(params.launchfvt_core)
Expand Down
4 changes: 2 additions & 2 deletions tekton/src/pipelines/gitops/gitops-mas-initiator.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ spec:
value: $(params.pipelinerun_name)
- name: delay
value: 120 # seconds between checking the status of the pipelinerun
- name: retries
value: 50 # attempts before giving up
- name: max_retries
value: 120 # attempts before giving up
- name: ignore_failure
value: $(params.ignore_failure) # fails and exit once the first failure is detected
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ spec:
value: $(params.pipelinerun_name)
- name: delay
value: 120 # seconds between checking the status of the pipelinerun
- name: retries
value: 50 # attempts before giving up
- name: max_retries
value: 120 # attempts before giving up
- name: ignore_failure
value: $(params.ignore_failure) # fails and exit once the first failure is detected
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion tekton/src/pipelines/rollback.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ spec:
value: $(params.pipelinerun_name)
- name: delay
value: 600 # seconds between checking the status of the pipelinerun
- name: retries
- name: max_retries
value: 50 # attempts before giving up
- name: ignore_failure
value: "False" # fails and exit once the first failure is detected
Expand Down
2 changes: 1 addition & 1 deletion tekton/src/pipelines/update.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ spec:
value: $(params.pipelinerun_name)
- name: delay
value: 600 # seconds between checking the status of the pipelinerun
- name: retries
- name: max_retries
value: 50 # attempts before giving up
- name: ignore_failure
value: "False" # fails and exit once the first failure is detected
Expand Down
2 changes: 1 addition & 1 deletion tekton/src/pipelines/upgrade.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ spec:
value: $(params.pipelinerun_name)
- name: delay
value: 600 # seconds between checking the status of the pipelinerun
- name: retries
- name: max_retries
value: 50 # attempts before giving up
- name: ignore_failure
value: "False" # fails and exit once the first failure is detected
Expand Down

0 comments on commit b0d13c5

Please sign in to comment.