From ff0c4516dbfe94dd457ce0185dad099e1cdc6574 Mon Sep 17 00:00:00 2001 From: afdesk Date: Sun, 15 Jan 2023 15:59:18 +0600 Subject: [PATCH] ci: store URLs to Github Releases in RPM repository (#3414) --- ci/deploy-rpm.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/ci/deploy-rpm.sh b/ci/deploy-rpm.sh index cb1c7d8286..9db1a44e60 100755 --- a/ci/deploy-rpm.sh +++ b/ci/deploy-rpm.sh @@ -1,18 +1,21 @@ #!/bin/bash +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_rpm_repo () { version=$1 rpm_path=rpm/releases/${version}/x86_64 - RPM_EL=$(find ../dist/ -type f -name "*64bit.rpm" -printf "%f\n" | head -n1 | sed -e "s/_/-/g" -e "s/-Linux/.el$version/" -e "s/-64bit/.x86_64/") - echo $RPM_EL - mkdir -p $rpm_path - cp ../dist/*64bit.rpm ${rpm_path}/${RPM_EL} + cp ../dist/*64bit.rpm ${rpm_path}/ - createrepo_c --update $rpm_path + createrepo_c -u https://github.com/aquasecurity/trivy/releases/download/ --location-prefix="v"$TRIVY_VERSION --update $rpm_path + + rm ${rpm_path}/*64bit.rpm } +echo "Create RPM releases for Trivy v$TRIVY_VERSION" + cd trivy-repo VERSIONS=(5 6 7 8 9) @@ -22,6 +25,5 @@ for version in ${VERSIONS[@]}; do done git add . -git commit -m "Update rpm packages" +git commit -m "Update rpm packages for Trivy v$TRIVY_VERSION" git push origin main -