-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check for required env variables on OIDC
- Loading branch information
1 parent
526c47a
commit edb3d2e
Showing
4 changed files
with
26 additions
and
12 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
# Check whether passed env variables are defined | ||
check_env_vars() { | ||
local required_vars=("$@") | ||
|
||
missing_vars=() | ||
for i in "${required_vars[@]}" | ||
do | ||
test -n "${!i:+y}" || missing_vars+=("$i") | ||
done | ||
if [ ${#missing_vars[@]} -ne 0 ] | ||
then | ||
echo "The following env variables are not set:" >&2 | ||
printf ' %q\n' "${missing_vars[@]}" >&2 | ||
exit 1 | ||
fi | ||
} |
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