Fix the algorithms-updater script again.

This commit is contained in:
Andrea Dell'Amico 2017-07-25 17:51:26 +02:00
parent 92cdb68b37
commit 9d8ae525a2
2 changed files with 5 additions and 4 deletions

View File

@ -15,6 +15,7 @@
- name: Download the WPS algorithms from subversion - 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 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 - name: Install a script that updates the algorithms repository and adds the missing algorithms configurations
become_user: "{{ d4science_ansible_become_user | default('root') }}" become_user: "{{ d4science_ansible_become_user | default('root') }}"
@ -22,8 +23,8 @@
tags: [ 'tomcat', 'dataminer', 'wps', 'dataminer_algorithms', 'dataminer_algorithms_script' ] tags: [ 'tomcat', 'dataminer', 'wps', 'dataminer_algorithms', 'dataminer_algorithms_script' ]
- name: Cron job that updates the algorithms repository and adds the missing algorithms configurations - 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 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' ] tags: [ 'tomcat', 'dataminer', 'wps', 'dataminer_algorithms', 'dataminer_algorithms_cron' ]
- name: Create a directory where to install the gebco_08.nc data file - name: Create a directory where to install the gebco_08.nc data file
file: path={{ smartgears_user_home }}/data state=directory file: path={{ smartgears_user_home }}/data state=directory

View File

@ -91,8 +91,8 @@ function algorithms_updater() {
echo "echo ''" >> $ALGORITHMS_TEMP_SCRIPT.body_ echo "echo ''" >> $ALGORITHMS_TEMP_SCRIPT.body_
echo "$ALGO_BODY" >> $ALGORITHMS_TEMP_SCRIPT.body_ echo "$ALGO_BODY" >> $ALGORITHMS_TEMP_SCRIPT.body_
echo 'RETVAL=$?' >> $ALGORITHMS_TEMP_SCRIPT.body_ echo 'RETVAL=$?' >> $ALGORITHMS_TEMP_SCRIPT.body_
echo "echo 'Done.'" echo "echo 'Done.'" >> $ALGORITHMS_TEMP_SCRIPT.body_
echo "echo ''" echo "echo ''" >> $ALGORITHMS_TEMP_SCRIPT.body_
echo 'if [ $RETVAL -ne 0 ] ; then' >> $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 " logger 'algorithms-updater: the adding of algorithm $ALGO_NAME failed'" >> $ALGORITHMS_TEMP_SCRIPT.body_
echo "else" >> $ALGORITHMS_TEMP_SCRIPT.body_ echo "else" >> $ALGORITHMS_TEMP_SCRIPT.body_