Commit 8a286ce9 authored by Philippe Pepiot's avatar Philippe Pepiot Committed by Denis Laxalde
Browse files

Add a upgrade state that upgrade automatically

parent b237a48a
......@@ -118,15 +118,9 @@ Upgrades
To force an upgrade to the latest version of saem-ref, connect to the minion as
root, then run::
[root@minion] % supervisorctl stop all
[root@minion] % salt-call state.sls saemref.install pillar='{"upgrade": true}'
# be patient
[root@minion] % su - saemref
[saemref@minion] % . venv/bin/activate
(venv) [saemref@minion] % cubicweb-ctl upgrade saemref
# proceed to the cubicweb upgrade process
(venv) [saemref@minion] % exit
[root@minion] % supervisorctl start all
[root@minion] % salt-call state.sls saemref.upgrade
If upgrade process fails, a backup is created in `/home/saemref/etc/cubicweb.d/saemref/backup`
Testing
=======
......
......@@ -65,12 +65,6 @@ legacy cleanup:
- uwsgi
- uwsgi-plugin-python
{% if pillar.get('upgrade', False) %}
drop old virtualenv:
file.absent:
- name: /home/{{ saemref.instance.user }}/venv
{% endif %}
venv:
virtualenv.managed:
- name: /home/{{ saemref.instance.user }}/venv
......@@ -78,9 +72,6 @@ venv:
- user: {{ saemref.instance.user }}
- require:
- pkg: legacy cleanup
{% if pillar.get('upgrade', False) %}
- file: drop old virtualenv
{% endif %}
cubicweb in venv:
pip.installed:
......
# -*- coding: utf-8 -*-
{% from "saemref/map.jinja" import saemref with context %}
supervisorctl stop all:
cmd.run
drop old virtualenv:
file.absent:
- name: /home/{{ saemref.instance.user }}/venv
- require_in:
- virtualenv: venv
include:
- saemref.install
cubicweb-upgrade:
cmd.run:
- name: /home/{{ saemref.instance.user }}/venv/bin/cubicweb-ctl upgrade --backup-db=y --nostartstop --force --verbosity=0 {{ saemref.instance.name }}
- user: {{ saemref.instance.user }}
- env:
CW_MODE: user
- require:
- pip: cubicweb-saem_ref
supervisorctl start all:
cmd.run:
- require:
- cmd: cubicweb-upgrade
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment