Commit 6a3c2990 authored by Reto Gantenbein's avatar Reto Gantenbein

Run database upgrade if version update is detected

parent a1dd00e5
- name: Get version of previous Roundcube installation
command: sed -n "s/^define('RCMAIL_VERSION', '\(.*\)');/\1/p" \
{{ roundcube__git_checkout }}/program/include/iniset.php
changed_when: False
failed_when: False
register: roundcube__register_version
- name: Get version of old Roundcube installation
command: sed -n "s/^define('RCMAIL_VERSION', '\(.*\)');/\1/p" \
roundcube__domain if roundcube__domain is string
else roundcube__domain[0] }}/public/program/include/iniset.php
changed_when: False
failed_when: False
register: roundcube__register_version_old
when: roundcube__register_version.stdout == ''
# ---- Deployment ----
# roundcube is checked out based on tags instead of branches, and since we
......@@ -135,6 +152,17 @@
creates: 'program/js/jquery.min.js'
become_user: '{{ roundcube__user }}'
- name: Update database schema
command: 'php bin/ --package=roundcube --dir={{ roundcube__git_checkout }}/SQL'
chdir: '{{ roundcube__git_checkout }}'
become_user: '{{ roundcube__user }}'
register: roundcube__register_updatedb
changed_when: not roundcube__register_updatedb.stdout == ''
when: (not roundcube__register_version.stdout == '' and
roundcube__git_version | version_compare(roundcube__register_version.stdout, '>')) or
(not roundcube__register_version_old | skipped)
- name: Enable Cron job
name: Roundcube daily database housekeeping
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment