UNCLASSIFIED - NO CUI

Skip to content
Snippets Groups Projects
Commit 5e90cb51 authored by Brendon Lloyd's avatar Brendon Lloyd
Browse files

Trap ERR signals and print the script currently running, the line number, and...

Trap ERR signals and print the script currently running, the line number, and the command that failed before exiting.
parent 66242a44
No related branches found
No related tags found
1 merge request!921SKIP UPGRADE: Write error message when script exits due to bash "set -e"
Pipeline #500212 passed with warnings
#!/usr/bin/env bash
set -e
trap 'echo exit at ${0}:${LINENO}, command was: ${BASH_COMMAND} 1>&2' ERR
REGISTRY_PACKAGE_IMAGE="registry:package"
REGISTRY_PACKAGE_TGZ="${REGISTRY_PACKAGE_IMAGE}.tar.gz"
......
#!/usr/bin/env bash
set -e
trap 'echo exit at ${0}:${LINENO}, command was: ${BASH_COMMAND} 1>&2' ERR
IMAGES_TXT="images.txt"
REGISTRY_IMAGE="registry:2"
......
#!/usr/bin/env bash
set -e
trap 'echo exit at ${0}:${LINENO}, command was: ${BASH_COMMAND} 1>&2' ERR
# Installs/Configures:
# - Docker Registy Container with self-signed cert
......
#!/bin/bash
set -e
trap 'echo exit at ${0}:${LINENO}, command was: ${BASH_COMMAND} 1>&2' ERR
## Adds all the vs hostnames and LB IP to /etc/hosts
## Get the LB Hostname
......
#!/usr/bin/env bash
set -e
trap 'echo exit at ${0}:${LINENO}, command was: ${BASH_COMMAND} 1>&2' ERR
#
# global defaults
......
#!/bin/bash
set -ex
trap 'echo exit at ${0}:${LINENO}, command was: ${BASH_COMMAND} 1>&2' ERR
mkdir -p repos/
......
#!/usr/bin/env bash
set -ex
trap 'echo exit at ${0}:${LINENO}, command was: ${BASH_COMMAND} 1>&2' ERR
# if keycloak label or all packages label add deploy k3d without loadbalancer so metallb can be used
if [[ "${CI_COMMIT_BRANCH}" == "${CI_DEFAULT_BRANCH}" ]] || [[ ! -z "$CI_COMMIT_TAG" ]] || [[ $CI_MERGE_REQUEST_LABELS =~ "keycloak" || $CI_MERGE_REQUEST_LABELS =~ "all-packages" ]]; then
k3d cluster create ${CI_JOB_ID} --config tests/ci/k3d/disable-servicelb-config.yaml --network ${CI_JOB_ID}
......
#!/usr/bin/env bash
set -ex
trap 'echo exit at ${0}:${LINENO}, command was: ${BASH_COMMAND} 1>&2' ERR
if [[ "${CI_COMMIT_BRANCH}" == "${CI_DEFAULT_BRANCH}" ]] || [[ ! -z "$CI_COMMIT_TAG" ]] || [[ $CI_MERGE_REQUEST_LABELS =~ "keycloak" || $CI_MERGE_REQUEST_LABELS =~ "all-packages" ]]; then
kubectl create -f tests/ci/k3d/metallb/metallb.yaml
......
#!/usr/bin/env bash
set -ex
trap 'echo exit at ${0}:${LINENO}, command was: ${BASH_COMMAND} 1>&2' ERR
# install flux with the dedicated helper script
./scripts/install_flux.sh \
......
#!/usr/bin/env bash
set -ex
trap 'echo exit at ${0}:${LINENO}, command was: ${BASH_COMMAND} 1>&2' ERR
if [[ "${CI_COMMIT_BRANCH}" == "${CI_DEFAULT_BRANCH}" ]] || [[ ! -z "$CI_COMMIT_TAG" ]] || [[ $CI_MERGE_REQUEST_LABELS =~ "all-packages" ]]; then
echo "all-packages label enabled, or on default branch or tag, enabling all addons"
......
#!/usr/bin/env bash
set -e
trap 'echo exit at ${0}:${LINENO}, command was: ${BASH_COMMAND} 1>&2' ERR
## Array of core HRs
CORE_HELMRELEASES=("gatekeeper" "istio-operator" "istio" "monitoring" "eck-operator" "ek" "fluent-bit" "twistlock" "cluster-auditor" "jaeger" "kiali")
......
......@@ -2,6 +2,7 @@
# exit on error
set -e
trap 'echo exit at ${0}:${LINENO}, command was: ${BASH_COMMAND} 1>&2' ERR
# Populate /etc/hosts
ip=$(kubectl -n istio-system get service public-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
......
......@@ -2,6 +2,7 @@
# exit on error
set -e
trap 'echo exit at ${0}:${LINENO}, command was: ${BASH_COMMAND} 1>&2' ERR
# Quick check for non iron bank images
echo "Showing images not from ironbank:"
......
......@@ -2,6 +2,7 @@
# exit on error
set -e
trap 'echo exit at ${0}:${LINENO}, command was: ${BASH_COMMAND} 1>&2' ERR
# Check clusterType and get original CoreDNS config
clusterType="unknown"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment