CI pipeline
This commit is contained in:
parent
bae23a4712
commit
8776953b54
@ -1,9 +1,9 @@
|
|||||||
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
|
|
||||||
14
Dockerfile
Normal file
14
Dockerfile
Normal 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"]
|
||||||
@ -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 {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user