feat(go-swagger): Small refacto on launcher
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
|
||||
# the launcher file will launch the correct app / worker based on the given env variable
|
||||
# the main goal of that launcher is to be used as a Docker entrypoint
|
||||
# APP_TYPE: Can be api or worker
|
||||
# APP_TYPE: Can be api, worker or cron
|
||||
|
||||
case "$APP_TYPE" in
|
||||
{{ if eq (len .APIs) 1 }}
|
||||
@ -33,9 +33,29 @@ case "$APP_TYPE" in
|
||||
esac
|
||||
;;
|
||||
{{end}}
|
||||
|
||||
{{- if ne (len .Crons) 0 }}
|
||||
# Crons
|
||||
cron)
|
||||
case "$CRON_NAME" in
|
||||
|
||||
{{range .Crons}}
|
||||
# Cron {{.Name}}
|
||||
{{.Name}}) exec /app/{{.Binary}} ;;
|
||||
{{end}}
|
||||
|
||||
# otherwise
|
||||
*)
|
||||
echo "** invalid CRON_NAME='$CRON_NAME'. Please use a valid cron name!"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
{{end}}
|
||||
|
||||
# otherwise
|
||||
*)
|
||||
echo "** invalid APP_TYPE='$APP_TYPE' ! Please use API or WORKER!"
|
||||
echo "** invalid APP_TYPE='$APP_TYPE' ! Please use API, WORKER or CRON!"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
Reference in New Issue
Block a user