mirror of https://github.com/dexidp/dex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
609 B
32 lines
609 B
#!/bin/sh -e |
|
|
|
### Usage: /docker-entrypoint.sh <command> <args> |
|
function main() { |
|
executable=$1 |
|
command=$2 |
|
|
|
if [[ "$executable" != "dex" ]] && [[ "$executable" != "$(which dex)" ]]; then |
|
exec $@ |
|
fi |
|
|
|
if [[ "$command" != "serve" ]]; then |
|
exec $@ |
|
fi |
|
|
|
for tpl_candidate in $@ ; do |
|
case "$tpl_candidate" in |
|
*.tpl|*.tmpl|*.yaml) |
|
tmp_file=$(mktemp /tmp/dex.config.yaml-XXXXXX) |
|
gomplate -f "$tpl_candidate" -o "$tmp_file" |
|
|
|
args="${args} ${tmp_file}" |
|
;; |
|
*) |
|
args="${args} ${tpl_candidate}" |
|
;; |
|
esac |
|
done |
|
exec $args |
|
} |
|
|
|
main $@
|
|
|