...
 
Commits (5)
......@@ -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
=======
......
......@@ -3,6 +3,6 @@
cubicweb.profile = no
cubicweb.session.secret = {{ saemref.instance.sessions_secret }}
cubicweb.auth.authtkt.session.secret = {{ saemref.instance.authtk_session_secret }}
cubicweb.auth.authtkt.session.secure = False
cubicweb.auth.authtkt.session.secure = true
cubicweb.auth.authtkt.persistent.secret = {{ saemref.instance.authtk_persistent_secret }}
cubicweb.auth.authtkt.persistent.secure = False
cubicweb.auth.authtkt.persistent.secure = true
# -*- coding: utf-8 -*-
{% from "saemref/map.jinja" import saemref with context %}
include:
{% if grains['os_family'] == 'RedHat' %}
- epel
include:
- postgres.upstream
epel-release:
pkg.installed
{% endif %}
pip-setuptools:
......@@ -63,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
......@@ -76,9 +72,14 @@ venv:
- user: {{ saemref.instance.user }}
- require:
- pkg: legacy cleanup
{% if pillar.get('upgrade', False) %}
- file: drop old virtualenv
{% endif %}
pip.installed:
- name: pip
- upgrade: true
- bin_env: /home/{{ saemref.instance.user }}/venv
- user: {{ saemref.instance.user }}
- require:
- virtualenv: venv
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
......@@ -5,7 +5,6 @@ fileserver_backend:
- git
gitfs_remotes:
- git://github.com/saltstack-formulas/epel-formula.git
- git://github.com/saltstack-formulas/postgres-formula.git
file_roots:
......