diff --git a/.drone.yml b/.drone.yml index 126ce13..4df842a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,9 +1,9 @@ kind: pipeline +type: docker name: default steps: - name: test - image: golang + image: golang:1.23 commands: - - go test - - go build \ No newline at end of file + - go test ./... \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6b436d6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM golang:1.23 +LABEL authors="malmal200" + +WORKDIR /app + +COPY go.mod go.sum ./ +RUN go mod download + +COPY dice/*.go ./dice/ +COPY application/*.go ./application/ + +RUN CGO_ENABLED=0 GOOS=linux go build -o /go-bot ./application + +ENTRYPOINT ["/go-bot"] \ No newline at end of file diff --git a/application/commands.go b/application/commands.go index d1fd569..a6783fc 100644 --- a/application/commands.go +++ b/application/commands.go @@ -78,7 +78,7 @@ func roll(opts optionMap) string { if err != nil { return fmt.Sprintf("Error rolling dice: %s", err) } - total := 0 + total := d.Add for i, die := range roll { _, err = fmt.Fprintf(&ret, "%v", die.Result) if err != nil {