Skip to content
Snippets Groups Projects
Commit 5d42cfc0 authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia Committed by Emil Obreshkov
Browse files

Merge branch 'master-copy_rpm_eos-update' into 'master'

Update copy_rpm_eos.sh to catch if there are any problems during the rpm copy as per ATLINFR-1740.

See merge request !1836

Former-commit-id: 361030aa8b8c2ae6ed4908644eac22b73632e996
parent 2c86e868
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,8 @@
# Script to copy local nightly RPMs to EOS and run createrepo
#
ERROR_COUNT=0
# Function printing the usage information for the script
usage() {
echo "Usage: copy_rpm_eos.sh <-b branch> <-a arch> <-d week_day> <-s source dir> "
......@@ -65,24 +67,24 @@ DESTDIR=${DESTDIR}/${BRANCH}/${ARCH}/${DDAY}
if [ ! -d ${DESTDIR} ] ; then
echo "mkdir -p ${DESTDIR}"
mkdir -p ${DESTDIR}
mkdir -p ${DESTDIR} || ((ERROR_COUNT++))
fi
arr_rpm=(`(shopt -s nocaseglob; ls ${SOURCEDIR}/*.rpm)`)
if [ "${#arr_rpm[@]}" -le 0 ]; then
echo "nicos_rpm: Warning: no rpm files are found in ${SOURCEDIR}"
((ERROR_COUNT++))
else
for ele in "${arr_rpm[@]}"
do
echo "Info: copying $ele to ${DESTDIR}"
cp -a $ele ${DESTDIR} ; stateos=$?
if [ "$stateos" -ne 0 ]; then
echo "Error of eos copy: exit code $stateos"
fi
cp -a $ele ${DESTDIR} || ((ERROR_COUNT++))
done
fi
echo "====================================================="
echo "=== Update http RPMs location"
echo "====================================================="
echo "nicos_rpm::::::: createrepo --workers 8 --update ${DESTDIR} :::::::" `date`
createrepo --workers 8 --update ${DESTDIR}
createrepo --workers 8 --update ${DESTDIR} || ((ERROR_COUNT++))
exit ${ERROR_COUNT}
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