Skip to content
Snippets Groups Projects
Commit ef78ec7d authored by Guilhem Bonnefille's avatar Guilhem Bonnefille Committed by Pierre Smeyers
Browse files

fix: replace wget and curl by python scripts

parent 9a05c651
No related branches found
No related tags found
No related merge requests found
......@@ -856,13 +856,12 @@ py-sbom:
if [[ -z "$PYTHON_SBOM_SYFT_URL" ]]
then
log_info "Syft version unset: retrieve latest version..."
PYTHON_SBOM_SYFT_URL=$(curl -sSf "https://api.github.com/repos/anchore/syft/releases?per_page=1" | \
python3 -c 'import json,sys;resp=json.load(sys.stdin);print(next(filter(lambda a: a["browser_download_url"].endswith("_linux_amd64.tar.gz"),resp[0]["assets"]))["browser_download_url"]);')
PYTHON_SBOM_SYFT_URL=$(python3 -c 'import json,sys,urllib.request;s = urllib.request.urlopen("https://api.github.com/repos/anchore/syft/releases?per_page=1");resp=json.load(s);print(next(filter(lambda a: a["browser_download_url"].endswith("_linux_amd64.tar.gz"),resp[0]["assets"]))["browser_download_url"]);')
log_info "... use latest Syft version: \\e[32m$PYTHON_SBOM_SYFT_URL\\e[0m"
fi
python_sbom_syft="$PIP_CACHE_DIR/syft-$(echo "$PYTHON_SBOM_SYFT_URL" | md5sum | cut -d" " -f1)"
if [ ! -f $python_sbom_syft ]; then
wget -q -O syft.tar.gz $PYTHON_SBOM_SYFT_URL
python3 -c 'import urllib.request;urllib.request.urlretrieve("'$PYTHON_SBOM_SYFT_URL'","syft.tar.gz")'
tar zxf syft.tar.gz syft
mkdir -p $PIP_CACHE_DIR
mv ./syft $python_sbom_syft
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment