diff --git a/.air.toml b/.air.toml new file mode 100644 index 000000000..85021d922 --- /dev/null +++ b/.air.toml @@ -0,0 +1,31 @@ +root = "." +tmp_dir = "tmp" + +[build] + full_bin = "./dist/synthetic-monitoring-agent --debug --api-server-address=localhost:4031 --api-insecure=true --dev=true" + cmd = "make build" + delay = 1000 + exclude_dir = [".chglog", ".github"] + exclude_file = [] + exclude_regex = [] + exclude_unchanged = false + follow_symlink = false + include_dir = [] + include_ext = ["go"] + kill_delay = "0s" + log = "build-errors.log" + send_interrupt = true + stop_on_error = true + +[color] + app = "" + build = "yellow" + main = "magenta" + runner = "green" + watcher = "cyan" + +[log] + time = false + +[misc] + clean_on_exit = false diff --git a/.gitignore b/.gitignore index babd25d17..24bbf3308 100644 --- a/.gitignore +++ b/.gitignore @@ -87,3 +87,6 @@ tags # Local dev environment configuration files *.env + +# Files generated by air +tmp diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index fe78ffb9d..700baf677 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -23,6 +23,17 @@ The documentation for other targets is available thru: $ make help ``` +Livereload Development +---------------------- + +Install [air](https://github.com/air-verse/air?tab=readme-ov-file#installation) and ensure `SM_AGENT_API_TOKEN` is set prior to running. + +``` +$ air +``` + +Any code changes will now trigger air to rebuild the agent and run the generated executable. + Linting -------