update
1. add makefile 2. modify dockerfile 3. add config twitch.bot_user
This commit is contained in:
parent
116c43b0cb
commit
8a4b11f92a
@ -1,7 +1,9 @@
|
||||
FROM golang:1.11-alpine3.8 as builder
|
||||
WORKDIR /go/src/git.trj.tw/golang/mtfosbot
|
||||
RUN apk add --no-cache make git
|
||||
RUN go get -u github.com/otakukaze/go-bindata/...
|
||||
COPY . .
|
||||
RUN GOOS=linux go build -o mtfosbot .
|
||||
RUN make
|
||||
|
||||
FROM alpine:latest
|
||||
RUN apk add --no-cache ca-certificates
|
||||
|
9
Makefile
Normal file
9
Makefile
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
.PHONY: clean build
|
||||
|
||||
build:
|
||||
go-bindata -pkg schema -ignore .git -o module/schema/static.go schema/
|
||||
GOOS=linux go build -o mtfosbot .
|
||||
|
||||
clean:
|
||||
rm -rf mtfosbot && go clean
|
@ -10,6 +10,7 @@ twitch:
|
||||
sub_secret: ''
|
||||
chat_host: ''
|
||||
bot_oauth: ''
|
||||
bot_user: ''
|
||||
google:
|
||||
api_key: ''
|
||||
database:
|
||||
|
@ -25,6 +25,7 @@ type Config struct {
|
||||
SubSecret string `yaml:"sub_secret"`
|
||||
ChatHost string `yaml:"chat_host"`
|
||||
BotOauth string `yaml:"bot_oauth"`
|
||||
BotUser string `yaml:"bot_user"`
|
||||
} `yaml:"twitch"`
|
||||
Google struct {
|
||||
APIKey string `yaml:"api_key"`
|
||||
|
@ -33,7 +33,7 @@ func InitIRC() {
|
||||
ReJoin()
|
||||
|
||||
config := irc.ClientConfig{
|
||||
Nick: "mtfos",
|
||||
Nick: conf.Twitch.BotUser,
|
||||
Pass: conf.Twitch.BotOauth,
|
||||
Handler: irc.HandlerFunc(ircHandle),
|
||||
}
|
||||
|
@ -43,12 +43,8 @@ func NewServ() *gin.Engine {
|
||||
|
||||
// SetRoutes - set routes
|
||||
func SetRoutes(r *gin.Engine) {
|
||||
r.NoRoute(func(c *gin.Context) {
|
||||
fmt.Println("match not route")
|
||||
c.String(404, "404 page not found")
|
||||
})
|
||||
|
||||
r.GET("/", func(c *gin.Context) {
|
||||
fmt.Println("in next")
|
||||
c.JSON(200, gin.H{
|
||||
"message": "ok",
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user