use warnings;
use Bugzilla::Logging;
-use Bugzilla::Constants qw(bz_locations);
+use Bugzilla::Constants qw(bz_locations DB_MODULE);
use Cwd qw(realpath);
use English qw(-no_match_vars $PROGRAM_NAME);
use File::Spec::Functions qw(catfile catdir);
my $loop = IO::Async::Loop->new;
my $lc = Bugzilla::Install::Localconfig::read_localconfig();
- for my $var (qw(db_name db_host db_user db_pass)) {
+ for my $var (qw(db_driver db_name db_host db_user db_pass)) {
return $loop->new_future->die("$var is not set!") unless $lc->{$var};
}
+ my ($db_driver) = (DB_MODULE->{$lc->{db_driver}}->{dbd}->{module} =~ m/::([^:]+)$/);
- my $dsn = "dbi:mysql:database=$lc->{db_name};host=$lc->{db_host}";
+ my $dsn = "dbi:$db_driver:database=$lc->{db_name};host=$lc->{db_host}";
my $repeat = try_repeat_until_success {
$loop->delay_future(after => 0.25)->then(sub {
my $attrs = {RaiseError => 1, PrintError => 1};
- my ($ssl_ca_file, $ssl_ca_path, $ssl_cert, $ssl_key, $ssl_pubkey) =
- @$lc{qw(db_mysql_ssl_ca_file db_mysql_ssl_ca_path
- db_mysql_ssl_client_cert db_mysql_ssl_client_key db_mysql_ssl_get_pubkey)};
- if ($ssl_ca_file || $ssl_ca_path || $ssl_cert || $ssl_key || $ssl_pubkey) {
- $attrs->{'mysql_ssl'} = 1;
- $attrs->{'mysql_ssl_ca_file'} = $ssl_ca_file if $ssl_ca_file;
- $attrs->{'mysql_ssl_ca_path'} = $ssl_ca_path if $ssl_ca_path;
- $attrs->{'mysql_ssl_client_cert'} = $ssl_cert if $ssl_cert;
- $attrs->{'mysql_ssl_client_key'} = $ssl_key if $ssl_key;
- $attrs->{'mysql_get_server_pubkey'} = $ssl_pubkey if $ssl_pubkey;
+ if ($lc->{db_driver} eq 'mysql') {
+ my ($ssl_ca_file, $ssl_ca_path, $ssl_cert, $ssl_key, $ssl_pubkey) =
+ @$lc{qw(db_mysql_ssl_ca_file db_mysql_ssl_ca_path
+ db_mysql_ssl_client_cert db_mysql_ssl_client_key db_mysql_ssl_get_pubkey)};
+ if ($ssl_ca_file || $ssl_ca_path || $ssl_cert || $ssl_key || $ssl_pubkey) {
+ $attrs->{'mysql_ssl'} = 1;
+ $attrs->{'mysql_ssl_ca_file'} = $ssl_ca_file if $ssl_ca_file;
+ $attrs->{'mysql_ssl_ca_path'} = $ssl_ca_path if $ssl_ca_path;
+ $attrs->{'mysql_ssl_client_cert'} = $ssl_cert if $ssl_cert;
+ $attrs->{'mysql_ssl_client_key'} = $ssl_key if $ssl_key;
+ $attrs->{'mysql_get_server_pubkey'} = $ssl_pubkey if $ssl_pubkey;
+ }
}
my $dbh;
eval {
&& gpg --homedir /tmp --no-default-keyring --keyring /usr/share/keyrings/mysql-8.0.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys B7B3B788A8D3785C \
&& echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/mysql-8.0.gpg] http://repo.mysql.com/apt/debian/ bookworm mysql-8.0' > /etc/apt/sources.list.d/mysql-8.0.list
RUN apt-get update \
- && apt-get install -y libmysqlclient-dev
+ && apt-get install -y libmysqlclient-dev libpq-dev
RUN cpanm --notest --quiet App::cpm Module::CPANfile Carton::Snapshot
graphviz \
libcap2-bin \
libmysqlclient21 \
+ postgresql-client \
rsync \
$(cat /app/PACKAGES) \
&& rm -rf /var/cache/apt/* /var/lib/apt/lists/*
--- /dev/null
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+version: '3.6'
+
+services:
+ bmo.test:
+ build: &bmo_build
+ context: .
+ dockerfile: Dockerfile
+ command: dev_httpd
+ tmpfs:
+ - /tmp
+ - /run
+ environment:
+ - 'BMO_inbound_proxies=*'
+ - BMO_db_driver=pg
+ - BMO_db_host=bmo.db
+ - BMO_db_name=bugs
+ - BMO_db_pass=bugs
+ - BMO_db_user=bugs
+ - BMO_memcached_namespace=bugzilla
+ - BMO_memcached_servers=memcached:11211
+ - BMO_ses_username=ses@mozilla.bugs
+ - BMO_ses_password=password123456789!
+ - BMO_urlbase=AUTOMATIC
+ - BUGZILLA_ALLOW_INSECURE_HTTP=1
+ - BZ_ANSWERS_FILE=/app/conf/checksetup_answers.txt
+ - BZ_QA_ANSWERS_FILE=/app/.circleci/checksetup_answers.txt
+ - BZ_QA_CONF_FILE=/app/.circleci/selenium_test.conf
+ - BZ_QA_CONFIG=1
+ - CI=${CI}
+ - CIRCLE_SHA1=${CIRCLE_SHA1}
+ - CIRCLE_BUILD_URL=${CIRCLE_BUILD_URL}
+ - LOCALCONFIG_ENV=1
+ - LOG4PERL_CONFIG_FILE=log4perl-test.conf
+ - LOGGING_PORT=5880
+ - PORT=8000
+ - TWD_BROWSER=firefox
+ - TWD_HOST=selenium
+ - TWD_PORT=4444
+ depends_on:
+ - bmo.db
+ - memcached
+ - selenium
+
+ bmo.db:
+ image: postgres:9.0
+ tmpfs:
+ - /tmp
+ logging:
+ driver: "none"
+ environment:
+ - POSTGRES_DB=bugs
+ - POSTGRES_USER=bugs
+ - POSTGRES_PASSWORD=bugs
+
+ memcached:
+ image: memcached:latest
+
+ selenium:
+ image: selenium/standalone-firefox:3.141.59
+ shm_size: '512m'
+ ports:
+ - "5900:5900"
+
+volumes:
+ bmo-pg-db: