Skip to content

Commit

Permalink
fix(cicd): make pull request pipeline work as expected for push to ma…
Browse files Browse the repository at this point in the history
…in (#2730)
  • Loading branch information
schoren committed Jun 14, 2023
1 parent 4a2b7fa commit 75d7384
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/pull-request.yaml
Expand Up @@ -7,10 +7,10 @@ on:
branches: [main]

env:
VERSION: pr-${{ github.event.pull_request.number }}
TAG: pr-${{ github.event.pull_request.number }}
VERSION: ${{ github.sha }}
TAG: latest

TRACETEST_ENV: pr
TRACETEST_ENV: ci
TRACETEST_DEV: true
CYPRESS_BASE_URL: http://localhost:11633
POKEMON_HTTP_ENDPOINT: http://demo-api:8081
Expand Down Expand Up @@ -199,7 +199,7 @@ jobs:
- name: Export docker image
if: steps.cache-docker-build.outputs.cache-hit != 'true'
run: |
docker save --output dist/image.tar "kubeshop/tracetest:$VERSION"
docker save --output dist/image.tar "kubeshop/tracetest:$TAG"
- name: Upload assets
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -333,7 +333,6 @@ jobs:
export TRACETEST_CLI=$PWD/dist/tracetest
export TEST_ENVIRONMENT=jaeger
export TAG=pr-${{ github.event.pull_request.number }}
cd ./testing/cli-e2etest
make test
Expand Down
4 changes: 3 additions & 1 deletion .goreleaser.dev.yaml
Expand Up @@ -16,6 +16,8 @@ before:
cmd: go mod tidy
env:
- VERSION={{ if index .Env "VERSION" }}{{ .Env.VERSION }}{{ else }}dev{{ end }}
# if TAG is defined, use it. Fallback to VERSION
- TAG={{ if index .Env "TAG" }}{{ .Env.TAG }}{{ else }}{{ .Env.VERSION }}{{ 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 }}
Expand Down Expand Up @@ -52,7 +54,7 @@ builds:
dockers:
- skip_push: true
image_templates:
- 'kubeshop/tracetest:{{ .Env.VERSION }}'
- 'kubeshop/tracetest:{{ .Env.TAG }}'
extra_files:
- web/build
build_flag_templates:
Expand Down

0 comments on commit 75d7384

Please sign in to comment.