Skip to content

Commit

Permalink
Auto generated from templates by gromit
Browse files Browse the repository at this point in the history
  • Loading branch information
Gromit committed Oct 24, 2024
1 parent c2e59fe commit c043c76
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 71 deletions.
55 changes: 25 additions & 30 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ jobs:
with:
mask-password: 'true'
- name: Docker metadata for CI
id: ci_metadata
id: ci_metadata_
if: ${{ matrix.golang_cross == '1.21-bookworm' }}
uses: docker/metadata-action@v5
with:
Expand All @@ -157,10 +157,12 @@ jobs:
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.ci_metadata.outputs.tags }}
tags: ${{ steps.ci_metadata_.outputs.tags }}
labels: ${{ steps.tag_metadata.outputs.labels }}
build-args: |
EDITION=
- name: Docker metadata for tag push
id: tag_metadata
id: tag_metadata_
uses: docker/metadata-action@v5
with:
images: |
Expand All @@ -185,8 +187,10 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max
push: ${{ startsWith(github.ref, 'refs/tags') }}
tags: ${{ steps.tag_metadata.outputs.tags }}
labels: ${{ steps.tag_metadata.outputs.labels }}
tags: ${{ steps.tag_metadata_.outputs.tags }}
labels: ${{ steps.tag_metadata_.outputs.labels }}
build-args: |
EDITION=
- name: save deb
uses: actions/upload-artifact@v4
if: ${{ matrix.golang_cross == '1.21-bookworm' }}
Expand Down Expand Up @@ -302,32 +306,9 @@ jobs:
repository: TykTechnologies/tyk-analytics
path: tyk-analytics
token: ${{ secrets.ORG_GH_TOKEN }}
fetch-depth: 0
fetch-depth: 1
ref: ${{ env.BASE_REF }}
sparse-checkout: tests/api
- name: Choosing test code branch
working-directory: tyk-analytics/tests/api
run: |
if [[ ${{ github.event_name }} == "pull_request" ]]; then
PR_BRANCH=${{ github.event.pull_request.head.ref }}
TARGET_BRANCH=${{ github.event.pull_request.base.ref }}
echo "Looking for PR_BRANCH:$PR_BRANCH or TARGET_BRANCH:$TARGET_BRANCH..."
if git rev-parse --verify "origin/$PR_BRANCH" >/dev/null 2>&1; then
echo "PR branch $PR_BRANCH exists. Checking out..."
git checkout "$PR_BRANCH"
elif git rev-parse --verify "origin/$TARGET_BRANCH" >/dev/null 2>&1; then
echo "Target branch $TARGET_BRANCH exists. Checking out..."
git checkout "$TARGET_BRANCH"
fi
fi
if [[ ${{ github.event_name }} == "push" ]]; then
PUSH_BRANCH=${{ github.ref_name }}
echo "Looking for PUSH_BRANCH:$PUSH_BRANCH..."
if git rev-parse --verify "origin/$PUSH_BRANCH" >/dev/null 2>&1; then
echo "Push branch $PUSH_BRANCH exists. Checking out..."
git checkout "$PUSH_BRANCH"
fi
fi
echo "Current commit: $(git rev-parse HEAD)"
- uses: actions/setup-python@v5
with:
cache: 'pip'
Expand Down Expand Up @@ -356,6 +337,20 @@ jobs:
USER_API_SECRET=${{ steps.env_up.outputs.USER_API_SECRET }}
EOF
env $(cat pytest.env | xargs) $pytest -m "${{ matrix.envfiles.apimarkers }}"
- name: Upload Playwright Test Report to S3
if: failure() && steps.test_execution.outcome != 'success' && steps.env_up.outcome == 'success'
run: npm run upload_report_to_s3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.UI_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.UI_AWS_SECRET_ACCESS_KEY }}
RUN_ID: 'tyk-analytics/${{ github.run_id }}'
working-directory: tyk-analytics/tests/ui
- name: Share S3 report link into summary
if: failure() && steps.test_execution.outcome != 'success' && steps.env_up.outcome == 'success'
run: |
echo "# :clipboard: S3 UI Test REPORT: ${{ matrix.envfiles.db }}-${{ matrix.envfiles.conf }}" >> $GITHUB_STEP_SUMMARY
echo "- Status: ${{ steps.test_execution.outcome == 'success' && ':white_check_mark:' || ':no_entry_sign:' }}" >> $GITHUB_STEP_SUMMARY
echo "- [Link to report](https://tyk-qa-reports.s3.eu-central-1.amazonaws.com/tyk-analytics/${{ github.run_id }}/index.html)" >> $GITHUB_STEP_SUMMARY
- name: Generate metadata and upload test reports
id: metadata_report
if: always() && (steps.test_execution.conclusion != 'skipped')
Expand Down
3 changes: 2 additions & 1 deletion ci/Dockerfile.distroless
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

FROM debian:bookworm-slim as DEB
ARG TARGETARCH
ARG EDITION

ENV DEBIAN_FRONTEND=noninteractive

COPY *${TARGETARCH}.deb /
RUN rm -f /*fips*.deb && dpkg -i /tyk-pump*${TARGETARCH}.deb && rm /*.deb
RUN rm -f /*fips*.deb && dpkg -i /tyk-pump${EDITION}_*${TARGETARCH}.deb && rm /*.deb

FROM gcr.io/distroless/static-debian12:nonroot

Expand Down
40 changes: 0 additions & 40 deletions ci/goreleaser/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,46 +71,6 @@ nfpms:
signature:
key_file: tyk.io.signing.key
type: origin
- id: fips
vendor: "Tyk Technologies Ltd"
homepage: "https://tyk.io"
maintainer: "Tyk <[email protected]>"
description: Tyk Analytics Pump to move analytics data from Redis to any supported back end (multiple back ends can be written to at once).
package_name: tyk-pump-fips
file_name_template: "{{ .ConventionalFileName }}"
builds:
- fips
formats:
- deb
- rpm
contents:
- src: "README.md"
dst: "/opt/share/docs/tyk-pump/README.md"
- src: "ci/install/*"
dst: "/opt/tyk-pump/install"
- src: ci/install/inits/systemd/system/tyk-pump.service
dst: /lib/systemd/system/tyk-pump.service
- src: ci/install/inits/sysv/init.d/tyk-pump
dst: /etc/init.d/tyk-pump
- src: "LICENSE.md"
dst: "/opt/share/docs/tyk-pump/LICENSE.md"
- src: pump.example.conf
dst: /opt/tyk-pump/pump.conf
type: "config|noreplace"
scripts:
preinstall: "ci/install/before_install.sh"
postinstall: "ci/install/post_install.sh"
postremove: "ci/install/post_remove.sh"
bindir: "/opt/tyk-pump"
rpm:
scripts:
posttrans: ci/install/post_trans.sh
signature:
key_file: tyk.io.signing.key
deb:
signature:
key_file: tyk.io.signing.key
type: origin
publishers:
- name: tyk-pump-unstable
env:
Expand Down

0 comments on commit c043c76

Please sign in to comment.