Skip to content

Commit

Permalink
updating all scripts to exit on non-zero status
Browse files Browse the repository at this point in the history
Signed-off-by: Adam D. Cornett <[email protected]>
  • Loading branch information
acornett21 authored and Allda committed May 2, 2024
1 parent d507ba6 commit dfd0823
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ spec:
value: vfs
script: |
#!/usr/bin/env bash
set +x -e -o pipefail
cp /etc/containers/policy.json /tmp/
podman image trust set --policypath=/tmp/policy.json -f /mnt/keys/pub.gpg registry.redhat.io
for pull_spec in $(cat image-digests.txt); do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ spec:
- name: create-lease
image: "$(params.pipeline_image)"
script: |
set -xe
calculate_duration_in_seconds() {
if [ "${1: -1}" == "m" ]; then
TOTAL_DURATION_IN_SECONDS=$((${1:: -1} * 60))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ spec:
name: build
computeResources: {}
script: |
set -xe
echo "Building $(params.IMAGE)"
buildah --storage-driver=$(params.STORAGE_DRIVER) bud \
$(params.BUILD_EXTRA_ARGS) --format=$(params.FORMAT) \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ spec:
workingDir: $(workspaces.source.path)
script: |
#! /usr/bin/env bash
set -xe
DOCKERFILE_PATH=Dockerfile
bundle-dockerfile \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ spec:
value: test_results.json
script: |
#! /usr/bin/env bash
set -xe
if [ -f $RESULTS_FILE ]; then
echo "Results exist"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ spec:
script: |
#! /usr/bin/env bash
set -e
# storing repo maintainers from config.yaml file
MAINTAINERS="config.yaml"
yq -r '(.maintainers//[])[]' $MAINTAINERS >$(results.repo_maintainers.path)
Expand All @@ -59,6 +60,7 @@ spec:
script: |
#! /usr/bin/env bash
set -e
AUTHOR_IS_REVIEWER=$(cat $(results.author_is_reviewer.path))
CI_REVIEWERS=$(cat $(results.list_reviewers.path))
REPO_MAINTAINERS=$(cat $(results.repo_maintainers.path))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ spec:
image: "$(params.pipeline_image)"
workingDir: $(workspaces.source.path)
script: |
set -xe
if [ "$(params.force_merge)" = "true" ]; then
echo -n true > "$(results.bool_merge.path)"
elif [[ "$(params.bundle_path)" == "" ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ spec:
- name: delete-lease
image: "$(params.pipeline_image)"
script: |
set -xe
oc delete lease -l owner-id="$(params.lease-owner)" --ignore-not-found=true
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ spec:
mountPath: "/etc/pyxis-ssl-volume"
script: |
#! /usr/bin/env bash
set -xe
PREFLIGHT_RESULTS_EXISTS="$(params.preflight_results_exists)"
if [ $PREFLIGHT_RESULTS_EXISTS == "true" ]; then
echo "Preflight logs already exists - skipping"
Expand Down Expand Up @@ -116,6 +118,8 @@ spec:
mountPath: "/etc/pyxis-ssl-volume"
script: |
#! /usr/bin/env bash
set -xe
PREFLIGHT_RESULTS_EXISTS="$(params.preflight_results_exists)"
if [ $PREFLIGHT_RESULTS_EXISTS == "true" ]; then
echo "Preflight results already exists - skipping"
Expand Down Expand Up @@ -170,6 +174,8 @@ spec:
mountPath: "/etc/pyxis-ssl-volume"
script: |
#! /usr/bin/env bash
set -xe
PREFLIGHT_RESULTS_EXISTS="$(params.preflight_results_exists)"
if [ $PREFLIGHT_RESULTS_EXISTS == "true" ]; then
exit 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ spec:
image: "$(params.ubi8_minimal_image)"
script: |
#! /usr/bin/env bash
set -xe
DIRTY_FLAG="$(params.dirty_flag)"
echo $DIRTY_FLAG
if [ $DIRTY_FLAG == "true" ]; then
Expand All @@ -25,6 +27,8 @@ spec:
image: "$(params.ubi8_minimal_image)"
script: |
#! /usr/bin/env bash
set -xe
RELATED_IMAGES_FLAG="$(params.related_images_flag)"
echo $RELATED_IMAGES_FLAG
if [ $RELATED_IMAGES_FLAG == "false" ]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ spec:
image: "$(params.ubi8_minimal_image)"
script: |
#! /usr/bin/env bash
set -xe
for REFERENCE in $(tr ',' ' ' <<< '$(params.reference)'); do
INDEX_IMAGE="$(cut -d':' -f1 <<< $REFERENCE)"
echo $INDEX_IMAGE
Expand Down

0 comments on commit dfd0823

Please sign in to comment.