storj/cmd/gateway/entrypoint
Ivan Fraixedes f9b2af934b cmd/gateway: Fix entrypoint setup command
Fix the setup command of the entrypoint script used by the gateway
docker container.

Issue: https://github.com/storj/storj/issues/3748#issuecomment-574257152
Change-Id: I94c4d7aa148761645dd065f86b7d8e2d72bb727c
2020-01-15 11:29:27 +00:00

19 lines
406 B
Bash
Executable File

#!/bin/sh
set -euo pipefail
if [[ ! -f "${CONF_PATH}/config.yaml" ]]; then
./gateway setup --config-dir "${CONF_PATH}"
fi
RUN_PARAMS="${RUN_PARAMS:-} --config-dir ${CONF_PATH}"
if [[ -n "${API_KEY:-}" ]]; then
RUN_PARAMS="${RUN_PARAMS} --api-key ${API_KEY}"
fi
if [ -n "${SATELLITE_ADDR:-}" ]; then
RUN_PARAMS="${RUN_PARAMS} --satellite-addr $SATELLITE_ADDR"
fi
exec ./gateway run $RUN_PARAMS "$@"