mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
If we're on a branch other than main or dev, then when building "nightly",
build it with the name of the branch instead. Overrideable via an env var.
It's a bit ugly because of limitations of goreleaser templating, we can't haul
the expression out to be defined once, but it works.
Can build a custom Docker image with:
goreleaser release --snapshot -p 2 -f .goreleaser-nightly.yml --clean
36 lines
1.2 KiB
YAML
36 lines
1.2 KiB
YAML
project_name: nats-server
|
|
|
|
builds:
|
|
- main: .
|
|
id: nats-server
|
|
binary: nats-server
|
|
ldflags:
|
|
- -w -X github.com/nats-io/nats-server/v2/server.gitCommit={{.ShortCommit}}
|
|
env:
|
|
- GO111MODULE=on
|
|
- CGO_ENABLED=0
|
|
goos:
|
|
- linux
|
|
goarch:
|
|
- amd64
|
|
|
|
dockers:
|
|
- goos: linux
|
|
goarch: amd64
|
|
skip_push: true
|
|
dockerfile: docker/Dockerfile.nightly
|
|
build_flag_templates:
|
|
- '--build-arg=VERSION={{ if index .Env "IMAGE_NAME" }}{{ .Env.IMAGE_NAME }}{{ else if not (eq .Branch "main" "dev" "") }}{{ replace .Branch "/" "-" }}{{ else }}nightly{{ end }}-{{ time "20060102" }}'
|
|
image_templates:
|
|
- synadia/nats-server:{{.Version}}
|
|
- synadia/nats-server:{{ if index .Env "IMAGE_NAME" }}{{ .Env.IMAGE_NAME }}{{ else if not (eq .Branch "main" "dev" "") }}{{ replace .Branch "/" "-" }}{{ else }}nightly{{ end }}
|
|
extra_files:
|
|
- docker/nats-server.conf
|
|
|
|
checksum:
|
|
name_template: "SHA256SUMS"
|
|
algorithm: sha256
|
|
|
|
snapshot:
|
|
name_template: '{{ if index .Env "IMAGE_NAME" }}{{ .Env.IMAGE_NAME }}{{ else if not (eq .Branch "main" "dev" "") }}{{ replace .Branch "/" "-" }}{{ else }}nightly{{ end }}-{{ time "20060102" }}'
|