Groups community portal gating tasks

Bootstrap a new build environment and build/deploy the site as a
gating test.

Change-Id: I45efa824c3ca155b06915a2103dabed56f4e05c6
This commit is contained in:
Marton Kiss 2014-01-15 21:10:32 +01:00
parent 915750e661
commit eeb24cd279
2 changed files with 78 additions and 0 deletions

20
scripts/bootstrap.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
#
# Bootstrap a minimal environment required to build
# a Drupal distribution tarball on Ubuntu 12.04LTS (precise)
#
set -xe
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y unzip php5-mysql php5-gd php5-cli libapache2-mod-php5 mysql-server mysql-client php-pear git
# install drush 6.0.0
pear channel-discover pear.drush.org
pear install drush/drush-6.0.0
pear install Console_Table-1.1.3
# add drupal-site-deployment drush extension
wget https://github.com/mkissam/drush-dsd/archive/v0.3.tar.gz -O - | tar -xz
mv drush-dsd-0.3 /usr/share/php/drush/commands/dsd

58
scripts/gate-build.sh Executable file
View File

@ -0,0 +1,58 @@
#!/bin/bash
#
# Gating test script for Community portal
# 1. prepare mysql database
# 2. build distribution tarball
# 3. install "groups" profile
#
# Prerequisites:
# bootstrap.sh required for setup php/drush environment.
# git clone the project into groups directory.
#
set -xe
# create mysql database
mysql <<EOF
CREATE DATABASE groups;
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER
ON groups.*
TO 'groups'@'localhost' IDENTIFIED BY 'password';
EOF
# build distribution tarball
cd groups
drush make --tar build-groups.make ../groups-snapshot.tar.gz
cd ..
# drush alias template
cat >~/.drush/aliases.drushrc.php <<EOF
<?php
\$aliases['groups-dev'] = array(
'root' => '/srv/vhosts/groups.local/w',
'dsd-root' => '/srv/vhosts/groups.local',
'uri' => 'groups.local',
'databases' => array(
'default' => array(
'driver' => 'mysql',
'username' => 'groups',
'password' => 'password',
'port' => '',
'host' => 'localhost',
'database' => 'groups',
),
),
'file-owner' => 'root',
'file-group' => 'www-data',
'variables' => array(
'site_name' => 'Groups Test Deployment',
),
'profile' => 'groups',
'default-admin-password' => 'admin',
);
EOF
mkdir -p /srv/vhosts/groups.local
drush dsd-init @groups-dev groups-snapshot.tar.gz
drush @groups-dev status