Skip to content

Commit

Permalink
spread/build/package-and-repo: support for both amazonlinux:2 and 2023
Browse files Browse the repository at this point in the history
Update the task to support both amazonlinux:2 and amazonlinux:2023.

Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
  • Loading branch information
bboozzoo committed Jun 7, 2024
1 parent ffd2365 commit 3106cf7
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions spread/build/package-and-repo/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,25 @@ artifacts:
- rpmbuild/RPMS
- rpmbuild/SRPMS
- rpmbuild/SOURCES
- amazon-linux-2-repo.tar.xz
- amazon-linux-*

prepare: |
yum-builddep -y "$PWD/snapd.spec"
yum-builddep -y "$SPREAD_PATH/snapd.spec"
execute: |
TARGET=
case "$SPREAD_SYSTEM" in
amazon-linux-2-*)
TARGET=amazonlinux:2
;;
amazon-linux-2023-*)
TARGET=amazonlinux:2023
;;
*)
echo "unsupported $SPREAD_SYSTEM"
exit 1
;;
esac
# shellcheck disable=SC2046
wget $(rpmspec -P "$SPREAD_PATH/snapd.spec" | awk '/^Source[0-9]+: +https:/ { print $2 }')
cp -av "$SPREAD_PATH/snapd.spec" .
Expand All @@ -18,4 +31,4 @@ execute: |
done
IN_CONTAINER=1 "$SPREAD_PATH/tool" build
IN_CONTAINER=1 "$SPREAD_PATH/tool" createrepo
tar -cJv repo > amazon-linux-2-repo.tar.xz
TARGET="$TARGET" IN_CONTAINER=1 "$SPREAD_PATH/tool" pack

0 comments on commit 3106cf7

Please sign in to comment.