Use goreleaser
This commit is contained in:
parent
cbe049a53d
commit
2610c2614a
4 changed files with 48 additions and 14 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -209,3 +209,5 @@ static/js/app.min.js
|
|||
storage/
|
||||
docs/
|
||||
templates/openapi/
|
||||
|
||||
dist/
|
||||
|
|
37
.goreleaser.yaml
Normal file
37
.goreleaser.yaml
Normal file
|
@ -0,0 +1,37 @@
|
|||
before:
|
||||
hooks:
|
||||
- go mod tidy
|
||||
builds:
|
||||
- env:
|
||||
- CGO_ENABLED=0
|
||||
goos:
|
||||
- linux
|
||||
- windows
|
||||
- darwin
|
||||
dockers:
|
||||
- image_templates:
|
||||
- "ghcr.io/flohoss/godash:latest"
|
||||
- "ghcr.io/flohoss/godash:v{{ .Major }}"
|
||||
- "ghcr.io/flohoss/godash:{{ .Tag }}"
|
||||
archives:
|
||||
- format: tar.gz
|
||||
name_template: >-
|
||||
{{ .ProjectName }}_
|
||||
{{- title .Os }}_
|
||||
{{- if eq .Arch "amd64" }}x86_64
|
||||
{{- else if eq .Arch "386" }}i386
|
||||
{{- else }}{{ .Arch }}{{ end }}
|
||||
{{- if .Arm }}v{{ .Arm }}{{ end }}
|
||||
format_overrides:
|
||||
- goos: windows
|
||||
format: zip
|
||||
checksum:
|
||||
name_template: "checksums.txt"
|
||||
snapshot:
|
||||
name_template: "{{ incpatch .Version }}-next"
|
||||
changelog:
|
||||
sort: asc
|
||||
filters:
|
||||
exclude:
|
||||
- "^docs:"
|
||||
- "^test:"
|
21
Dockerfile
21
Dockerfile
|
@ -1,9 +1,5 @@
|
|||
FROM golang:alpine AS go
|
||||
RUN apk add nodejs npm
|
||||
WORKDIR /backend
|
||||
|
||||
COPY ./go.mod .
|
||||
RUN go mod download
|
||||
FROM node:alpine AS build
|
||||
WORKDIR /build
|
||||
|
||||
COPY ./package.json .
|
||||
COPY ./package-lock.json .
|
||||
|
@ -11,7 +7,6 @@ RUN npm install
|
|||
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
RUN go build -o app
|
||||
|
||||
FROM alpine AS logo
|
||||
RUN apk add figlet
|
||||
|
@ -29,14 +24,14 @@ COPY entrypoint.sh .
|
|||
RUN chmod +x entrypoint.sh
|
||||
|
||||
# default config.yaml
|
||||
COPY --from=go /backend/bookmarks/config.yaml ./bookmarks/config.yaml
|
||||
COPY --from=build /build/bookmarks/config.yaml ./bookmarks/config.yaml
|
||||
# go templates
|
||||
COPY --from=go /backend/templates/ ./templates/
|
||||
COPY --from=build /build/templates/ ./templates/
|
||||
# build static files and favicons
|
||||
COPY --from=go /backend/static/favicon/ ./static/favicon/
|
||||
COPY --from=go /backend/static/css/style.css ./static/css/style.css
|
||||
COPY --from=go /backend/static/js/app.min.js ./static/js/app.min.js
|
||||
COPY --from=build /build/static/favicon/ ./static/favicon/
|
||||
COPY --from=build /build/static/css/style.css ./static/css/style.css
|
||||
COPY --from=build /build/static/js/app.min.js ./static/js/app.min.js
|
||||
# go executable
|
||||
COPY --from=go /backend/app .
|
||||
COPY godash .
|
||||
|
||||
ENTRYPOINT ["/app/entrypoint.sh"]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
cat logo.txt
|
||||
APP=app
|
||||
APP=godash
|
||||
|
||||
if [ -n "$PUID" ] || [ -n "$PGID" ]; then
|
||||
USER=appuser
|
||||
|
|
Loading…
Add table
Reference in a new issue