Skip to content

Commit c589403

Browse files
authored
Merge pull request #3624 from ChayanDass/air
add air file for automatic reload
2 parents 30087c7 + b50365e commit c589403

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
backend/headlamp-server
22
backend/headlamp-server.exe
3+
backend/bin
34
backend/tools
45
backend/coverage.out
56
app/electron/src/*

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ else
106106
@cmd /c "set HEADLAMP_BACKEND_TOKEN=headlamp&& set HEADLAMP_CONFIG_ENABLE_HELM=true&& set HEADLAMP_CONFIG_ENABLE_DYNAMIC_CLUSTERS=true&& backend\headlamp-server -dev -proxy-urls https://artifacthub.io/* -listen-addr=localhost"
107107
endif
108108

109+
run-dev:
110+
@echo "Starting Headlamp backend in dev mode with Air..."
111+
cd backend && air
112+
109113
run-backend-with-metrics:
110114
@echo "**** Running backend with Prometheus metrics enabled ****"
111115
ifeq ($(UNIXSHELL),true)

backend/.air.toml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
root = "."
3+
tmp_dir = "bin"
4+
5+
[build]
6+
cmd = "go build -o ./bin/headlamp-server ./cmd"
7+
bin = "bin/headlamp-server"
8+
full_bin = ""
9+
include_ext = ["go"]
10+
exclude_dir = [ "bin"]
11+
include_dir = []
12+
exclude_file = []
13+
delay = 1000
14+
stop_on_error = true
15+
log = "air_errors.log"
16+
17+
18+
[log]
19+
time = false
20+
21+
[color]
22+
main = "magenta"
23+
watcher = "cyan"
24+
build = "yellow"
25+
runner = "green"
26+
27+
[env]
28+
HEADLAMP_BACKEND_TOKEN = "headlamp"
29+
HEADLAMP_CONFIG_ENABLE_HELM = "true"
30+
HEADLAMP_CONFIG_ENABLE_DYNAMIC_CLUSTERS = "true"
31+
32+
[run]
33+
args = ["-dev", "-proxy-urls", "https://artifacthub.io/*", "-listen-addr=localhost"]
34+
35+
[misc]
36+
clean_on_exit = true
37+

0 commit comments

Comments
 (0)