mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-12 15:50:15 -08:00
Add the RHEL8 support to rpm repository (#138)
* Add the RHEL8 support * Use variable
This commit is contained in:
@@ -1,18 +1,25 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
RPM_EL6=$(find dist/ -type f -name "*64bit.rpm" -printf "%f\n" | head -n1 | sed -e 's/_/-/g' -e 's/-Linux/.el6/' -e 's/-64bit/.x86_64/')
|
function create_rpm_repo () {
|
||||||
RPM_EL7=$(find dist/ -type f -name "*64bit.rpm" -printf "%f\n" | head -n1 | sed -e 's/_/-/g' -e 's/-Linux/.el7/' -e 's/-64bit/.x86_64/')
|
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}
|
||||||
|
|
||||||
|
createrepo --update $rpm_path
|
||||||
|
}
|
||||||
|
|
||||||
cd trivy-repo
|
cd trivy-repo
|
||||||
mkdir -p rpm/releases/6/x86_64
|
|
||||||
mkdir -p rpm/releases/7/x86_64
|
|
||||||
|
|
||||||
cd rpm
|
VERSIONS=(5 6 7 8)
|
||||||
cp ../../dist/*64bit.rpm releases/6/x86_64/${RPM_EL6}
|
for version in ${VERSIONS[@]}; do
|
||||||
cp ../../dist/*64bit.rpm releases/7/x86_64/${RPM_EL7}
|
echo "Processing RHEL/CentOS $version..."
|
||||||
|
create_rpm_repo $version
|
||||||
createrepo --update releases/6/x86_64/
|
done
|
||||||
createrepo --update releases/7/x86_64/
|
|
||||||
|
|
||||||
git add .
|
git add .
|
||||||
git commit -m "Update rpm packages"
|
git commit -m "Update rpm packages"
|
||||||
|
|||||||
Reference in New Issue
Block a user