commit | 85b1492555d765b14864e0d2d59db7a50cdccaf0 | [log] [tgz] |
---|---|---|
author | Guillaume Lambert <guillaume.lambert@orange.com> | Fri Mar 12 13:53:18 2021 +0100 |
committer | Guillaume Lambert <guillaume.lambert@orange.com> | Wed Sep 22 09:17:18 2021 +0000 |
tree | aea3a348a63c939b1c4dfa4f1bc1162ebbd9df0c | |
parent | b62b9cf9e7e5248972baa619c6d015459187cd64 [diff] |
[COMMON] Enforce checkbashisms tox profile - add checkbahims to tox.ini default profiles - remove -f options to unforce bashisms detection in explicit bash scripts and to differentiate treatments between bash and sh - migrate #!/bin/bash shebangs to #!/bin/sh for scripts without bashisms The following scripts have not been migrated since they still use bashisms difficult to migrate (mostly arrays - more details below) ./kubernetes/common/mariadb-init/resources/config/db_init.sh ./kubernetes/portal/components/portal-mariadb/resources/config/ \ mariadb/docker-entrypoint.sh ./kubernetes/helm/plugins/deploy/deploy.sh ./kubernetes/helm/plugins/undeploy/undeploy.sh ./kubernetes/sdnc/components/sdnc-prom/resources/bin/ensureSdncActive.sh $ find . -not -path '*/\.*' -name *.sh -exec checkbashisms -f {} + 2>&1\ | grep line | cut -d' ' -f 7- | sort | uniq -c | sort -k1,1nr 18 (bash arrays, ${name[0|*|@]}): 2 (declare): 1 ($FUNCNAME): 1 (shopt): 1 (trap with ERR|DEBUG|RETURN): https://mywiki.wooledge.org/Bashism#Arrays https://mywiki.wooledge.org/Bashism#Special_Variables https://mywiki.wooledge.org/Bashism#Builtins https://www.oilshell.org/release/0.5.alpha2/test/spec.wwz/builtin-trap.html Issue-ID: OOM-2643 Signed-off-by: Guillaume Lambert <guillaume.lambert@orange.com> Change-Id: Id06ad1d45004321a293bdd26038d8da5f7b6b4ac
diff --git a/kubernetes/common/cassandra/resources/config/docker-entrypoint.sh b/kubernetes/common/cassandra/resources/config/docker-entrypoint.sh index 2d30f2e..4dcebc8 100644 --- a/kubernetes/common/cassandra/resources/config/docker-entrypoint.sh +++ b/kubernetes/common/cassandra/resources/config/docker-entrypoint.sh
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh set -e
diff --git a/kubernetes/common/music/resources/config/startup.sh b/kubernetes/common/music/resources/config/startup.sh index e3cee36..eb84b08 100755 --- a/kubernetes/common/music/resources/config/startup.sh +++ b/kubernetes/common/music/resources/config/startup.sh
@@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/sh + {{/* -# # ============LICENSE_START========================================== # org.onap.music # ===================================================================
diff --git a/kubernetes/common/timescaledb/resources/init/init-schema.sh b/kubernetes/common/timescaledb/resources/init/init-schema.sh index ab83cff..9cc0f5f 100644 --- a/kubernetes/common/timescaledb/resources/init/init-schema.sh +++ b/kubernetes/common/timescaledb/resources/init/init-schema.sh
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # ============LICENSE_START======================================================= # Copyright (c) 2021 Bell Canada.