Skip to content

Commit 41d2038

Browse files
authored
Merge pull request #18 from binary-sequence-dockerized-apps/postgresql
webui now uses postgresql
2 parents 5715c76 + dab4b36 commit 41d2038

3 files changed

Lines changed: 25 additions & 12 deletions

File tree

webui/Dockerfile

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,35 @@
11
FROM opensuse:tumbleweed
22
LABEL maintainer Sergio Lindo Mansilla <slindomansilla@suse.com>
3-
LABEL version="2017-11-25"
3+
LABEL version="2017-12-11"
44

55
RUN zypper --gpg-auto-import-keys ref
6-
RUN zypper --non-interactive in --force-resolution apache2
7-
RUN zypper --non-interactive in --force-resolution w3m
8-
RUN zypper --non-interactive in --force-resolution which
9-
RUN zypper --non-interactive in --force-resolution openQA
6+
RUN zypper --non-interactive install --force-resolution apache2
7+
RUN zypper --non-interactive install --force-resolution perl-DateTime-Format-Pg
8+
RUN zypper --non-interactive install --force-resolution perl-DBD-Pg
9+
RUN zypper --non-interactive install --force-resolution postgresql
10+
RUN zypper --non-interactive install --force-resolution postgresql-server
11+
RUN zypper --non-interactive install --force-resolution w3m
12+
RUN zypper --non-interactive install --force-resolution which
13+
RUN zypper --non-interactive install --force-resolution openQA
1014

1115
RUN a2enmod headers
1216
RUN a2enmod proxy
1317
RUN a2enmod proxy_http
1418
RUN a2enmod proxy_wstunnel
1519

1620
# Config
17-
RUN mkdir -p /run/dbus
21+
RUN mkdir --parents /run/dbus
1822
RUN echo ServerName localhost >> /etc/apache2/httpd.conf
1923
RUN cp /etc/apache2/vhosts.d/openqa.conf.template /etc/apache2/vhosts.d/openqa.conf
24+
USER postgres
25+
RUN /usr/share/postgresql/postgresql-script start && \
26+
createuser geekotest && \
27+
createdb openqa && \
28+
psql --command='GRANT ALL PRIVILEGES ON DATABASE openqa TO geekotest;' && \
29+
/usr/share/postgresql/postgresql-script stop
30+
USER root
2031
ADD client.conf /etc/openqa/
32+
ADD database.ini /etc/openqa
2133
ADD openqa.ini /etc/openqa/
2234
ADD rsyncd.conf /etc/
2335

webui/database.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[test]
2+
dsn = dbi:Pg:dbname=openqa
3+
4+
[production]
5+
dsn = dbi:Pg:dbname=openqa

webui/run_openqa.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,12 @@ export DBUS_STARTER_BUS_TYPE=system
44

55
# prepare environment
66
rm -f /run/dbus/pid
7-
if [ ! -f /data/db/db.sqlite ]; then
8-
/usr/share/openqa/script/initdb --user geekotest --init_database
9-
else
10-
/usr/share/openqa/script/upgradedb --user geekotest --upgrade_database
11-
fi
127

138
# run services
149
dbus-daemon --system --fork
10+
start_daemon -u postgres /usr/share/postgresql/postgresql-script start &
11+
start_daemon -u root /usr/sbin/rsyncd --daemon --no-detach &
1512
start_daemon -u geekotest /usr/share/openqa/script/openqa-resource-allocator &
16-
start_daemon /usr/sbin/rsyncd --daemon --no-detach &
1713
start_daemon -u geekotest /usr/share/openqa/script/openqa-scheduler &
1814
start_daemon -u geekotest /usr/share/openqa/script/openqa-websockets &
1915
start_daemon -u geekotest /usr/share/openqa/script/openqa gru -m production run &

0 commit comments

Comments
 (0)