diff --git a/.github/actions/conditional/conditional.sh b/.github/actions/conditional/conditional.sh index 7e3166745d0..5192cd028e1 100755 --- a/.github/actions/conditional/conditional.sh +++ b/.github/actions/conditional/conditional.sh @@ -1,4 +1,5 @@ -#!/bin/bash -e +#!/usr/bin/env bash +set -e REPOSITORY="$1" REF="$2" diff --git a/.github/check-area-labels.sh b/.github/check-area-labels.sh index 32a3c22d217..03caec4c1ae 100755 --- a/.github/check-area-labels.sh +++ b/.github/check-area-labels.sh @@ -1,4 +1,5 @@ -#!/bin/bash -e +#!/usr/bin/env bash +set -e TEAMS="teams.yml" BUG="ISSUE_TEMPLATE/bug.yml" diff --git a/.github/scripts/download-node-tooling.sh b/.github/scripts/download-node-tooling.sh index afee184ae88..6db2e1ec264 100755 --- a/.github/scripts/download-node-tooling.sh +++ b/.github/scripts/download-node-tooling.sh @@ -1,4 +1,5 @@ -#!/bin/bash -e +#!/usr/bin/env bash +set -e abort() { echo $1 diff --git a/.github/scripts/pr-backport.sh b/.github/scripts/pr-backport.sh index 4dcf5608c0f..20682f3b210 100755 --- a/.github/scripts/pr-backport.sh +++ b/.github/scripts/pr-backport.sh @@ -1,4 +1,5 @@ -#!/bin/bash -e +#!/usr/bin/env bash +set -e TARGET_REMOTE=upstream KEYCLOAK_REPO=https://github.com/keycloak/keycloak diff --git a/.github/scripts/pr-find-issues-test.sh b/.github/scripts/pr-find-issues-test.sh index 03de462421b..7e7b39957ea 100755 --- a/.github/scripts/pr-find-issues-test.sh +++ b/.github/scripts/pr-find-issues-test.sh @@ -1,4 +1,5 @@ -#!/bin/bash -e +#!/usr/bin/env bash +set -e # Use this script to test different variants of a PR body. source ./pr-find-issues.sh diff --git a/.github/scripts/pr-find-issues.sh b/.github/scripts/pr-find-issues.sh index e9bd720ea29..7e5153479f1 100755 --- a/.github/scripts/pr-find-issues.sh +++ b/.github/scripts/pr-find-issues.sh @@ -1,4 +1,5 @@ -#!/bin/bash -e +#!/usr/bin/env bash +set -e PR="$1" REPO="$2" diff --git a/.github/scripts/prepare-quarkus-next.sh b/.github/scripts/prepare-quarkus-next.sh index 60d6c1acd5d..f8713d879f9 100755 --- a/.github/scripts/prepare-quarkus-next.sh +++ b/.github/scripts/prepare-quarkus-next.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -xeuo pipefail add_repository() { diff --git a/.github/scripts/run-fips-it.sh b/.github/scripts/run-fips-it.sh index d78ae8fc67e..47e4d94ea96 100755 --- a/.github/scripts/run-fips-it.sh +++ b/.github/scripts/run-fips-it.sh @@ -1,4 +1,5 @@ -#!/bin/bash -x +#!/usr/bin/env bash +set -x rm -f /etc/system-fips dnf install -y java-21-openjdk-devel diff --git a/.github/scripts/run-fips-ut.sh b/.github/scripts/run-fips-ut.sh index 0ebcb002a23..5313c9c7195 100755 --- a/.github/scripts/run-fips-ut.sh +++ b/.github/scripts/run-fips-ut.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash rm -f /etc/system-fips dnf install -y java-21-openjdk-devel crypto-policies-scripts diff --git a/.github/scripts/run-ipa-tests.sh b/.github/scripts/run-ipa-tests.sh index 0b3bd4d462b..98526f714e9 100755 --- a/.github/scripts/run-ipa-tests.sh +++ b/.github/scripts/run-ipa-tests.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -o pipefail diff --git a/.github/scripts/run-ipa.sh b/.github/scripts/run-ipa.sh index bcb66435b4d..2dd36e8bc28 100755 --- a/.github/scripts/run-ipa.sh +++ b/.github/scripts/run-ipa.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -o pipefail DOCKER=podman diff --git a/distribution/licenses-common/check-licenses.sh b/distribution/licenses-common/check-licenses.sh index 4bbc5bb6649..47fb82ff416 100755 --- a/distribution/licenses-common/check-licenses.sh +++ b/distribution/licenses-common/check-licenses.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash MODULES=`readlink -f $1` LICENSES=`readlink -f $2` diff --git a/distribution/licenses-common/download-license-files.sh b/distribution/licenses-common/download-license-files.sh index 9e9efddf602..bd66a525c1a 100755 --- a/distribution/licenses-common/download-license-files.sh +++ b/distribution/licenses-common/download-license-files.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -eEu diff --git a/distribution/licenses-common/update-licenses.sh b/distribution/licenses-common/update-licenses.sh index e07a8368d76..93769ea1150 100755 --- a/distribution/licenses-common/update-licenses.sh +++ b/distribution/licenses-common/update-licenses.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash DIR=`dirname $0 | xargs readlink -f` cd $DIR/../../ diff --git a/docs/documentation/build-auto.sh b/docs/documentation/build-auto.sh index 308c2924b95..c8d762ba4d2 100755 --- a/docs/documentation/build-auto.sh +++ b/docs/documentation/build-auto.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash OPTS=$1 diff --git a/docs/documentation/get-version.sh b/docs/documentation/get-version.sh index 805d9269bc9..0a27e633bf6 100755 --- a/docs/documentation/get-version.sh +++ b/docs/documentation/get-version.sh @@ -1,3 +1,4 @@ -#!/bin/bash -e +#!/usr/bin/env bash +set -e awk '/:project_version:/ { print $2 }' topics/templates/document-attributes.adoc diff --git a/get-version.sh b/get-version.sh index ca1d1bd95fa..df96ca84aaa 100755 --- a/get-version.sh +++ b/get-version.sh @@ -1,3 +1,4 @@ -#!/bin/bash -e +#!/usr/bin/env bash +set -e ./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout -pl . diff --git a/js/util/gh-dependabot-failure-stats.sh b/js/util/gh-dependabot-failure-stats.sh index 57086f82590..021f3c43c7f 100755 --- a/js/util/gh-dependabot-failure-stats.sh +++ b/js/util/gh-dependabot-failure-stats.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Displays the count of Dependabot PRs opened in the last 7 days # and the number of failed Admin UI E2E and Account UI E2E checks. diff --git a/misc/log/trimmer.sh b/misc/log/trimmer.sh index d6c66bf11d3..268a7ddd11f 100755 --- a/misc/log/trimmer.sh +++ b/misc/log/trimmer.sh @@ -1,4 +1,5 @@ -#!/bin/bash -e +#!/usr/bin/env bash +set -e cd "$(dirname "$0")" diff --git a/misc/scripts/check-java-version.sh b/misc/scripts/check-java-version.sh index 76bd6386f6d..5c4447b7e4a 100755 --- a/misc/scripts/check-java-version.sh +++ b/misc/scripts/check-java-version.sh @@ -1,4 +1,5 @@ -#!/bin/bash -e +#!/usr/bin/env bash +set -e ZIP=$1 JAVAV=$2 diff --git a/misc/scripts/dependency-report.sh b/misc/scripts/dependency-report.sh index ae19dae2be3..ef1317f29df 100755 --- a/misc/scripts/dependency-report.sh +++ b/misc/scripts/dependency-report.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash cd $(dirname $0 | xargs readlink -f)/../../ diff --git a/operator/scripts/build-testing-docker-images.sh b/operator/scripts/build-testing-docker-images.sh index 5e24fd81019..b2c3b67051e 100755 --- a/operator/scripts/build-testing-docker-images.sh +++ b/operator/scripts/build-testing-docker-images.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#!/usr/bin/env bash set -euxo pipefail VERSION="${1:-latest}" diff --git a/operator/scripts/check-crd-installed.sh b/operator/scripts/check-crd-installed.sh index 93db89a2237..cc86b6b4caa 100755 --- a/operator/scripts/check-crd-installed.sh +++ b/operator/scripts/check-crd-installed.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#!/usr/bin/env bash set -euo pipefail CRD=$1 diff --git a/operator/scripts/check-examples-installed.sh b/operator/scripts/check-examples-installed.sh index b5e45987480..f818e4a0125 100755 --- a/operator/scripts/check-examples-installed.sh +++ b/operator/scripts/check-examples-installed.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#!/usr/bin/env bash set -euo pipefail NAMESPACE=${1:-default} diff --git a/operator/scripts/create-olm-bundle.sh b/operator/scripts/create-olm-bundle.sh index 63980df5553..48c6c8140e4 100755 --- a/operator/scripts/create-olm-bundle.sh +++ b/operator/scripts/create-olm-bundle.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -euxo pipefail # Ex: 21.0.0 diff --git a/operator/scripts/create-olm-test-catalog.sh b/operator/scripts/create-olm-test-catalog.sh index 84a4a4f911a..579cd813dd5 100755 --- a/operator/scripts/create-olm-test-catalog.sh +++ b/operator/scripts/create-olm-test-catalog.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#!/usr/bin/env bash set -euxo pipefail VERSION=$1 diff --git a/operator/scripts/create-olm-test-resources.sh b/operator/scripts/create-olm-test-resources.sh index 2dce6824801..321ac85a16c 100755 --- a/operator/scripts/create-olm-test-resources.sh +++ b/operator/scripts/create-olm-test-resources.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#!/usr/bin/env bash set -euxo pipefail VERSION=$1 diff --git a/operator/scripts/deploy-examples.sh b/operator/scripts/deploy-examples.sh index 9ff98256a43..551d6af403a 100755 --- a/operator/scripts/deploy-examples.sh +++ b/operator/scripts/deploy-examples.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#!/usr/bin/env bash SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) NAMESPACE=${1:-default} diff --git a/operator/scripts/install-keycloak-operator.sh b/operator/scripts/install-keycloak-operator.sh index 211d3049274..b16e196a540 100755 --- a/operator/scripts/install-keycloak-operator.sh +++ b/operator/scripts/install-keycloak-operator.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#!/usr/bin/env bash set -euo pipefail SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) diff --git a/operator/scripts/install-olm.sh b/operator/scripts/install-olm.sh index ba945182def..52ccd0191d0 100755 --- a/operator/scripts/install-olm.sh +++ b/operator/scripts/install-olm.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#!/usr/bin/env bash set -euxo pipefail mkdir -p /tmp/olm/ diff --git a/operator/scripts/olm-testing.sh b/operator/scripts/olm-testing.sh index 9e856e22023..a8c56d89d9c 100755 --- a/operator/scripts/olm-testing.sh +++ b/operator/scripts/olm-testing.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#!/usr/bin/env bash set -euxo pipefail UUID=${1:-$(git rev-parse --short HEAD)} diff --git a/operator/scripts/prepare-olm-test.sh b/operator/scripts/prepare-olm-test.sh index f2ed53494d0..26d9a0d59f4 100755 --- a/operator/scripts/prepare-olm-test.sh +++ b/operator/scripts/prepare-olm-test.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#!/usr/bin/env bash set -euxo pipefail SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) diff --git a/operator/scripts/undeploy-examples.sh b/operator/scripts/undeploy-examples.sh index d9d1e71c4d0..80c554f724a 100755 --- a/operator/scripts/undeploy-examples.sh +++ b/operator/scripts/undeploy-examples.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#!/usr/bin/env bash SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) NAMESPACE=${1:-default} diff --git a/quarkus/container/ubi-null.sh b/quarkus/container/ubi-null.sh index c19fd9eb8e4..1c9cf3c4627 100755 --- a/quarkus/container/ubi-null.sh +++ b/quarkus/container/ubi-null.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail #set -x diff --git a/quarkus/set-quarkus-version.sh b/quarkus/set-quarkus-version.sh index d7e6122700a..73ce55743c8 100755 --- a/quarkus/set-quarkus-version.sh +++ b/quarkus/set-quarkus-version.sh @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # # Copyright 2022 Red Hat, Inc. and/or its affiliates # and other contributors as indicated by the @author tags. diff --git a/set-version.sh b/set-version.sh index 0820ba8c9a1..64563e0d5f3 100755 --- a/set-version.sh +++ b/set-version.sh @@ -1,4 +1,5 @@ -#!/bin/bash -e +#!/usr/bin/env bash +set -e NEW_VERSION=$1 diff --git a/test-framework/db-edb/container/init-and-start-db.sh b/test-framework/db-edb/container/init-and-start-db.sh index 9c515c1a339..8eb15b3a6f3 100755 --- a/test-framework/db-edb/container/init-and-start-db.sh +++ b/test-framework/db-edb/container/init-and-start-db.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#!/usr/bin/env bash set -euo pipefail PGSETUP_INITDB_OPTIONS="-E UTF-8" ./initdb -A md5 -U $PGUSER --pwfile=<(echo "$PGPASSWORD") diff --git a/tests/migration-util/migrate.sh b/tests/migration-util/migrate.sh index b3ff31b6554..6b91685f849 100755 --- a/tests/migration-util/migrate.sh +++ b/tests/migration-util/migrate.sh @@ -1,4 +1,5 @@ -#!/bin/bash -e +#!/usr/bin/env bash +set -e mvn -q clean install java -jar target/migration-util.jar $1 diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/common/install-patch.sh b/testsuite/integration-arquillian/servers/app-server/jboss/common/install-patch.sh index bf091d58454..76707a0338a 100755 --- a/testsuite/integration-arquillian/servers/app-server/jboss/common/install-patch.sh +++ b/testsuite/integration-arquillian/servers/app-server/jboss/common/install-patch.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash echo "JBOSS_HOME=$JBOSS_HOME" if [ ! -d "$JBOSS_HOME/bin" ] ; then diff --git a/testsuite/integration-arquillian/tests/base/testsuites/base-suite.sh b/testsuite/integration-arquillian/tests/base/testsuites/base-suite.sh index 3b200ee8418..e1b2b51b362 100755 --- a/testsuite/integration-arquillian/tests/base/testsuites/base-suite.sh +++ b/testsuite/integration-arquillian/tests/base/testsuites/base-suite.sh @@ -1,4 +1,5 @@ -#!/bin/bash -e +#!/usr/bin/env bash +set -e GROUP="$1" if [ "$GROUP" == "" ]; then diff --git a/testsuite/integration-arquillian/tests/base/testsuites/suite.sh b/testsuite/integration-arquillian/tests/base/testsuites/suite.sh index 27cf54732c7..30fcdd6dc3c 100755 --- a/testsuite/integration-arquillian/tests/base/testsuites/suite.sh +++ b/testsuite/integration-arquillian/tests/base/testsuites/suite.sh @@ -1,4 +1,5 @@ -#!/bin/bash -e +#!/usr/bin/env bash +set -e GROUP="$1" if [ "$GROUP" == "" ]; then diff --git a/testsuite/model/test-all-profiles.sh b/testsuite/model/test-all-profiles.sh index 69932868df5..13695e776fa 100755 --- a/testsuite/model/test-all-profiles.sh +++ b/testsuite/model/test-all-profiles.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash ## ## To include test coverage data, use -Djacoco.skip=false parameter.