-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RS-353: Use
/bin/real-bash
in bash-wrapper to enable updating bats …
…to v1.5.0 (#96) * X-Smart-Branch-Parent: master * Use real-bash in bash-wrapper. Update bats to v1.5.0 * Simplify cci-export
- Loading branch information
Showing
4 changed files
with
25 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,7 +83,7 @@ RUN set -ex \ | |
|
||
# Install bats | ||
RUN set -ex \ | ||
&& npm install -g bats@1.2.0 [email protected] [email protected] [email protected] \ | ||
&& npm install -g bats@1.5.0 [email protected] [email protected] [email protected] \ | ||
&& bats -v | ||
|
||
# Install jq | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,28 @@ | ||
#!/bin/sh | ||
#!/bin/real-bash | ||
# shellcheck shell=bash | ||
|
||
# The second check is necessary because, in subshells of the parent shell, | ||
# we want to ensure that the original REAL_BASH_ENV is not clobbered. | ||
if [ -n "${BASH_ENV:-}" ] && [ "${BASH_ENV}" != "/etc/bash.env" ]; then | ||
export REAL_BASH_ENV="${BASH_ENV}" | ||
fi | ||
# cci-export is a function which can be used to export environment variables in a way that is persistent | ||
# across CircleCI steps. | ||
cci-export() { | ||
if [ "$#" -ne 2 ]; then | ||
echo >&2 "Usage: $0 KEY VALUE" | ||
return 1 | ||
fi | ||
|
||
export BASH_ENV="/etc/bash.env" | ||
key="$1" | ||
value="$2" | ||
|
||
export "${key}=${value}" | ||
|
||
if [[ "$CIRCLECI" == "true" ]]; then | ||
if [[ -z "${BASH_ENV}" ]]; then | ||
echo >&2 "Env var BASH_ENV not properly set" | ||
return 1 | ||
fi | ||
echo "export ${key}=$(printf '%q' "$value")" >> "$BASH_ENV" | ||
fi | ||
} | ||
|
||
export -f cci-export | ||
|
||
exec /bin/real-bash "$@" |
This file was deleted.
Oops, something went wrong.