Skip to content

Instantly share code, notes, and snippets.

@vale981
Created June 15, 2021 19:59
Show Gist options
  • Save vale981/a71852e5713596a70d5df2fbea391fb0 to your computer and use it in GitHub Desktop.
Save vale981/a71852e5713596a70d5df2fbea391fb0 to your computer and use it in GitHub Desktop.
#!/bin/bash
XML_PATH="/tmp/knewstuff.xml"
FULL_URL="https://invent.kde.org/api/v4/projects/5927/jobs/artifacts/master/download?job=build-catlogs"
XML_URL="https://invent.kde.org/api/v4/projects/5927/jobs/artifacts/master/raw/out/knewstuff/knewstuff.xml?job=build-catlogs"
HTTP_PATH="/tmp/http"
###############################################################################
# Check if CI is newer. #
###############################################################################
touch $XML_PATH
TMP_XML_PATH=$(mktemp)
curl $XML_URL > $TMP_XML_PATH
if cmp --silent "$TMP_XML_PATH" "$XML_PATH"; then
exit 0;
fi
mv $TMP_XML_PATH $XML_PATH
mkdir -p $HTTP_PATH
TMP=$(mktemp -d)
echo $TMP
cd $TMP
wget -O stuff.zip $FULL_URL
unzip stuff.zip
mv out/knewstuff/* $HTTP_PATH
cd ..
rm -rf $TMP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment