Skip to content

Commit

Permalink
ci: subiquity-check check stage-packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris-Peterson444 committed Sep 20, 2024
1 parent 4df18dd commit e438480
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions scripts/subiquity-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,25 @@ done
if [ "$has_mismatch" = true ]; then
echo "Commit mismatch detected. Please update the dependency commit hashes in snap/snapcraft.yaml"
exit 1
else
echo "Dependency check passed."
fi

BOOTSTRAP_PARTS_OUTPUT="bootstrap_parts.txt"
SUBIQUITY_PARTS_OUTPUT="subiquity_parts.txt"

yq -r '.parts["subiquitydeps"]["stage-packages"]' snap/snapcraft.yaml > $BOOTSTRAP_PARTS_OUTPUT
curl -sL https://github.com/canonical/subiquity/raw/$SUBIQUITY_COMMIT/snapcraft.yaml | yq -r '.parts["subiquity"]["stage-packages"]' > $SUBIQUITY_PARTS_OUTPUT

DEP_DIFF=$(diff bootstrap_parts.txt subiquity_parts.txt --unified)

rm $BOOTSTRAP_PARTS_OUTPUT
rm $SUBIQUITY_PARTS_OUTPUT

if [[ -n "$DEP_DIFF" ]]; then
echo "Difference in stage-packages detected:"
printf "%s\n\n" "$DEP_DIFF"
echo "Please update parts.subiquitydeps.stage-packages in snap/snapcraft.yaml"
exit 1
fi


echo "Dependency check passed."

0 comments on commit e438480

Please sign in to comment.