Skip to content

Commit

Permalink
Updated: air support
Browse files Browse the repository at this point in the history
  • Loading branch information
capcom6 committed Dec 28, 2023
1 parent 025f8a8 commit d7b5ca1
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 10 deletions.
13 changes: 5 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,11 @@ init: init-dev
go mod download \
&& go install github.com/cosmtrek/air@latest

air:
air
air-monitor:
CONFIG_PATH=./configs/monitor.yml air -c monitor.air.toml

db-upgrade:
goose up

db-upgrade-raw:
go run ./cmd/$(project_name)/main.go db-upgrade
air-bot:
CONFIG_PATH=./configs/bot.yml air -c bot.air.toml

test:
go test ./...
Expand All @@ -52,4 +49,4 @@ docker:
docker-dev:
docker-compose -f deployments/docker-compose/docker-compose.dev.yml up --build

.PHONY: run monitor bot init-dev init air db-upgrade db-upgrade-raw test api-docs view-docs docker docker-dev
.PHONY: run monitor bot init-dev init air-monitor air-bot test api-docs view-docs docker-build docker
4 changes: 2 additions & 2 deletions .air.toml → bot.air.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ testdata_dir = "testdata"
tmp_dir = "tmp"

[build]
bin = "tmp/main.exe"
cmd = "go build -o ./tmp/main.exe ./cmd/service-monitor-tgbot"
bin = "tmp/bot.exe"
cmd = "go build -o ./tmp/bot.exe ./cmd/bot"
delay = 1000
exclude_dir = ["api", "assets", "tmp", "vendor", "testdata", "tmp"]
exclude_file = []
Expand Down
36 changes: 36 additions & 0 deletions monitor.air.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
root = "."
testdata_dir = "testdata"
tmp_dir = "tmp"

[build]
bin = "tmp/monitor.exe"
cmd = "go build -o ./tmp/monitor.exe ./cmd/monitor"
delay = 1000
exclude_dir = ["api", "assets", "tmp", "vendor", "testdata", "tmp"]
exclude_file = []
exclude_regex = ["_test.go"]
exclude_unchanged = false
follow_symlink = false
full_bin = ""
include_dir = []
include_ext = ["go", "tpl", "tmpl", "html", "yml"]
kill_delay = "1s"
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 = true

[screen]
clear_on_rebuild = true

0 comments on commit d7b5ca1

Please sign in to comment.