Add support for passing Infisical environment variables
This commit is contained in:
@@ -2,7 +2,17 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
docker compose run --rm --workdir "${PWD}" --volume "${PWD}:${PWD}" -t cli infisical "${@}"
|
declare -a args=("--rm" "--workdir" "${PWD}" "--volume" "${PWD}:${PWD}" "-t")
|
||||||
|
|
||||||
|
if [ -n "${INFISICAL_TOKEN}" ]; then
|
||||||
|
args+=("--env" "INFISICAL_TOKEN=${INFISICAL_TOKEN}")
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "${INFISICAL_API_URL:-}" ]; then
|
||||||
|
args+=("--env" "INFISICAL_API_URL=${INFISICAL_API_URL}")
|
||||||
|
fi
|
||||||
|
|
||||||
|
docker compose run "${args[@]}" cli infisical "${@}"
|
||||||
}
|
}
|
||||||
|
|
||||||
main "${@}"
|
main "${@}"
|
||||||
|
|||||||
Reference in New Issue
Block a user