From 37f972f1510c53d3dcadb78236a4864cd71bd45e Mon Sep 17 00:00:00 2001 From: Dusan Malusev Date: Mon, 30 Sep 2024 12:54:31 +0200 Subject: [PATCH] fix(releaser): add main to goreleaser Signed-off-by: Dusan Malusev --- .gitignore | 1 + .goreleaser.yml | 14 +++++++++----- Dockerfile | 15 ++------------- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index 6a64bbb..97f5c95 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ cmd/gemini/dist/ .vscode bin/ coverage.txt +dist/ diff --git a/.goreleaser.yml b/.goreleaser.yml index 00fcaaf..b4a7e96 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -5,14 +5,18 @@ env: before: hooks: - go mod download + builds: - - + - id: gemini + ldflags: -s -w + main: ./cmd/gemini env: - CGO_ENABLED=0 goos: - linux goarch: - amd64 + archives: - name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' @@ -20,16 +24,16 @@ checksum: name_template: 'checksums.txt' snapshot: - name_template: "{{ .Tag }}-next" + name_template: '{{ .Tag }}-next' changelog: sort: asc filters: exclude: - - '^docs:' - - '^test:' + - '^docs:' + - '^test:' dockers: - image_templates: - - scylladb/gemini:{{ .Tag }} + - scylladb/gemini:{{ .Version }} - scylladb/gemini:latest diff --git a/Dockerfile b/Dockerfile index 9454a45..25b812a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,8 @@ -FROM golang:1.23 AS builder - -ENV GO111MODULE=on - -WORKDIR /gemini - -COPY . . - -RUN apt-get update && apt-get install -y libc-dev build-essential \ - && make build - -FROM busybox AS production +FROM busybox WORKDIR /gemini -COPY --from=builder /gemini/bin/gemini . +COPY gemini . ENV PATH="/gemini:${PATH}"