Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cicd): fix goreleaser config to actually publish demo docker image #2729

Merged
merged 2 commits into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
with:
distribution: goreleaser-pro
version: v1.18.2
args: release --clean --skip-announce -f .goreleaser.dev.yaml
args: release --clean --skip-announce -f .goreleaser.demo.yaml
env:
VERSION: ${{ github.ref_name}}-demo
TRACETEST_ENV: demo
Expand Down
66 changes: 66 additions & 0 deletions .goreleaser.demo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json
project_name: tracetest
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
release:
disable: true
before:
hooks:
- dir: ./server
cmd: go mod tidy
- dir: ./cli
cmd: go mod tidy
env:
- VERSION={{ if index .Env "VERSION" }}{{ .Env.VERSION }}{{ else }}dev{{ end }}
- TRACETEST_ENV={{ if index .Env "TRACETEST_ENV" }}{{ .Env.TRACETEST_ENV }}{{ else }}dev{{ end }}
- ANALYTICS_BE_KEY={{ if index .Env "ANALYTICS_BE_KEY" }}{{ .Env.ANALYTICS_BE_KEY }}{{ else }}{{ end }}
- ANALYTICS_FE_KEY={{ if index .Env "ANALYTICS_FE_KEY" }}{{ .Env.ANALYTICS_FE_KEY }}{{ else }}{{ end }}
builds:
- id: server
binary: tracetest-server
main: ./server/main.go
ldflags:
- -X github.com/kubeshop/tracetest/server/app.Version={{ .Env.VERSION }}
- -X github.com/kubeshop/tracetest/server/app.Env={{ .Env.TRACETEST_ENV }}
- -X github.com/kubeshop/tracetest/server/analytics.SecretKey={{ .Env.ANALYTICS_BE_KEY }}
- -X github.com/kubeshop/tracetest/server/analytics.FrontendKey={{ .Env.ANALYTICS_FE_KEY }}
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
- id: cli
binary: tracetest
main: ./cli/main.go
ldflags:
- -X github.com/kubeshop/tracetest/cli/config.Version={{ .Env.VERSION }}
- -X github.com/kubeshop/tracetest/cli/config.Env={{ .Env.TRACETEST_ENV }}
- -X github.com/kubeshop/tracetest/cli/analytics.SecretKey={{ .Env.ANALYTICS_BE_KEY }}
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64

dockers:
- skip_push: '{{ .Env.PUBLISH_DOCKER }}'
image_templates:
- 'kubeshop/tracetest:{{ .Env.VERSION }}'
extra_files:
- web/build
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.name={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source={{.GitURL}}"
- "--platform=linux/amd64"
goos: linux
goarch: amd64
1 change: 1 addition & 0 deletions .goreleaser.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ env:
- TRACETEST_ENV={{ if index .Env "TRACETEST_ENV" }}{{ .Env.TRACETEST_ENV }}{{ else }}dev{{ end }}
- ANALYTICS_BE_KEY={{ if index .Env "ANALYTICS_BE_KEY" }}{{ .Env.ANALYTICS_BE_KEY }}{{ else }}{{ end }}
- ANALYTICS_FE_KEY={{ if index .Env "ANALYTICS_FE_KEY" }}{{ .Env.ANALYTICS_FE_KEY }}{{ else }}{{ end }}

builds:
- id: server
binary: tracetest-server
Expand Down