971d97bf99
Numerous files have incorrect modes set. Correct these so that executables have 755 and yaml files are 644 to address rpmlint errors. Change-Id: I8db36209b41a492f6b85e3469994de884bf556e8
31 lines
805 B
Bash
Executable File
31 lines
805 B
Bash
Executable File
#!/bin/bash
|
|
|
|
TMP_DATA=$(mktemp -d)
|
|
function cleanup {
|
|
rm -Rf "$TMP_DATA"
|
|
}
|
|
trap cleanup EXIT
|
|
|
|
if [ -n "$artifact_urls" ]; then
|
|
for URL in $(echo $artifact_urls | sed -e "s| |\n|g" | sort -u); do
|
|
curl --globoff -o $TMP_DATA/file_data "$URL"
|
|
if file -b $TMP_DATA/file_data | grep RPM &>/dev/null; then
|
|
mv $TMP_DATA/file_data $TMP_DATA/file_data.rpm
|
|
yum install -y $TMP_DATA/file_data.rpm
|
|
rm $TMP_DATA/file_data.rpm
|
|
elif file -b $TMP_DATA/file_data | grep 'gzip compressed data' &>/dev/null; then
|
|
pushd /
|
|
tar xvzf $TMP_DATA/file_data
|
|
popd
|
|
else
|
|
echo "ERROR: Unsupported file format: $URL"
|
|
exit 1
|
|
fi
|
|
if [ -f $TMP_DATA/file_data ]; then
|
|
rm $TMP_DATA/file_data
|
|
fi
|
|
done
|
|
else
|
|
echo "No artifact_urls was set. Skipping..."
|
|
fi
|