Advertisement
Guest User

DevEnv.sh

a guest
Dec 10th, 2015
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.61 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # A script that installs and sets up the development environment for the Ubuntu QATracker
  4.  
  5. echo "This is an automated script for setting up a dev environment for the Ubuntu QATracker."
  6. echo
  7. read -p "Enter the IP Adress for your Apache server: " SERVER_IP
  8. echo
  9.  
  10. #### Installation of dependencies
  11. sudo debconf-set-selections <<< "postfix postfix/main_mailer_type select No configuration"
  12. echo " Installing dependencies"
  13. sudo DEBIAN_FRONTEND=noninteractive apt-get -y install php5-pgsql postgresql apache2 drupal7 bzr
  14.  
  15. #### Setting up Apache2
  16. echo
  17. echo " Setting up Apache server"
  18. sudo sh -c ' cat > /etc/apache2/sites-enabled/000-default.conf <<- _EOF_
  19.     <VirtualHost *:80>
  20.         #NOWEBSTATS
  21.         ServerName      '$SERVER_IP'
  22.  
  23.         DocumentRoot    /usr/share/drupal7
  24.  
  25.         # Protect the /scripts directory.
  26.         RewriteEngine on
  27.         RewriteRule   ^/scripts(|/.*) http://%{SERVER_NAME}/ [R=301,L]
  28.     </VirtualHost>
  29. _EOF_'
  30.  
  31. #### Setting up Drupal7
  32. echo "You may be propted to set up Drupal."
  33. sudo userdel qatracker
  34. #### FIXME Find better way to do this
  35. echo -e "qatracker\nqatracker\n\n\n\n\n\ny\n" | sudo adduser qatracker
  36.  
  37. cat <<- _EOF1_
  38.  
  39.     For Drupal setup please choose the following:
  40.     * Reconfigure, select yes
  41.     * Database, select pgsql
  42.     * Connection method unix, select unix socket
  43.     * Authentication method, select ident
  44.     * Postgres authentication method, select ident
  45.     * Database admin user, enter postgres
  46.     * Username for drupal7, enter qatracker
  47.     * Password for postgres application, leave blank (it will generate random password).
  48.       If you wish, this can be set to a password of your choosing but should not be required.
  49.     * Database name for drupal7, enter qatracker
  50.     * Visit link for this list: https://wiki.ubuntu.com/Testing/ISO/DevEnv
  51. _EOF1_
  52.  
  53. sudo debconf-set-selections <<< "drupal7 drupal7/pgsql/authmethod-user select ident"
  54. sudo debconf-set-selections <<< "drupal7 drupal7/db/app-user string qatracker"
  55. sudo debconf-set-selections <<< "drupal7 drupal7/pgsql/method select unix socket"
  56. sudo debconf-set-selections <<< "drupal7 drupal7/internal/reconfiguring boolean true"
  57. sudo debconf-set-selections <<< "drupal7 drupal7/db/dbname string qatracker"
  58. sudo debconf-set-selections <<< "drupal7 drupal7/pgsql/authmethod-user select ident"
  59. sudo debconf-set-selections <<< "drupal7 drupal7/pgsql/admin-user string postgres"
  60. sudo debconf-set-selections <<< "drupal7 drupal7/database-type select pgsql"
  61.  
  62. sudo DEBIAN_FRONTEND=noninteractive dpkg-reconfigure debconf drupal7
  63.  
  64. #### Installing QATracker modules
  65. bzr branch lp:ubuntu-qa-website
  66. sudo cp -R ubuntu-qa-website/modules/* /usr/share/drupal7/modules/
  67. rm -rf ubuntu-qa-website
  68.  
  69. ### Adding OpenID modules
  70. bzr branch lp:~ubuntu-qa-website-devel/ubuntu-qa-website/drupal-launchpad-7.x drupal-launchpad
  71. bzr branch lp:~ubuntu-drupal-devs/drupal-teams/7.x-dev/ drupal-teams
  72. sudo cp -R drupal-teams drupal-launchpad /usr/share/drupal7/modules
  73. rm -rf drupal-launchpad drupal-teams
  74.  
  75. ### Applying theme
  76. wget http://ftp.drupal.org/files/projects/antonelli-7.x-1.0-rc1.tar.gz
  77. tar xvzf antonelli-7.x-1.0-rc1.tar.gz
  78. sudo cp -R antonelli /usr/share/drupal7/themes/
  79. rm -rf antonelli-7.x-1.0-rc1.tar.gz antonelli
  80.  
  81. #### Activate Apache
  82. sudo a2enmod rewrite
  83. sudo service apache2 restart
  84.  
  85. ### Launching Drupal Wizard
  86. echo "For more information on how to set up your website, please go to: https://wiki.ubuntu.com/Testing/ISO/DevEnv"
  87. URL="http://localhost/install.php"
  88. echo "On how to use bazaar, please visit: https://wiki.ubuntu.com/QATeam/DevelopmentToolsSetup"
  89. if which xdg-open > /dev/null
  90. then
  91.   xdg-open $URL
  92. elif which gnome-open > /dev/null
  93. then
  94.   gnome-open $URL
  95. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement