forked from ISTI-ansible-roles/ansible-roles
When there's nothing to do, exit without trying to build the script.
This commit is contained in:
parent
27f3a4f000
commit
925d545be2
|
@ -22,6 +22,7 @@ trap "logger 'algorithms-updater: trap intercepted, exiting.' ; cleanup 1" SIGHU
|
|||
function cleanup() {
|
||||
rm -fr $OUT_DIR
|
||||
rm -f $LOCK_FILE
|
||||
logger 'algorithms-updater: Exiting'
|
||||
exit $1
|
||||
}
|
||||
|
||||
|
@ -103,15 +104,19 @@ function algorithms_updater() {
|
|||
done < ${ALGORITHMS_TEMP_SCRIPT}.algorithmslist
|
||||
set -o pipefail
|
||||
set -e
|
||||
mv $ALGORITHMS_TEMP_SCRIPT.body_ $ALGORITHMS_TEMP_SCRIPT.body
|
||||
cat $ALGORITHMS_TEMP_SCRIPT.head $ALGORITHMS_TEMP_SCRIPT.body > $ALGORITHMS_TEMP_SCRIPT
|
||||
chmod 755 $ALGORITHMS_TEMP_SCRIPT
|
||||
if [ -x $ADD_ALGORITHM_PATH ] ; then
|
||||
logger 'algorithms-updater: add the algorithms configurations. Reference infra is {{ dataminer_infra_reference }}'
|
||||
$ALGORITHMS_TEMP_SCRIPT >> $LOG_FILE 2>&1
|
||||
if [ -f $ALGORITHMS_TEMP_SCRIPT.body_ ] ; then
|
||||
mv $ALGORITHMS_TEMP_SCRIPT.body_ $ALGORITHMS_TEMP_SCRIPT.body
|
||||
cat $ALGORITHMS_TEMP_SCRIPT.head $ALGORITHMS_TEMP_SCRIPT.body > $ALGORITHMS_TEMP_SCRIPT
|
||||
chmod 755 $ALGORITHMS_TEMP_SCRIPT
|
||||
if [ -x $ADD_ALGORITHM_PATH ] ; then
|
||||
logger 'algorithms-updater: add the algorithms configurations. Reference infra is {{ dataminer_infra_reference }}'
|
||||
$ALGORITHMS_TEMP_SCRIPT >> $LOG_FILE 2>&1
|
||||
else
|
||||
logger 'algorithms-updater: {{ smartgears_user_home }}/algorithmInstaller/addAlgorithm.sh is not an executable, aborting'
|
||||
cleanup 1
|
||||
fi
|
||||
else
|
||||
logger 'algorithms-updater: {{ smartgears_user_home }}/algorithmInstaller/addAlgorithm.sh is not an executable, aborting'
|
||||
cleanup 1
|
||||
cleanup 0
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue