diff options
author | Chris Evich <cevich@redhat.com> | 2020-10-06 10:21:18 -0400 |
---|---|---|
committer | Chris Evich <cevich@redhat.com> | 2020-10-06 16:01:24 -0400 |
commit | ae0f65565200df36347513cdb41989ed3f7a2e93 (patch) | |
tree | cf59ec0e9bdf56ecd13585333be8a22c55b7a7d2 /contrib/cirrus | |
parent | a7500e54a4646c7db477349e2530ac13df77b8fa (diff) | |
download | podman-ae0f65565200df36347513cdb41989ed3f7a2e93.tar.gz podman-ae0f65565200df36347513cdb41989ed3f7a2e93.tar.bz2 podman-ae0f65565200df36347513cdb41989ed3f7a2e93.zip |
Cirrus: Fix running shellcheck locally
Also, check the contents of hack/get_ci_vm.sh
Signed-off-by: Chris Evich <cevich@redhat.com>
Diffstat (limited to 'contrib/cirrus')
-rw-r--r-- | contrib/cirrus/lib.sh | 26 | ||||
-rwxr-xr-x | contrib/cirrus/shellcheck.sh | 2 |
2 files changed, 15 insertions, 13 deletions
diff --git a/contrib/cirrus/lib.sh b/contrib/cirrus/lib.sh index 23987938b..79d3b338b 100644 --- a/contrib/cirrus/lib.sh +++ b/contrib/cirrus/lib.sh @@ -6,18 +6,20 @@ # BEGIN Global export of all variables set -a -# Due to differences across platforms and runtime execution environments, -# handling of the (otherwise) default shell setup is non-uniform. Rather -# than attempt to workaround differences, simply force-load/set required -# items every time this library is utilized. -source /etc/profile -source /etc/environment -USER="$(whoami)" -HOME="$(getent passwd $USER | cut -d : -f 6)" -# Some platforms set and make this read-only -[[ -n "$UID" ]] || \ - UID=$(getent passwd $USER | cut -d : -f 3) -GID=$(getent passwd $USER | cut -d : -f 4) +if [[ "$CI" == "true" ]]; then + # Due to differences across platforms and runtime execution environments, + # handling of the (otherwise) default shell setup is non-uniform. Rather + # than attempt to workaround differences, simply force-load/set required + # items every time this library is utilized. + source /etc/profile + source /etc/environment + USER="$(whoami)" + HOME="$(getent passwd $USER | cut -d : -f 6)" + # Some platforms set and make this read-only + [[ -n "$UID" ]] || \ + UID=$(getent passwd $USER | cut -d : -f 3) + GID=$(getent passwd $USER | cut -d : -f 4) +fi # During VM Image build, the 'containers/automation' installation # was performed. The final step of that installation sets the diff --git a/contrib/cirrus/shellcheck.sh b/contrib/cirrus/shellcheck.sh index edf8248d3..667d30c91 100755 --- a/contrib/cirrus/shellcheck.sh +++ b/contrib/cirrus/shellcheck.sh @@ -11,6 +11,6 @@ shellcheck --color=always --format=tty \ --enable add-default-case,avoid-nullary-conditions,check-unassigned-uppercase \ --exclude SC2046,SC2034,SC2090,SC2064 \ --wiki-link-count=0 --severity=warning \ - $SCRIPT_BASE/*.sh + $SCRIPT_BASE/*.sh hack/get_ci_vm.sh echo "Shellcheck: PASS" |