Merge lp:~flocculant/ubuntu-qa-website/qasetup into lp:ubuntu-qa-website

Proposed by Kev Bowring on 2016-02-28
Status: Merged
Merged at revision: 426
Proposed branch: lp:~flocculant/ubuntu-qa-website/qasetup
Merge into: lp:ubuntu-qa-website
Diff against target: 132 lines (+127/-0)
1 file modified
scripts/qatracker-setup.sh (+127/-0)
To merge this branch: bzr merge lp:~flocculant/ubuntu-qa-website/qasetup
Reviewer Review Type Date Requested Status
Nicholas Skaggs 2016-02-28 Approve on 2016-03-01
Review via email: mp+287402@code.launchpad.net

Description of the Change

Adds the development setup script to ubuntu-qa-website/scripts

Uses localhost for Apache server.

Based on Irfan Smajevic's script from GCI - unsure what I need to add to this to cover that.

To post a comment you must log in.
Nicholas Skaggs (nskaggs) wrote :

Brillant. Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'scripts/qatracker-setup.sh'
2--- scripts/qatracker-setup.sh 1970-01-01 00:00:00 +0000
3+++ scripts/qatracker-setup.sh 2016-02-28 09:32:26 +0000
4@@ -0,0 +1,127 @@
5+#!/bin/bash
6+
7+# A script that installs dependencies and sets up the development environment for the Ubuntu QATracker
8+
9+echo "At a minimum you should be using Ubuntu 14.04 to install this development environment"
10+echo "This is an automated script for setting up a dev environment for the Ubuntu QATracker."
11+echo
12+echo "This script will use localhost for your Apache server: " localhost
13+echo
14+
15+#### Installation of dependencies
16+echo "Installing dependencies"
17+
18+sudo debconf-set-selections <<< "postfix postfix/main_mailer_type select No configuration"
19+sudo DEBIAN_FRONTEND=noninteractive apt-get -y install php5-pgsql postgresql apache2 drupal7 bzr
20+
21+#### Setting up Apache2
22+echo
23+echo "Setting up Apache server"
24+
25+sudo sh -c ' cat > /etc/apache2/sites-enabled/000-default.conf <<- _EOF_
26+ <VirtualHost *:80>
27+ #NOWEBSTATS
28+ ServerName 'localhost'
29+
30+ DocumentRoot /usr/share/drupal7
31+
32+ # Protect the /scripts directory.
33+ RewriteEngine on
34+ RewriteRule ^/scripts(|/.*) http://%{SERVER_NAME}/ [R=301,L]
35+ </VirtualHost>
36+_EOF_'
37+
38+#### Creating new user
39+sudo userdel qatracker
40+# FIXME Find better way to do this
41+echo -e "qatracker\nqatracker\n\n\n\n\n\ny\n" | sudo adduser qatracker
42+
43+#### Setting up Drupal7
44+echo
45+echo "Configuring Drupal"
46+cat <<- _EOF1_
47+
48+ For Drupal setup the following will be chosen:
49+ * Database: pgsql
50+ * Connection method: unix socket
51+ * Authentication method: ident
52+ * Postgres authentication method: ident
53+ * Database admin user: "postgres"
54+ * Username for drupal7: "qatracker"
55+ * Password for postgres application: will be generated randomly
56+ * Database name for drupal7: qatracker
57+_EOF1_
58+
59+sudo debconf-set-selections <<< "drupal7 drupal7/pgsql/authmethod-user select ident"
60+sudo debconf-set-selections <<< "drupal7 drupal7/db/app-user string qatracker"
61+sudo debconf-set-selections <<< "drupal7 drupal7/pgsql/method select unix socket"
62+sudo debconf-set-selections <<< "drupal7 drupal7/internal/reconfiguring boolean true"
63+sudo debconf-set-selections <<< "drupal7 drupal7/db/dbname string qatracker"
64+sudo debconf-set-selections <<< "drupal7 drupal7/pgsql/authmethod-user select ident"
65+sudo debconf-set-selections <<< "drupal7 drupal7/pgsql/admin-user string postgres"
66+sudo debconf-set-selections <<< "drupal7 drupal7/database-type select pgsql"
67+
68+sudo DEBIAN_FRONTEND=noninteractive dpkg-reconfigure debconf drupal7
69+
70+#### Installing QATracker modules
71+echo "Installing QATracker modules"
72+bzr branch lp:ubuntu-qa-website
73+sudo cp -R ubuntu-qa-website/modules/* /usr/share/drupal7/modules/
74+rm -rf ubuntu-qa-website
75+
76+#### Adding OpenID modules
77+echo "Installing OpenID modules"
78+bzr branch lp:~ubuntu-qa-website-devel/ubuntu-qa-website/drupal-launchpad-7.x drupal-launchpad
79+bzr branch lp:~ubuntu-drupal-devs/drupal-teams/7.x-dev/ drupal-teams
80+sudo cp -R drupal-teams drupal-launchpad /usr/share/drupal7/modules
81+rm -rf drupal-launchpad drupal-teams
82+
83+#### Applying theme
84+echo "Installing Antonelli theme"
85+wget http://ftp.drupal.org/files/projects/antonelli-7.x-1.0-rc1.tar.gz
86+tar xvzf antonelli-7.x-1.0-rc1.tar.gz
87+sudo cp -R antonelli /usr/share/drupal7/themes/
88+rm -rf antonelli-7.x-1.0-rc1.tar.gz antonelli
89+
90+#### Activate Apache
91+echo "Activating Apache"
92+sudo a2enmod rewrite
93+sudo service apache2 restart
94+
95+#### Launching Drupal Wizard
96+URL="http://localhost/install.php"
97+
98+echo "You will be redirected to your browser to finish with the setup of the website:"
99+cat <<- _EOF_
100+ In the wizard, choose following:
101+ * Modules: Standard
102+ * Language: English
103+ Site Information
104+ * Name: IP or anything you wish
105+ * email: anything you wish (root@localhost.com)
106+ * username and password of your choosing
107+
108+ In modules tab, do following:
109+ * Uncheck the search module
110+ * Under Other, enable Launchpad OpenID and OpenID Teams if desired
111+ * Under Ubuntu QA, enable all modules
112+
113+ To set theme (optional), in appearance tab:
114+ * Find Antonelli and click 'enable and set default'
115+ * Click settings
116+ * Set color for Link color, Header top and Header bottom to #DD4814.
117+ * Uncheck the site name
118+_EOF_
119+
120+# Opening in browser
121+if which xdg-open > /dev/null
122+then
123+ xdg-open $URL
124+elif which gnome-open > /dev/null
125+then
126+ gnome-open $URL
127+fi
128+
129+echo "For additional information on how to set up your website, please visit: https://wiki.ubuntu.com/Testing/ISO/DevEnv"
130+echo
131+echo "Done"
132\ No newline at end of file

Subscribers

People subscribed via source and target branches