Compare commits

...

6 Commits

Author SHA1 Message Date
8b33936d0b
Privileged docker
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is pending
2025-04-01 16:35:40 +01:00
6163d63424
Publish docker image
Some checks failed
continuous-integration/drone/push Build is failing
2025-04-01 16:23:59 +01:00
5eb9013f9d
Publish docker image
All checks were successful
continuous-integration/drone/push Build is passing
2025-04-01 16:22:16 +01:00
2462aed8af
Publish docker image
All checks were successful
continuous-integration/drone/push Build is passing
2025-04-01 16:00:08 +01:00
fda5f36c9b
go test ./...
All checks were successful
continuous-integration/drone/push Build is passing
2025-04-01 15:43:24 +01:00
b8c844663f
Add drone config
Some checks failed
continuous-integration/drone/push Build is failing
2025-03-31 01:24:34 +01:00
3 changed files with 31 additions and 4 deletions

View File

@ -1,9 +1,22 @@
kind: pipeline kind: pipeline
type: docker
name: default name: default
steps: steps:
- name: test - name: test
image: golang image: golang:1.23
commands: commands:
- go test - go test ./...
- go build - name: build docker image
image: plugins/docker
privileged: true
settings:
username:
from_secret: registry_username
password:
from_secret: registry_password
repo: malmal200/treerazer
tags:
- latest
- main
registry: git.malmal200.xyz

14
Dockerfile Normal file
View File

@ -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"]

View File

@ -78,7 +78,7 @@ func roll(opts optionMap) string {
if err != nil { if err != nil {
return fmt.Sprintf("Error rolling dice: %s", err) return fmt.Sprintf("Error rolling dice: %s", err)
} }
total := 0 total := d.Add
for i, die := range roll { for i, die := range roll {
_, err = fmt.Fprintf(&ret, "%v", die.Result) _, err = fmt.Fprintf(&ret, "%v", die.Result)
if err != nil { if err != nil {