feat(go-swagger): Improve Makefile
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Matthieu 'JP' DERASSE
2022-09-21 21:54:13 +00:00
parent b7f0d796e4
commit edbd97705a
4 changed files with 66 additions and 15 deletions

View File

@ -1,11 +1,49 @@
# Code generated by gouick; DO NOT EDIT.
APICMD= go run cmd/{{ .AppNameKebabCase }}-server/*
CMD= env PORT=${PORT:-3000} HOST=${HOST:-0.0.0.0} $(APICMD)
{{ if eq (len .APIs) 1 }}
api:
@echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
@echo "\tLaunch API '{{ (index .APIs 0).Binary }}'"
@echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
@PORT=${PORT:-3000} HOST=${HOST:-0.0.0.0} \
go run cmd/{{ (index .APIs 0).Binary }}/*
{{ else if gt (len .APIs) 1 }}
{{- range .APIs -}}
{{.Binary}}
{{ end }}:
@echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
@echo "\tLaunch API '$@'"
@echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
@PORT=${PORT:-3000} HOST=${HOST:-0.0.0.0} \
go run cmd/$@/main.go
{{ end }}
{{- if ne (len .Workers) 0 }}
{{- range .Workers -}}
{{.Binary}}
{{ end }}:
@echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
@echo "\tLaunch worker '$@'"
@echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
@PORT=${PORT:-3000} HOST=${HOST:-0.0.0.0} \
go run cmd/$@/main.go
{{ end }}
{{- if ne (len .Crons) 0 }}
{{- range .Crons -}}
{{.Binary}}
{{ end }}:
@echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
@echo "\tLaunch cron '$@'"
@echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
@PORT=${PORT:-3000} HOST=${HOST:-0.0.0.0} \
go run cmd/$@/main.go
{{ end }}
generate:
gouick generate
@gouick generate
launch:
@$(CMD)
test:
@gouick test
.PHONY: api generate test

View File

@ -1,4 +1,5 @@
#!/bin/sh
# Code generated by gouick; DO NOT EDIT.
# 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