mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
add debug command for environment. add docker up/down to Makefile
This commit is contained in:
parent
f67b267933
commit
05d49e9577
6
Makefile
6
Makefile
|
@ -28,6 +28,12 @@ build:
|
|||
run:
|
||||
./bin/${BINARY_NAME} -env="prod"
|
||||
|
||||
up:
|
||||
docker compose up
|
||||
|
||||
down:
|
||||
docker compose down
|
||||
|
||||
prod:
|
||||
cd cmd/nourybot && go build -o ${BINARY_NAME}
|
||||
mv cmd/nourybot/${BINARY_NAME} ./bin/${BINARY_NAME}
|
||||
|
|
|
@ -200,6 +200,10 @@ func (app *application) handleCommand(message twitch.PrivateMessage) {
|
|||
if userLevel >= 100 {
|
||||
app.DebugCommand(cmdParams[2], message)
|
||||
}
|
||||
case "env":
|
||||
if userLevel >= 100 {
|
||||
reply = app.Environment
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------
|
||||
|
|
|
@ -41,6 +41,7 @@ type application struct {
|
|||
Db *sql.DB
|
||||
Models data.Models
|
||||
Scheduler *cron.Cron
|
||||
Environment string
|
||||
// Rdb *redis.Client
|
||||
}
|
||||
|
||||
|
@ -122,6 +123,7 @@ func main() {
|
|||
Db: db,
|
||||
Models: data.NewModels(db),
|
||||
Scheduler: cron.New(),
|
||||
Environment: cfg.env,
|
||||
}
|
||||
|
||||
app.Log.Infow("db.Stats",
|
||||
|
|
Loading…
Reference in a new issue