Skip to content

Commit

Permalink
fix(cicd): fix goreleaser config to actually publish demo docker image (
Browse files Browse the repository at this point in the history
  • Loading branch information
schoren committed Jun 13, 2023
1 parent f0c3ce0 commit 4a2b7fa
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-demo.yml
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
@@ -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
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

0 comments on commit 4a2b7fa

Please sign in to comment.