forked from rockstor/rockstor-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtesting.cfg
193 lines (172 loc) · 7.41 KB
/
testing.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com>
# This file is part of RockStor.
#
# RockStor is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published
# by the Free Software Foundation; either version 2 of the License,
# or (at your option) any later version.
#
# RockStor is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
[buildout]
extends = base-buildout.cfg
parts =
stop-rockstor
rpm-deps
rpm-deps-nut
django
scripts
postgres-setup
postgres-conf
gunicorn
nginx-conf
shellinabox-conf
stop-shellinabox
test-settings-conf
mime-types
init-gunicorn
extra-stuff
js-clean
js-libraries
js-sync
collectstatic
supervisor
supervisord-conf
create-cert
docker-conf
rockstor-pre-systemd-conf
rockstor-systemd-conf
bootstrap-systemd-conf
start-rockstor
[rpm-deps-ad]
recipe = plone.recipe.command
stop-on-error = true
command =
${rpm-deps:install_cmd} realmd sssd oddjob oddjob-mkhomedir adcli \
samba-common
[nginx-conf]
recipe = collective.recipe.template
input = ${buildout:directory}/conf/nginx.conf.in
output = ${buildout:directory}/etc/nginx/nginx.conf
[shellinabox-conf]
recipe = collective.recipe.template
input = ${buildout:directory}/conf/shellinaboxd.in
output = /etc/sysconfig/shellinaboxd
[stop-shellinabox]
recipe = plone.recipe.command
command = systemctl stop shellinaboxd
[stop-rockstor]
recipe = plone.recipe.command
command = systemctl stop rockstor
update-command = ${stop-rockstor:command}
[start-rockstor]
recipe = plone.recipe.command
command = cp -f ${buildout:directory}/conf/rockstor-pre.service /etc/systemd/system/rockstor-pre.service &&
systemctl enable rockstor-pre.service &&
systemctl daemon-reload &&
systemctl restart rockstor-pre
systemctl start rockstor
update-command = ${start-rockstor:command}
[init-gunicorn]
logfile = ${buildout:directory}/var/log/gunicorn.log
input = ${buildout:directory}/conf/gunicorn.in
output = ${buildout:directory}/etc/init.d/gunicorn
[supervisord-conf]
logdir = ${buildout:directory}/var/log
gunicorn_cmd = ${buildout:directory}/bin/gunicorn --bind=${init-gunicorn:bind}:${init-gunicorn:port} --pid=${init-gunicorn:pidfile} --workers=${init-gunicorn:workers} --log-file=${init-gunicorn:logfile} --pythonpath=${buildout:directory}/src/rockstor --timeout=120 --graceful-timeout=120 wsgi:application
smart_manager_cmd = ${buildout:directory}/bin/sm
replicad_cmd = ${buildout:directory}/bin/replicad
dc_cmd = ${buildout:directory}/bin/data-collector
# Huey ommandline options take precedence over those in settings.py.
# https://huey.readthedocs.io/en/latest/django.html#running-the-consumer
# "... Worker type, must be “thread”, “process” or “greenlet”. The default is thread, ..."
huey_cmd = ${buildout:directory}/bin/django run_huey --workers 2 --worker-type thread --logfile ${supervisord-conf:logdir}/huey.log
[django-settings-conf]
rootdir = ${buildout:directory}/src/rockstor
datastore = ${django-settings-conf:rootdir}/storageadmin/datastore
smartdb = ${django-settings-conf:rootdir}/smart_manager/smartdb
pgdata_dir = /var/lib/pgsql/data
static_dir = ${django-settings-conf:rootdir}/storageadmin/static/storageadmin
template_dir1 = ${django-settings-conf:rootdir}/storageadmin/templates/storageadmin
template_dir2 = ${django-settings-conf:rootdir}/templates/admin
logfile = ${buildout:directory}/var/log/rockstor.log
taplib = ${django-settings-conf:rootdir}/smart_manager/taplib
output = ${django-settings-conf:rootdir}/settings.py
debug = True
[test-settings-conf]
recipe = collective.recipe.template
input = ${buildout:directory}/conf/test-settings.conf.in
output = ${buildout:directory}/src/rockstor/test-settings.py
# {storageadmin,smartdb}.sql.in are created using `pg_dump --username=rocky <db_name> > <db_name>.sql.in
[postgres-setup]
recipe = plone.recipe.command
command = if [[ ! -d ${django-settings-conf:pgdata_dir} ]]; then
echo "postgres not setup";
systemctl enable postgresql;
postgresql-setup initdb;
systemctl restart postgresql;
su - postgres -c "createdb smartdb";
su - postgres -c "createdb storageadmin";
sudo -u postgres psql -c "CREATE ROLE rocky WITH SUPERUSER LOGIN PASSWORD 'rocky'";
sudo -u postgres psql storageadmin < ${buildout:directory}/conf/storageadmin.sql.in;
sudo -u postgres psql smartdb < ${buildout:directory}/conf/smartdb.sql.in;
sudo -u postgres psql storageadmin -c "select setval('south_migrationhistory_id_seq', (select max(id) from south_migrationhistory))";
sudo -u postgres psql smartdb -c "select setval('south_migrationhistory_id_seq', (select max(id) from south_migrationhistory))";
fi
update-command = ${postgres-setup:command}
[postgres-conf]
recipe = plone.recipe.command
command = su - postgres -c "cp -f ${buildout:directory}/conf/postgresql.conf /var/lib/pgsql/data/";
su - postgres -c "cp -f ${buildout:directory}/conf/pg_hba.conf /var/lib/pgsql/data/";
systemctl restart postgresql;
update-command = ${postgres-conf:command}
[create-cert]
recipe = plone.recipe.command
cert_loc = ${buildout:directory}/certs
command = if [[ ! -d ${create-cert:cert_loc} ]]; then
mkdir ${create-cert:cert_loc};
openssl req -nodes -newkey rsa:2048 -keyout ${create-cert:cert_loc}/first.key -out ${create-cert:cert_loc}/rockstor.csr -sha256 -subj "/C=US/ST=Rockstor user's state/L=Rockstor user's city/O=Rockstor user/OU=Rockstor dept/CN=rockstor.user" &&
openssl rsa -in ${create-cert:cert_loc}/first.key -out ${create-cert:cert_loc}/rockstor.key &&
openssl x509 -in ${create-cert:cert_loc}/rockstor.csr -out ${create-cert:cert_loc}/rockstor.cert -sha256 -req -signkey ${create-cert:cert_loc}/rockstor.key -days 3650
fi
update-command = ${create-cert:command}
[fixtures]
recipe = plone.recipe.command
command = export DJANGO_SETTINGS_MODULE=settings &&
${buildout:directory}/bin/django dumpdata --exclude contenttypes --exclude auth.Permission --natural-foreign --indent 4 > ${buildout:directory}/src/rockstor/storageadmin/fixtures/newfixture.json
update-command = ${fixtures:command}
[delete-prod-rpm]
recipe = plone.recipe.command
command = if [[ -d /opt/rockstor ]]; then
systemctl stop rockstor;
systemctl disable rockstor;
rm -rf /var/lib/pgsql/data;
sudo /usr/bin/yum remove -y rockstor;
rm -rf /opt/rockstor
fi
update-command = ${delete-prod-rpm:command}
[js-libraries]
url = http://rockstor.com/downloads/jslibs-dev/lib.tgz
md5sum = 78f723aafcd05684f41193778fb0e26a
[gulp-install]
recipe = plone.recipe.command
yum_install = sudo /usr/bin/yum install --setopt=timeout=600 -y
command = if [[ ! -f /usr/bin/gulp ]]; then
${gulp-install:yum_install} npm;
npm install --global gulp-cli
fi
update-command = ${gulp-install:command}
stop-on-error = true
[gulp-eslint]
recipe = plone.recipe.command
command = cd ${buildout:directory} &&
npm install --save-dev --silent gulp &&
npm install --save-dev --silent gulp-eslint &&
gulp
update-command = ${gulp-eslint:command}
stop-on-error = true