summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2015-11-14 18:03:49 +0100
committerDavid Lawrence <dkl@mozilla.com>2015-11-14 18:03:49 +0100
commit27dac6e9b0d2df69037cd022e77a9bf356fc7a67 (patch)
tree00d86c1b27138ce26cb60e3e342d001e9b1fa800
parent47f649124510a3e91a315fc7c7cd07286f36e91a (diff)
downloadbugzilla-27dac6e9b0d2df69037cd022e77a9bf356fc7a67.tar.gz
bugzilla-27dac6e9b0d2df69037cd022e77a9bf356fc7a67.tar.xz
Bug 1224649 - Docker and QA scripts should just use the same checksetup_answers.txt file
-rw-r--r--docker/Dockerfile11
-rwxr-xr-xdocker/scripts/bugzilla_config.sh12
-rw-r--r--docker/scripts/checksetup_answers.sh47
-rwxr-xr-xdocker/scripts/install_deps.sh7
-rwxr-xr-xdocker/scripts/my_config.sh8
-rwxr-xr-xdocker/scripts/runtests.sh16
6 files changed, 92 insertions, 9 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile
index ebba20a48..b5464761e 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -1,3 +1,10 @@
+# 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/.
+#
+# This Source Code Form is "Incompatible With Secondary Licenses", as
+# defined by the Mozilla Public License, v. 2.0.
+
FROM centos:centos7
MAINTAINER David Lawrence <dkl@mozilla.com>
@@ -8,9 +15,8 @@ ENV BUGZILLA_ROOT $HOME/devel/htdocs/bmo
ENV GITHUB_BASE_GIT https://github.com/mozilla/webtools-bmo-bugzilla
ENV GITHUB_BASE_BRANCH master
-# Copy over all files and scripts
+# Copy over configuration files
COPY files /files
-COPY scripts /scripts
# Distribution package installation
RUN yum -y -q install https://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm epel-release \
@@ -42,6 +48,7 @@ RUN cp /files/sudoers /etc/sudoers \
RUN su $BUGZILLA_USER -c "git clone $GITHUB_BASE_GIT -b $GITHUB_BASE_BRANCH $BUGZILLA_ROOT"
# Bugzilla dependencies and setup
+COPY scripts /scripts
RUN chmod a+x /scripts/*
RUN /scripts/install_deps.sh
RUN /scripts/bugzilla_config.sh
diff --git a/docker/scripts/bugzilla_config.sh b/docker/scripts/bugzilla_config.sh
index d1ca0db0e..b18493749 100755
--- a/docker/scripts/bugzilla_config.sh
+++ b/docker/scripts/bugzilla_config.sh
@@ -1,5 +1,12 @@
#!/bin/bash
+# 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/.
+#
+# This Source Code Form is "Incompatible With Secondary Licenses", as
+# defined by the Mozilla Public License, v. 2.0.
+
cd $BUGZILLA_ROOT
# Start and initialize database
@@ -9,8 +16,9 @@ mysql -u root mysql -e "GRANT ALL PRIVILEGES ON *.* TO bugs@localhost IDENTIFIED
mysql -u root mysql -e "CREATE DATABASE bugs CHARACTER SET = 'utf8';"
# Setup default Bugzilla database
-perl checksetup.pl /files/checksetup_answers.txt
-perl checksetup.pl /files/checksetup_answers.txt
+bash /scripts/checksetup_answers.sh > checksetup_answers.txt
+perl checksetup.pl checksetup_answers.txt
+perl checksetup.pl checksetup_answers.txt
perl /scripts/generate_bmo_data.pl
# Shutdown database
diff --git a/docker/scripts/checksetup_answers.sh b/docker/scripts/checksetup_answers.sh
new file mode 100644
index 000000000..1c518d019
--- /dev/null
+++ b/docker/scripts/checksetup_answers.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+# 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/.
+#
+# This Source Code Form is "Incompatible With Secondary Licenses", as
+# defined by the Mozilla Public License, v. 2.0.
+
+: ${WEB_HOST:=localhost}
+: ${DB_PORT_3306_TCP_ADDR:=localhost}
+: ${DB_PORT_3306_TCP_PORT:=3306}
+: ${DB_ENV_MYSQL_DATABASE:=bugs}
+: ${DB_ENV_MYSQL_USER:=bugs}
+: ${DB_ENV_MYSQL_PASSWORD:=bugs}
+: ${MEMCACHED_PORT_11211_TCP_ADDR:=localhost}
+
+cat <<EOF
+\$answer{'ADMIN_EMAIL'} = 'admin@mozilla.test';
+\$answer{'ADMIN_OK'} = 'Y';
+\$answer{'ADMIN_PASSWORD'} = 'password';
+\$answer{'ADMIN_REALNAME'} = 'QA Admin';
+\$answer{'NO_PAUSE'} = 1;
+\$answer{'bugzilla_version'} = '4.2';
+\$answer{'create_htaccess'} = '';
+\$answer{'cvsbin'} = '/usr/bin/cvs';
+\$answer{'db_check'} = 1;
+\$answer{'db_driver'} = 'mysql';
+\$answer{'db_host'} = '$DB_PORT_3306_TCP_ADDR';
+\$answer{'db_mysql_ssl_ca_file'} = '';
+\$answer{'db_mysql_ssl_ca_path'} = '';
+\$answer{'db_mysql_ssl_client_cert'} = '';
+\$answer{'db_mysql_ssl_client_key'} = '';
+\$answer{'db_name'} = '$DB_ENV_MYSQL_DATABASE';
+\$answer{'db_pass'} = '$DB_ENV_MYSQL_PASSWORD';
+\$answer{'db_port'} = $DB_PORT_3306_TCP_PORT;
+\$answer{'db_sock'} = '';
+\$answer{'db_user'} = '$DB_ENV_MYSQL_USER';
+\$answer{'diffpath'} = '/usr/bin';
+\$answer{'index_html'} = 0;
+\$answer{'interdiffbin'} = '/usr/bin/interdiff';
+\$answer{'memcached_servers'} = '$MEMCACHED_PORT_11211_TCP_ADDR:11211';
+\$answer{'urlbase'} = 'http://$WEB_HOST/docker-bmo/';
+\$answer{'use_suexec'} = '';
+\$answer{'webservergroup'} = 'bugzilla';
+EOF
+
diff --git a/docker/scripts/install_deps.sh b/docker/scripts/install_deps.sh
index 232bfea10..08930a27a 100755
--- a/docker/scripts/install_deps.sh
+++ b/docker/scripts/install_deps.sh
@@ -1,5 +1,12 @@
#!/bin/bash
+# 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/.
+#
+# This Source Code Form is "Incompatible With Secondary Licenses", as
+# defined by the Mozilla Public License, v. 2.0.
+
cd $BUGZILLA_ROOT
# Install Perl dependencies
diff --git a/docker/scripts/my_config.sh b/docker/scripts/my_config.sh
index e35e8dd90..4adc301cc 100755
--- a/docker/scripts/my_config.sh
+++ b/docker/scripts/my_config.sh
@@ -1,2 +1,10 @@
#!/bin/bash
+
+# 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/.
+#
+# This Source Code Form is "Incompatible With Secondary Licenses", as
+# defined by the Mozilla Public License, v. 2.0.
+
# Add any custom setup instructions here
diff --git a/docker/scripts/runtests.sh b/docker/scripts/runtests.sh
index a2b5773b8..5ad67f6ae 100755
--- a/docker/scripts/runtests.sh
+++ b/docker/scripts/runtests.sh
@@ -1,9 +1,13 @@
#!/bin/bash
+
# 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/.
+#
+# This Source Code Form is "Incompatible With Secondary Licenses", as
+# defined by the Mozilla Public License, v. 2.0.
-BUILDBOT=$BUGZILLA_ROOT/docker/scripts/buildbot_step
+BUILDBOT=/scripts/buildbot_step
if [ -z "$TEST_SUITE" ]; then
TEST_SUITE=sanity
@@ -25,7 +29,7 @@ if [ "$GITHUB_BASE_REV" != "" ]; then
fi
echo -e "\n== Checking dependencies for changes"
-$BUGZILLA_ROOT/docker/scripts/install_deps.sh
+bash /scripts/install_deps.sh
if [ "$TEST_SUITE" = "sanity" ]; then
$BUILDBOT "Sanity" prove -f -v t/*.t
@@ -50,11 +54,13 @@ echo -e "\n== Starting memcached"
sleep 3
echo -e "\n== Running checksetup"
-perl checksetup.pl $BUGZILLA_ROOT/qa/config/checksetup_answers.txt
-perl checksetup.pl $BUGZILLA_ROOT/qa/config/checksetup_answers.txt
+export DB_ENV_MYSQL_DATABASE="bugs_test"
+bash /scripts/checksetup_answers.sh > checksetup_answers.txt
+perl checksetup.pl checksetup_answers.txt
+perl checksetup.pl checksetup_answers.txt
echo -e "\n== Generating bmo data"
-perl $BUGZILLA_ROOT/docker/scripts/generate_bmo_data.pl
+perl /scripts/generate_bmo_data.pl
echo -e "\n== Generating test data"
cd $BUGZILLA_ROOT/qa/config