Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # A script that installs and sets up the development environment for the Ubuntu QATracker
- echo "This is an automated script for setting up a dev environment for the Ubuntu QATracker."
- echo
- read -p "Enter the IP Adress for your Apache server: " SERVER_IP
- echo
- #### Installation of dependencies
- sudo debconf-set-selections <<< "postfix postfix/main_mailer_type select No configuration"
- echo " Installing dependencies"
- sudo DEBIAN_FRONTEND=noninteractive apt-get -y install php5-pgsql postgresql apache2 drupal7 bzr
- #### Setting up Apache2
- echo
- echo " Setting up Apache server"
- sudo sh -c ' cat > /etc/apache2/sites-enabled/000-default.conf <<- _EOF_
- <VirtualHost *:80>
- #NOWEBSTATS
- ServerName '$SERVER_IP'
- DocumentRoot /usr/share/drupal7
- # Protect the /scripts directory.
- RewriteEngine on
- RewriteRule ^/scripts(|/.*) http://%{SERVER_NAME}/ [R=301,L]
- </VirtualHost>
- _EOF_'
- #### Setting up Drupal7
- echo "You may be propted to set up Drupal."
- sudo userdel qatracker
- #### FIXME Find better way to do this
- echo -e "qatracker\nqatracker\n\n\n\n\n\ny\n" | sudo adduser qatracker
- cat <<- _EOF1_
- For Drupal setup please choose the following:
- * Reconfigure, select yes
- * Database, select pgsql
- * Connection method unix, select unix socket
- * Authentication method, select ident
- * Postgres authentication method, select ident
- * Database admin user, enter postgres
- * Username for drupal7, enter qatracker
- * Password for postgres application, leave blank (it will generate random password).
- If you wish, this can be set to a password of your choosing but should not be required.
- * Database name for drupal7, enter qatracker
- * Visit link for this list: https://wiki.ubuntu.com/Testing/ISO/DevEnv
- _EOF1_
- sudo debconf-set-selections <<< "drupal7 drupal7/pgsql/authmethod-user select ident"
- sudo debconf-set-selections <<< "drupal7 drupal7/db/app-user string qatracker"
- sudo debconf-set-selections <<< "drupal7 drupal7/pgsql/method select unix socket"
- sudo debconf-set-selections <<< "drupal7 drupal7/internal/reconfiguring boolean true"
- sudo debconf-set-selections <<< "drupal7 drupal7/db/dbname string qatracker"
- sudo debconf-set-selections <<< "drupal7 drupal7/pgsql/authmethod-user select ident"
- sudo debconf-set-selections <<< "drupal7 drupal7/pgsql/admin-user string postgres"
- sudo debconf-set-selections <<< "drupal7 drupal7/database-type select pgsql"
- sudo DEBIAN_FRONTEND=noninteractive dpkg-reconfigure debconf drupal7
- #### Installing QATracker modules
- bzr branch lp:ubuntu-qa-website
- sudo cp -R ubuntu-qa-website/modules/* /usr/share/drupal7/modules/
- rm -rf ubuntu-qa-website
- ### Adding OpenID modules
- bzr branch lp:~ubuntu-qa-website-devel/ubuntu-qa-website/drupal-launchpad-7.x drupal-launchpad
- bzr branch lp:~ubuntu-drupal-devs/drupal-teams/7.x-dev/ drupal-teams
- sudo cp -R drupal-teams drupal-launchpad /usr/share/drupal7/modules
- rm -rf drupal-launchpad drupal-teams
- ### Applying theme
- wget http://ftp.drupal.org/files/projects/antonelli-7.x-1.0-rc1.tar.gz
- tar xvzf antonelli-7.x-1.0-rc1.tar.gz
- sudo cp -R antonelli /usr/share/drupal7/themes/
- rm -rf antonelli-7.x-1.0-rc1.tar.gz antonelli
- #### Activate Apache
- sudo a2enmod rewrite
- sudo service apache2 restart
- ### Launching Drupal Wizard
- echo "For more information on how to set up your website, please go to: https://wiki.ubuntu.com/Testing/ISO/DevEnv"
- URL="http://localhost/install.php"
- echo "On how to use bazaar, please visit: https://wiki.ubuntu.com/QATeam/DevelopmentToolsSetup"
- if which xdg-open > /dev/null
- then
- xdg-open $URL
- elif which gnome-open > /dev/null
- then
- gnome-open $URL
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement