Commit 6102223f authored by helmo's avatar helmo

Issue #2770819 by helmo: Support Maria DB install without password (10.1+)

parent 6098ed53
#
# CI for Aegir Hosting System
#
# For docs see http://docs.aegirproject.org
# and http://docs.aegirproject.org/en/3.x/community/release-process/#setting-up-a-gitlab-runner
# Is performed before the scripts in the stages step
before_script:
- source /etc/profile
......@@ -9,7 +15,11 @@ stages:
- publish
- upgradetest
# Stage "build"
#
### Stage "build"
#
build:deb:
stage: build
image: aegir/hostmaster:packaging_base
......@@ -31,7 +41,10 @@ build:deb:
- build/*
# Stage "test"
#
### Stage "test"
#
test:debian-jessie-aegir3-apt:
stage: test
image: debian:jessie
......@@ -131,7 +144,9 @@ test:behat:
- sudo docker-compose -f docker-compose-provision.yml run hostmaster
#
### Stage "publish"
#
publish:unstable-repo:
stage: publish
......@@ -165,6 +180,10 @@ publish:unstable-repo:
# reprepro should pick this up in seconds and update the repository index.
#
### Stage "upgradetest"
#
# Upgrade the latest stable Aegir to our unstable repo.
upgradetest:debian-jessie-aegir3-apt-upgrade:
stage: upgradetest
......
......@@ -43,7 +43,10 @@ case "$1" in
fi
db_get "aegir/profile"
if [ ! -z "$RET" ]; then
FLAGS="$FLAGS --profile='$RET'"
PROFILE=$RET
FLAGS="$FLAGS --profile='$PROFILE'"
else
PROFILE='hostmaster'
fi
db_get "aegir/webserver"
if [ ! -z "$RET" ]; then
......@@ -111,28 +114,57 @@ case "$1" in
fi
db_get "aegir/db_host"
AEGIR_DB_HOST="$RET"
db_get "aegir/db_user"
AEGIR_DB_USER="$RET"
db_get "aegir/db_password"
AEGIR_DB_PASS="$RET"
if [ -z "$AEGIR_DB_PASS" ]; then
echo EMPTY database password, can not be good.
# Determin if we create a db accoount or ask for it.
# Starting from MariaDB 10.1... https://www.drupal.org/node/2770819
# TODO: Work with future versions
if dpkg -s mariadb-server-10.1 > /dev/null 2>&1
then
# MariaDB > 10.1
CREATEUSER=1
else
# Mysql & MariaDB < 10.1
CREATEUSER=0
fi
if [ $CREATEUSER = 0 ]; then
db_get "aegir/db_user"
AEGIR_DB_USER="$RET"
db_get "aegir/db_password"
AEGIR_DB_PASS="$RET"
if [ -z "$AEGIR_DB_PASS" ]; then
echo EMPTY database password, can not be good.
fi
fi
db_get "aegir/email"
EMAIL="$RET"
db_go
# forget the DB password in debconf storage
db_reset aegir/db_password || true
db_fset aegir/db_password "seen" "true" || true
if [ $CREATEUSER = 0 ]; then
# forget the DB password in debconf storage
db_reset aegir/db_password || true
db_fset aegir/db_password "seen" "true" || true
fi
db_stop
if [ $CREATEUSER = 1 ]; then
AEGIR_DB_USER="aegir_root"
# Random password, will be stored in /var/aegir/.drush/server_localhost.alias.drushrc.php
AEGIR_DB_PASS=$(openssl rand -base64 12)
/usr/bin/mysql -e "GRANT ALL ON *.* TO '$AEGIR_DB_USER'@'localhost' IDENTIFIED BY '$AEGIR_DB_PASS' WITH GRANT OPTION"
fi
if [ -d $AEGIRHOME/.drush/provision ]; then
echo "existing provision in $AEGIRHOME/.drush/provision detected, move away and try again"
exit 1
fi
echo "installing the Aegir frontend (Drupal with the hostmaster profile), please wait..."
echo "installing the Aegir frontend (Drupal with the $PROFILE profile), please wait..."
if [ "$DPKG_DEBUG" = "developer" ]; then
DEBUG="--debug"
fi
......
......@@ -23,7 +23,6 @@ EOF
set -x
sudo apt-get install --yes mariadb-server-10.1 php7.0-mysql php7.0-cli
sudo /usr/bin/mysql -e "GRANT ALL ON *.* TO 'aegir_root'@'localhost' IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION"
sudo DPKG_DEBUG=developer dpkg --install build/aegir3_*.deb build/aegir3-provision*.deb build/aegir3-hostmaster*.deb
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment