miniobs: Fix database setup for rails 6
This commit is contained in:
parent
77a148335e
commit
583b7bd6c1
21
dist/ci/miniobs/BSConfig.pm.patch
vendored
21
dist/ci/miniobs/BSConfig.pm.patch
vendored
@ -1,11 +1,17 @@
|
||||
--- /usr/lib/obs/server/BSConfig.pm.back 2019-04-30 06:21:39.000000000 +0000
|
||||
+++ /usr/lib/obs/server/BSConfig.pm 2019-04-30 06:32:04.000000000 +0000
|
||||
@@ -34,3 +34,3 @@
|
||||
--- /usr/lib/obs/server/BSConfig.pm.orig 2020-04-29 19:34:39.000000000 +0000
|
||||
+++ /usr/lib/obs/server/BSConfig.pm 2020-04-30 10:05:14.000000000 +0000
|
||||
@@ -32,7 +32,7 @@
|
||||
my $frontend = undef; # FQDN of the WebUI/API server if it's not $hostname
|
||||
|
||||
# If defined, restrict access to the backend servers (bs_repserver, bs_srcserver, bs_service)
|
||||
-our $ipaccess = {
|
||||
+our $removed_ipaccess = {
|
||||
'^::1$' => 'rw', # only the localhost can write to the backend
|
||||
@@ -48,5 +48,5 @@
|
||||
'^127\..*' => 'rw', # only the localhost can write to the backend
|
||||
"^$ip\$" => 'rw', # Permit IP of FQDN
|
||||
@@ -49,9 +49,9 @@
|
||||
#our $ssl_certfile = "/path/to/tls.pem";
|
||||
|
||||
# Change also the SLP reg files in /etc/slp.reg.d/ when you touch hostname or port
|
||||
-our $srcserver = "http://$hostname:5352";
|
||||
-our $reposerver = "http://$hostname:5252";
|
||||
@ -14,8 +20,13 @@
|
||||
+our $reposerver = "http://repserver:5252";
|
||||
+our $serviceserver = "http://serviceserver:5152";
|
||||
our $clouduploadserver = "http://$hostname:5452";
|
||||
@@ -226,3 +226,3 @@
|
||||
|
||||
# you can use different ports for worker connections
|
||||
@@ -250,7 +250,7 @@
|
||||
#our $modifyrepo = '/usr/bin/modifyrepo_c';
|
||||
|
||||
# enable service dispatcher
|
||||
-our $servicedispatch = 1;
|
||||
+our $servicedispatch = 0;
|
||||
# max of 4 parallel running services (default)
|
||||
# our $servicedispatch_maxchild = 4;
|
||||
|
14
dist/ci/miniobs/Dockerfile
vendored
14
dist/ci/miniobs/Dockerfile
vendored
@ -10,22 +10,12 @@ RUN zypper install -y obs-api obs-worker obs-server \
|
||||
|
||||
COPY database.yml.local /srv/www/obs/api/config/database.yml
|
||||
|
||||
RUN /usr/lib/mysql/mysql-systemd-helper install ;\
|
||||
sed -e 's,127.0.0.1,0.0.0.0,' -i /etc/my.cnf ;\
|
||||
sed -e 's,server-id,skip-grant-tables,' -i /etc/my.cnf ;\
|
||||
/usr/lib/mysql/mysql-systemd-helper start & \
|
||||
/usr/lib/mysql/mysql-systemd-helper wait ;\
|
||||
/usr/bin/mysql -u root -e "SELECT @@version; CREATE USER 'root'@'%' IDENTIFIED BY 'opensuse'; GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION;" ;\
|
||||
chroot --userspec=wwwrun / /bin/bash -c "cd /srv/www/obs/api && DISABLE_DATABASE_ENVIRONMENT_CHECK=1 RAILS_ENV=production bundle exec rails db:create db:setup" ;\
|
||||
mysqladmin shutdown
|
||||
COPY prepare.sh /
|
||||
RUN bash -xe /prepare.sh
|
||||
|
||||
COPY config.yml /srv/www/obs/api/config/options.yml
|
||||
COPY database.yml /srv/www/obs/api/config/database.yml
|
||||
|
||||
RUN sed -i -e 's,\(config.public_file_server.enabled\).*,\1 = true,; s,\(config.log_level\).*,\1 = :debug,' \
|
||||
/srv/www/obs/api/config/environments/production.rb
|
||||
RUN rm -f /srv/www/obs/api/tmp/pids/server.pid
|
||||
|
||||
COPY BSConfig.pm.patch /tmp
|
||||
RUN patch /usr/lib/obs/server/BSConfig.pm /tmp/BSConfig.pm.patch
|
||||
|
||||
|
17
dist/ci/miniobs/prepare.sh
vendored
Normal file
17
dist/ci/miniobs/prepare.sh
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
#! /bin/sh
|
||||
|
||||
/usr/lib/mysql/mysql-systemd-helper install
|
||||
sed -e 's,127.0.0.1,0.0.0.0,' -i /etc/my.cnf
|
||||
sed -e 's,server-id,skip-grant-tables,' -i /etc/my.cnf
|
||||
|
||||
/usr/lib/mysql/mysql-systemd-helper start &
|
||||
/usr/lib/mysql/mysql-systemd-helper wait
|
||||
|
||||
#/usr/bin/mysqladmin -u root password 'opensuse'
|
||||
|
||||
chroot --userspec=wwwrun / /bin/bash -c "cd /srv/www/obs/api && DISABLE_DATABASE_ENVIRONMENT_CHECK=1 SAFETY_ASSURED=1 RAILS_ENV=production bundle exec rake db:create db:setup"
|
||||
mysqladmin shutdown
|
||||
|
||||
sed -i -e 's,\(config.public_file_server.enabled\).*,\1 = true,; s,\(config.log_level\).*,\1 = :debug,' /srv/www/obs/api/config/environments/production.rb
|
||||
rm -f /srv/www/obs/api/tmp/pids/server.pid
|
||||
|
Loading…
x
Reference in New Issue
Block a user