From 9d8ae525a20704904f71a6e0a2d5f79e2a3e2ba8 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Tue, 25 Jul 2017 17:51:26 +0200 Subject: [PATCH] Fix the algorithms-updater script again. --- smartgears/dataminer_app/tasks/dataminer-app.yml | 5 +++-- smartgears/dataminer_app/templates/algorithms-updater.j2 | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/smartgears/dataminer_app/tasks/dataminer-app.yml b/smartgears/dataminer_app/tasks/dataminer-app.yml index a50d278d..a379b509 100644 --- a/smartgears/dataminer_app/tasks/dataminer-app.yml +++ b/smartgears/dataminer_app/tasks/dataminer-app.yml @@ -15,6 +15,7 @@ - name: Download the WPS algorithms from subversion subversion: repo={{ dataminer_wps_algorithms_svn }} dest={{ smartgears_user_home }}/wps_algorithms/algorithms checkout=yes force=yes update=yes + tags: [ 'tomcat', 'dataminer', 'wps', 'dataminer_algorithms', 'dataminer_algorithms_svn' ] - name: Install a script that updates the algorithms repository and adds the missing algorithms configurations become_user: "{{ d4science_ansible_become_user | default('root') }}" @@ -22,8 +23,8 @@ tags: [ 'tomcat', 'dataminer', 'wps', 'dataminer_algorithms', 'dataminer_algorithms_script' ] - name: Cron job that updates the algorithms repository and adds the missing algorithms configurations - cron: name="SVN update the algorithms repository" minute="*/10" job="/usr/local/bin/algorithms-updater > {{ smartgears_instance_path }}/wps_algorithms_install_log/algorithms_updater_cron.log 2>&1" user='{{ smartgears_user }}' state=present - tags: [ 'tomcat', 'dataminer', 'wps', 'dataminer_algorithms' ] + cron: name="SVN update the algorithms repository" minute="*/1" job="/usr/local/bin/algorithms-updater > {{ smartgears_user_home }}/wps_algorithms_install_log/algorithms_updater_cron.log 2>&1" user='{{ smartgears_user }}' state=present + tags: [ 'tomcat', 'dataminer', 'wps', 'dataminer_algorithms', 'dataminer_algorithms_cron' ] - name: Create a directory where to install the gebco_08.nc data file file: path={{ smartgears_user_home }}/data state=directory diff --git a/smartgears/dataminer_app/templates/algorithms-updater.j2 b/smartgears/dataminer_app/templates/algorithms-updater.j2 index 7364e7b9..3c49ce2f 100644 --- a/smartgears/dataminer_app/templates/algorithms-updater.j2 +++ b/smartgears/dataminer_app/templates/algorithms-updater.j2 @@ -91,8 +91,8 @@ function algorithms_updater() { echo "echo ''" >> $ALGORITHMS_TEMP_SCRIPT.body_ echo "$ALGO_BODY" >> $ALGORITHMS_TEMP_SCRIPT.body_ echo 'RETVAL=$?' >> $ALGORITHMS_TEMP_SCRIPT.body_ - echo "echo 'Done.'" - echo "echo ''" + echo "echo 'Done.'" >> $ALGORITHMS_TEMP_SCRIPT.body_ + echo "echo ''" >> $ALGORITHMS_TEMP_SCRIPT.body_ echo 'if [ $RETVAL -ne 0 ] ; then' >> $ALGORITHMS_TEMP_SCRIPT.body_ echo " logger 'algorithms-updater: the adding of algorithm $ALGO_NAME failed'" >> $ALGORITHMS_TEMP_SCRIPT.body_ echo "else" >> $ALGORITHMS_TEMP_SCRIPT.body_