Skip to content

Commit

Permalink
Use 'tested' aggregate job (#131)
Browse files Browse the repository at this point in the history
* Use 'tested' aggregate job

What we were doing before was slightly incorrect. We'd upload AMIs
for NixOS evals that wouldn't end up as channel bumps.

By using the 'tested' job (like https://status.nixos.org) we actually
upload the correct thing

* Shellcheck
  • Loading branch information
arianvp authored May 22, 2024
1 parent 6d2f8f0 commit 4a1353a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/upload-legacy-ami.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ jobs:
id: download_ami
run: |
set -o pipefail
out=$(curl --location --silent --fail-with-body --header 'Accept: application/json' https://hydra.nixos.org/job/nixos/${{ matrix.release }}/nixos.amazonImage.${{ matrix.system }}/latest-finished | jq --raw-output '.buildoutputs.out.path')
build_id=$(curl -sSL -H 'Accept: application/json' https://hydra.nixos.org/job/nixos/${{ matrix.release }}/tested/latest-finished | jq -r '.id')
out=$(curl -sSL -H 'Accept: application/json' "https://hydra.nixos.org/build/${build_id}/constituents" | jq -r '.[] | select(.job == "nixos.amazonImage.${{ matrix.system }}") | .buildoutputs.out.path')
nix-store --realise "$out" --add-root ./result
echo "image_info=$out/nix-support/image-info.json" >> "$GITHUB_OUTPUT"
Expand All @@ -62,15 +63,13 @@ jobs:
run: |
image_ids='${{ steps.upload_smoke_test_ami.outputs.image_ids }}'
image_id=$(echo "$image_ids" | jq -r '.["${{ vars.AWS_REGION }}"]')
run_id='${{ github.run_id }}'
nix run .#smoke-test -- --image-id "$image_id"
- name: Clean up smoke test
if: ${{ cancelled() }}
run: |
image_ids='${{ steps.upload_smoke_test_ami.outputs.image_ids }}'
image_id=$(echo "$image_ids" | jq -r '.["${{ vars.AWS_REGION }}"]')
run_id='${{ github.run_id }}'
nix run .#smoke-test -- --image-id "$image_id" --cancel
# NOTE: We do not pass run-id as we're not building the image ourselves
Expand Down

0 comments on commit 4a1353a

Please sign in to comment.