Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions .github/workflows/image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,31 @@ jobs:
platforms: linux/${{ matrix.platform }}
dockerfile_path: './Dockerfile'
build_args: TASKBROKER_GIT_REVISION=${{ github.sha }}
ghcr: true
ghcr: ${{ github.event.pull_request.head.repo.fork == false }}
tag_suffix: -${{ matrix.platform }}
publish_on_pr: true
google_ar: false
tag_nightly: false
tag_latest: false
tags: ${{ github.event_name == 'pull_request' && 'ghcr.io/getsentry/taskbroker:nightly' || ''}}
outputs: ${{ github.event_name == 'pull_request' && 'type=docker' || ''}}

- name: Save Docker image to artifact
if: ${{ github.event_name == 'pull_request' }}
run: docker save -o /tmp/taskbroker.tar ghcr.io/getsentry/taskbroker:nightly

- name: Upload artifact for self-hosted e2e
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: ${{ github.event_name == 'pull_request' }}
with:
name: taskbroker-${{ matrix.platform }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if there are two pull requests open at the same time? Could they conflict over this name?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. Github artifact is unique per commit run.

path: /tmp/taskbroker.tar
if-no-files-found: error
retention-days: 1

assemble-taskbroker-image:
runs-on: ubuntu-latest
needs: [build]
if: ${{ (github.ref_name == 'main' || startsWith(github.ref_name, 'releases/')) && github.event_name != 'pull_request' }}
permissions:
contents: read
packages: write
Expand All @@ -53,6 +67,7 @@ jobs:
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0

- name: Create multiplatform manifests
if: ${{ (github.ref_name == 'main' || startsWith(github.ref_name, 'releases/')) && github.event_name != 'pull_request' }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't we run the first two steps in this workflow all the time now?

run: |
docker buildx imagetools create \
--tag ghcr.io/getsentry/taskbroker:${{ github.event.pull_request.head.sha || github.sha }} \
Expand Down Expand Up @@ -91,6 +106,19 @@ jobs:
timeout-minutes: 30

steps:
- name: Download artifact for pull request
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
if: ${{ github.event_name == 'pull_request' }}
with:
name: taskbroker-amd64
path: /tmp/

- name: Load Docker image from tar file
if: ${{ github.event_name == 'pull_request' }}
run: |
docker image load --input /tmp/taskbroker.tar
docker image tag ghcr.io/getsentry/taskbroker:nightly ghcr.io/getsentry/taskbroker:${{ github.sha }}

- name: Run Sentry self-hosted e2e CI
uses: getsentry/self-hosted@master
with:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# recent enough version of protobuf-compiler
FROM rust:1-bookworm AS build

RUN apt-get update && apt-get upgrade -y
RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y cmake pkg-config libssl-dev librdkafka-dev protobuf-compiler

RUN USER=root cargo new --bin taskbroker
Expand Down
Loading