Skip to content

Commit

Permalink
Run versionsapi through Bazel instead of building a container
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Weiße <[email protected]>
  • Loading branch information
daniel-weisse committed Jul 3, 2024
1 parent 20269ab commit 4a1a10a
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 61 deletions.
3 changes: 3 additions & 0 deletions .github/actions/find_latest_image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ runs:
role-to-assume: arn:aws:iam::795746500882:role/GithubConstellationVersionsAPIRead
aws-region: eu-central-1

- name: Setup Bazel & Nix
uses: ./.github/actions/setup_bazel_nix

- name: Find latest image
id: find-latest-image
if: inputs.imageVersion == ''
Expand Down
4 changes: 4 additions & 0 deletions .github/actions/select_image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ runs:
echo "ref=$(echo $REFSTREAM | cut -d/ -f2)" | tee -a "$GITHUB_OUTPUT"
echo "stream=$(echo $REFSTREAM | cut -d/ -f4)" | tee -a "$GITHUB_OUTPUT"
- name: Setup Bazel & Nix
if: steps.input-is-preset.outputs.result == 'true'
uses: ./.github/actions/setup_bazel_nix

- name: Find latest image
if: steps.input-is-preset.outputs.result == 'true'
id: find-latest-image
Expand Down
21 changes: 0 additions & 21 deletions .github/actions/versionsapi/Dockerfile

This file was deleted.

9 changes: 1 addition & 8 deletions .github/actions/versionsapi/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,12 @@ outputs:
runs:
using: composite
steps:
- name: Get versionsapi binary
shell: bash
# TODO: This should probably be `bazel run`.
run: |
containerID=$(docker create "ghcr.io/edgelesssys/constellation/versionsapi-ci-cli:latest")
docker cp ${containerID}:/versionsapi .
- name: Run versionsapi
id: run
shell: bash
run: |
out=$(
./versionsapi \
bazel run //internal/api/versionsapi/cli:cli -- \
${{ inputs.command }} \
${{ inputs.ref != '' && format('--ref="{0}"', inputs.ref) || '' }} \
${{ inputs.stream != '' && format('--stream="{0}"', inputs.stream) || '' }} \
Expand Down
32 changes: 0 additions & 32 deletions .github/workflows/build-versionsapi-ci-image.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .github/workflows/purge-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ jobs:
;;
esac
- uses: ./.github/actions/setup_bazel_nix

- name: List versions
id: list
uses: ./.github/actions/versionsapi
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/versionsapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ jobs:
with:
service_account: "[email protected]"

- uses: ./.github/actions/setup_bazel_nix

- name: Execute versionsapi CLI
id: run
uses: ./.github/actions/versionsapi
Expand Down

0 comments on commit 4a1a10a

Please sign in to comment.