Skip to content

Commit

Permalink
ci: rpm repository for all versions and aarch64 (#4077)
Browse files Browse the repository at this point in the history
Co-authored-by: Franco Gil <45880759+realFranco@users.noreply.github.com>
  • Loading branch information
afdesk and realFranco committed May 14, 2023
1 parent 0009b02 commit ff63748
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions ci/deploy-rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@

TRIVY_VERSION=$(find dist/ -type f -name "*64bit.rpm" -printf "%f\n" | head -n1 | sed -nre 's/^[^0-9]*(([0-9]+\.)*[0-9]+).*/\1/p')

function create_common_rpm_repo () {
rpm_path=$1

ARCHES=("x86_64" "aarch64")
for arch in ${ARCHES[@]}; do
prefix=$arch
if [ "$arch" == "x86_64" ]; then
prefix="64bit"
elif [ "$arch" == "aarch64" ]; then
prefix="ARM64"
fi

mkdir -p $rpm_path/$arch
cp ../dist/*${prefix}.rpm ${rpm_path}/$arch/
createrepo_c -u https://github.com/aquasecurity/trivy/releases/download/ --location-prefix="v"$TRIVY_VERSION --update $rpm_path/$arch
rm ${rpm_path}/$arch/*${prefix}.rpm
done
}

function create_rpm_repo () {
version=$1
rpm_path=rpm/releases/${version}/x86_64
Expand All @@ -18,6 +37,9 @@ echo "Create RPM releases for Trivy v$TRIVY_VERSION"

cd trivy-repo

echo "Processing common repository for RHEL/CentOS..."
create_common_rpm_repo rpm/releases

VERSIONS=(5 6 7 8 9)
for version in ${VERSIONS[@]}; do
echo "Processing RHEL/CentOS $version..."
Expand Down

0 comments on commit ff63748

Please sign in to comment.