mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-12 15:50:15 -08:00
ci: store URLs to Github Releases in RPM repository (#3414)
This commit is contained in:
@@ -1,18 +1,21 @@
|
|||||||
#!/bin/bash
|
#!/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 () {
|
function create_rpm_repo () {
|
||||||
version=$1
|
version=$1
|
||||||
rpm_path=rpm/releases/${version}/x86_64
|
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
|
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
|
cd trivy-repo
|
||||||
|
|
||||||
VERSIONS=(5 6 7 8 9)
|
VERSIONS=(5 6 7 8 9)
|
||||||
@@ -22,6 +25,5 @@ for version in ${VERSIONS[@]}; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
git add .
|
git add .
|
||||||
git commit -m "Update rpm packages"
|
git commit -m "Update rpm packages for Trivy v$TRIVY_VERSION"
|
||||||
git push origin main
|
git push origin main
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user