Advertisement
Guest User

Untitled

a guest
Sep 18th, 2016
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. Vagrantfile
  2.  
  3. # -*- mode: ruby -*-
  4. # vi: set ft=ruby :
  5. Vagrant.configure('2') do |config|
  6. config.vm.box = 'ubuntu/trusty64'
  7. config.vm.hostname = 'rails-dev-box'
  8. config.ssh.username = "vagrant"
  9. config.ssh.password = "vagrant"
  10.  
  11. config.vm.network :forwarded_port, guest: 3000, host: 3000
  12. config.vm.network :forwarded_port, guest: 4567, host: 4567
  13. config.vm.network :forwarded_port, guest: 6379, host: 6379
  14. config.vm.synced_folder "d:/Dropbox/Projects", "/home/dropbox"
  15.  
  16. config.vm.provision :shell, path: 'bootstrap.sh', keep_color: true
  17. #config.ssh.insert_key = false
  18. end
  19.  
  20.  
  21.  
  22. bootstrap.sh
  23. # The output of all these installation steps is noisy. With this utility
  24. # the progress report is nice and concise.
  25. function install {
  26. echo installing $1
  27. shift
  28. apt-get -y install "$@" >/dev/null 2>&1
  29. }
  30.  
  31. echo updating package information
  32. apt-add-repository -y ppa:brightbox/ruby-ng >/dev/null 2>&1
  33. apt-get -y update >/dev/null 2>&1
  34.  
  35. install 'development tools' build-essential
  36.  
  37. install Ruby ruby2.3 ruby2.3-dev
  38. update-alternatives --set ruby /usr/bin/ruby2.3 >/dev/null 2>&1
  39. update-alternatives --set gem /usr/bin/gem2.3 >/dev/null 2>&1
  40.  
  41. echo installing Bundler
  42. gem install bundler -N >/dev/null 2>&1
  43.  
  44. install Git git
  45. install SQLite sqlite3 libsqlite3-dev
  46. install memcached memcached
  47. install Redis redis-server
  48. install RabbitMQ rabbitmq-server
  49.  
  50. install PostgreSQL postgresql postgresql-contrib libpq-dev
  51. sudo -u postgres createuser --superuser vagrant
  52. sudo -u postgres createdb -O vagrant activerecord_unittest
  53. sudo -u postgres createdb -O vagrant activerecord_unittest2
  54.  
  55. debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
  56. debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
  57. install MySQL mysql-server libmysqlclient-dev
  58. mysql -uroot -proot <<SQL
  59. CREATE USER 'rails'@'localhost';
  60. CREATE DATABASE activerecord_unittest DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
  61. CREATE DATABASE activerecord_unittest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
  62. GRANT ALL PRIVILEGES ON activerecord_unittest.* to 'rails'@'localhost';
  63. GRANT ALL PRIVILEGES ON activerecord_unittest2.* to 'rails'@'localhost';
  64. GRANT ALL PRIVILEGES ON inexistent_activerecord_unittest.* to 'rails'@'localhost';
  65. SQL
  66.  
  67. install 'Nokogiri dependencies' libxml2 libxml2-dev libxslt1-dev
  68. install 'ExecJS runtime' nodejs
  69.  
  70. # Needed for docs generation.
  71. update-locale LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8
  72.  
  73. echo 'all set, rock on!'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement