Skip to content

Instantly share code, notes, and snippets.

@laapsaap laapsaap/rpmjenkins
Created Feb 22, 2018

Embed
What would you like to do?
###
### RPM.CONFIG
###
if [ -f "RPM.CONFIG" ]; then
echo
echo ":::::"
echo "::::: Found RPM.CONFIG, downloading files"
echo ":::::"
echo
. RPM.CONFIG
MATCH=$(curl -s "$SEARCH_URL" | grep -m 1 -o "$REGEX" | head -n 1)
echo
echo ":::::"
echo "::::: Found SRPM: $MATCH"
echo "::::: Download URL: $DOWNLOAD_URL$MATCH"
echo ":::::"
echo
curl -o "$MATCH" "$DOWNLOAD_URL$MATCH"
rpm2cpio "$MATCH" | cpio -imv --no-absolute-filenames
spec_file=$(ls *.spec)
echo
echo ":::::"
echo "::::: Found SPEC file: $spec_file"
echo ":::::"
echo
else
spec_file=$(ls *.spec)
echo
echo ":::::"
echo "::::: Found SPEC file: $spec_file"
echo ":::::"
echo
fi
if [ -f "RPM.SH" ]; then
echo
echo ":::::"
echo "::::: Found RPM.SH, executing custom code"
echo ":::::"
echo
/bin/bash ./RPM.SH
fi
# fix spec file
sed -i -e '/NoSource: 0/d' $spec_file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.