...
 
Commits (5)
......@@ -35,7 +35,7 @@ Cubicweb config files are located in ``~saemref/etc/cubicweb.d/saemref`` and
``CW_MODE=user``.
The state require the installation of `epel-formula`_ and `postgres-formula`_
with version 9.4 (see ``pillar.example``).
with version 9.6 (see ``pillar.example``).
``saemref.config``
------------------
......
......@@ -28,7 +28,7 @@ include:
- source: salt://saemref/files/logrotate.conf
- template: jinja
VIRTUAL_ENV=/home/{{ saemref.instance.user }}/venv CW_MODE=user /home/{{ saemref.instance.user }}/venv/bin/cubicweb-ctl source-sync --loglevel error {{ saemref.instance.name }}:
CW_MODE=user /home/{{ saemref.instance.user }}/venv/bin/cubicweb-ctl source-sync --loglevel error {{ saemref.instance.name }}:
cron.present:
- user: {{ saemref.instance.user }}
- hour: "*/1"
......
......@@ -9,4 +9,3 @@ cubicweb-db-create:
- user: {{ saemref.instance.user }}
- env:
CW_MODE: user
VIRTUAL_ENV: /home/{{ saemref.instance.user }}/venv
......@@ -9,5 +9,4 @@ cubicweb-db-init:
- user: {{ saemref.instance.user }}
- env:
CW_MODE: user
VIRTUAL_ENV: /home/{{ saemref.instance.user }}/venv
......@@ -8,7 +8,7 @@ command=/home/{{ saemref.instance.user }}/venv/bin/cubicweb-ctl pyramid -D {{ sa
user={{ saemref.instance.user }}
redirect_stderr=true
stdout_logfile=/home/{{ saemref.instance.user }}/{{ saemref.instance.name }}.log
environment=VIRTUAL_ENV=/home/{{ saemref.instance.user }}/venv,CW_MODE=user,HOME=/home/{{ saemref.instance.user }},CW_INSTANCE={{ saemref.instance.name }}
environment=CW_MODE=user,HOME=/home/{{ saemref.instance.user }},CW_INSTANCE={{ saemref.instance.name }}
autorestart=true
startsecs=10
......@@ -18,7 +18,7 @@ command=/home/{{ saemref.instance.user }}/venv/bin/gunicorn 'cubicweb.pyramid:ws
{% else -%}
command=/home/{{ saemref.instance.user }}/venv/bin/cubicweb-ctl pyramid -D {{ saemref.instance.name }}
{% endif -%}
environment=VIRTUAL_ENV=/home/{{ saemref.instance.user }}/venv,CW_MODE=user,HOME=/home/{{ saemref.instance.user }},CW_INSTANCE={{ saemref.instance.name }},CW_CONNECTIONS_POOL_SIZE={{ saemref.instance.oai_threads }},CW_PORT={{ saemref.instance.oai_port }}
environment=CW_MODE=user,HOME=/home/{{ saemref.instance.user }},CW_INSTANCE={{ saemref.instance.name }},CW_CONNECTIONS_POOL_SIZE={{ saemref.instance.oai_threads }},CW_PORT={{ saemref.instance.oai_port }}
user={{ saemref.instance.user }}
redirect_stderr=true
stdout_logfile=/home/{{ saemref.instance.user }}/{{ saemref.instance.name }}-oai.log
......@@ -27,7 +27,7 @@ startsecs=10
[program:saemref-scheduler]
command=/home/{{ saemref.instance.user }}/venv/bin/cubicweb-ctl scheduler {{ saemref.instance.name }}
environment=VIRTUAL_ENV=/home/{{ saemref.instance.user }}/venv,CW_MODE=user,HOME=/home/{{ saemref.instance.user }},CW_INSTANCE={{ saemref.instance.name }}
environment=CW_MODE=user,HOME=/home/{{ saemref.instance.user }},CW_INSTANCE={{ saemref.instance.name }}
user={{ saemref.instance.user }}
redirect_stderr=true
stdout_logfile=/home/{{ saemref.instance.user }}/{{ saemref.instance.name }}-scheduler.log
......
......@@ -4,6 +4,7 @@
{% if grains['os_family'] == 'RedHat' %}
include:
- postgres.upstream
- postgres.client
epel-release:
pkg.installed
......@@ -31,7 +32,6 @@ cube-packages:
- libgecode-dev
- g++
{% else %}{# RedHat #}
- postgresql94
- graphviz-gd
- python-devel
- gecode-devel
......@@ -138,7 +138,6 @@ cubicweb-create:
- user: {{ saemref.instance.user }}
- env:
CW_MODE: user
VIRTUAL_ENV: /home/{{ saemref.instance.user }}/venv
- require:
- pkg: cube-packages
- user: {{ saemref.instance.user }}
......
......@@ -20,7 +20,6 @@ cubicweb-upgrade:
- user: {{ saemref.instance.user }}
- env:
CW_MODE: user
VIRTUAL_ENV: /home/{{ saemref.instance.user }}/venv
- require:
- pip: cubicweb-saem_ref
......
......@@ -41,4 +41,4 @@ saemref:
pass: admin
postgres:
version: 9.4
version: 9.6
FROM postgres:9.4
FROM postgres:9.6
RUN apt-get -qqy update && apt-get -qqy install postgresql-plpython-9.4
RUN apt-get -qqy update && apt-get -qqy install postgresql-plpython-9.6
base:
'*':
- saemref.db-create
- saemref
- saemref.supervisor
- saemref.client
......@@ -9,7 +9,7 @@ import pytest
DATA_DIR = path.join(path.abspath(path.dirname(__file__)), "data")
EXPECTED_SAEM_VERSION = "0.17.3"
EXPECTED_SAEM_VERSION = "0.18.0"
wait_supervisord_started = pytest.mark.usefixtures("_wait_supervisord_started")
......@@ -18,20 +18,20 @@ wait_saemref_started = pytest.mark.usefixtures("_wait_saemref_started")
def test_package_postgresclient(host):
if host.system_info.distribution == "centos":
name = "postgresql94"
name = "postgresql96"
else: # Debian
name = "postgresql-client"
pkg = host.package(name)
assert pkg.is_installed
assert pkg.version.startswith("9.4")
assert pkg.version.startswith("9.6")
def test_pip_packages(host):
packages = host.pip_package.get_packages(
pip_path='/home/saemref/venv/bin/pip')
assert packages['cubicweb']['version'].startswith("3.26")
assert map(int, packages['cubicweb']['version'].split('.')) >= [3, 25]
assert map(int, packages['cubicweb']['version'].split('.')) >= [3, 26, 1]
assert packages['cubicweb-saem-ref']['version'].startswith(EXPECTED_SAEM_VERSION)
......@@ -99,7 +99,7 @@ def test_pillars(host):
}
}
assert pillars == {
'postgres': {'version': 9.4},
'postgres': {'version': 9.6},
'saemref': {'lookup': expected}
}
host.salt("state.sls", "test_pillar")
......@@ -189,7 +189,6 @@ EOF'''.format(token_secret))
def cc_shell(host, script_name):
return host.check_output(
'VIRTUAL_ENV=/home/saemref/venv/ '
'CW_INSTANCES_DIR=/home/saemref/etc/cubicweb.d '
'/home/saemref/venv/bin/cubicweb-ctl shell saemref '
'/data/%s', script_name)