Auto reload
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Kekskurse 2021-11-09 17:20:18 +01:00
parent 37741ec415
commit 4c1e35e9e4
Signed by: kekskurse
GPG Key ID: 728ACCB59341E7E4
5 changed files with 47 additions and 8 deletions

32
.air.toml Normal file
View File

@ -0,0 +1,32 @@
root = "."
tmp_dir = "tmp"
[build]
bin = "./tmp/main run"
cmd = "go build -o ./tmp/main ."
delay = 1000
exclude_dir = ["assets", "tmp", "vendor"]
exclude_file = []
exclude_regex = []
exclude_unchanged = false
follow_symlink = false
full_bin = ""
include_dir = []
include_ext = ["go", "tpl", "tmpl", "html"]
kill_delay = "0s"
log = "build-errors.log"
send_interrupt = false
stop_on_error = true
[color]
app = ""
build = "yellow"
main = "magenta"
runner = "green"
watcher = "cyan"
[log]
time = false
[misc]
clean_on_exit = false

3
.gitignore vendored
View File

@ -1,3 +1,4 @@
.idea/
go-sample-webpage
webapp
webapp
tmp/

View File

@ -4,4 +4,7 @@ build:
init-dev:
docker-compose up -d
sleep 30
go run ./ migrate
go run ./ migrate
run-dev:
air

View File

@ -26,7 +26,13 @@ Its possitlbe to execute the migrations via `go run ./ migrate`. It execute the
Everything (include templaes and migration) can be added in one binary
## Make commands
*todo*
* build -> Build webapp
* init-dev -> Start docker copose
* run-dev -> Run Webapp with reload if someting is change (air)
## Docker Image
https://hub.docker.com/r/kekskurse/go-sample-webpage
# Dev
@ -41,7 +47,4 @@ Alles ist in einem binary
# next steps
* conifg per env
* makefile
* ci/Cd bis docker image bauen
* Hot reload while develop
* conifg per env

View File

@ -1,4 +1,4 @@
<h1>
Hello {{ .title }}
Hello {{ .title }}!
</h1>