Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. # The output of all these installation steps is noisy. With this utility
  2. # the progress report is nice and concise.
  3. function install {
  4. echo installing $1
  5. shift
  6. apt-get -y install "$@" >/dev/null 2>&1
  7. }
  8.  
  9. echo adding swap file
  10. fallocate -l 2G /swapfile
  11. chmod 600 /swapfile
  12. mkswap /swapfile
  13. swapon /swapfile
  14. echo '/swapfile none swap defaults 0 0' >> /etc/fstab
  15.  
  16. echo updating package information
  17. apt-add-repository -y ppa:brightbox/ruby-ng >/dev/null 2>&1
  18. apt-get -y update >/dev/null 2>&1
  19.  
  20. install 'development tools' build-essential
  21.  
  22. install Ruby ruby2.3 ruby2.3-dev
  23. update-alternatives --set ruby /usr/bin/ruby2.3 >/dev/null 2>&1
  24. update-alternatives --set gem /usr/bin/gem2.3 >/dev/null 2>&1
  25.  
  26. echo installing Bundler
  27. gem install bundler -N >/dev/null 2>&1
  28.  
  29. install Git git
  30. install SQLite sqlite3 libsqlite3-dev
  31. install memcached memcached
  32. install Redis redis-server
  33. install RabbitMQ rabbitmq-server
  34.  
  35. install PostgreSQL postgresql postgresql-contrib libpq-dev
  36. sudo -u postgres createuser --superuser ubuntu
  37. sudo -u postgres createdb -O ubuntu activerecord_unittest
  38. sudo -u postgres createdb -O ubuntu activerecord_unittest2
  39.  
  40. debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
  41. debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
  42. install MySQL mysql-server libmysqlclient-dev
  43. mysql -uroot -proot <<SQL
  44. CREATE USER 'rails'@'localhost';
  45. CREATE DATABASE activerecord_unittest DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
  46. CREATE DATABASE activerecord_unittest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
  47. GRANT ALL PRIVILEGES ON activerecord_unittest.* to 'rails'@'localhost';
  48. GRANT ALL PRIVILEGES ON activerecord_unittest2.* to 'rails'@'localhost';
  49. GRANT ALL PRIVILEGES ON inexistent_activerecord_unittest.* to 'rails'@'localhost';
  50. SQL
  51.  
  52. install 'Nokogiri dependencies' libxml2 libxml2-dev libxslt1-dev
  53. install 'Blade dependencies' libncurses5-dev
  54. install 'ExecJS runtime' nodejs
  55.  
  56. # Needed for docs generation.
  57. update-locale LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8
  58.  
  59. echo 'all set, rock on!'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement