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

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

Subscribers

People subscribed via source and target branches