Guest User

Untitled

a guest
Feb 5th, 2018
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.72 KB | None | 0 0
  1. C:vgrant2env>vagrant up
  2. There was an error loading a Vagrantfile. The file being loaded
  3. and the error message are shown below. This is usually caused by
  4. an invalid or undefined variable.
  5.  
  6. Path: C
  7. Line number: 0
  8. Message: undefined method `[]'
  9.  
  10. ip: 192.168.10.10
  11. s3:
  12. access_key: "AKIAIPRNHSWEQNWHLCDQ"
  13. secret_key: "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"
  14. bucket: "foggy-project-dhj6"
  15. synced_folder:
  16. host_path: "/vgrant2/code/"
  17. guest_path: "/vagrant2-code/"
  18. mysql:
  19. host: "127.0.0.1"
  20. username: root
  21. password: user123
  22. http_basic:
  23. repo_magento_com:
  24. username: a8adc3ac98245f519ua0d2v2c8770ec8
  25. password: a38488dc908c6d6923754c268vc41bc4
  26. github_oauth:
  27. github_com: "d79fb920d4m4c2fb9d8798b6ce3a043f0b7c2af6"
  28. magento:
  29. db_name: "magento"
  30. admin_firstname: "John"
  31. admin_lastname: "Doe"
  32. admin_password: "admin123"
  33. admin_user: "admin"
  34. admin_email: "email@change.me"
  35. backend_frontname: "admin"
  36. language: "en_US"
  37. currency: "USD"
  38. timezone: "Europe/London"
  39. base_url: "http://magento.box"
  40. fixture: "small"
  41.  
  42. # -*- mode: ruby -*-
  43. # vi: set ft=ruby :
  44. require 'yaml'
  45.  
  46. vagrantConfig = YAML.load_file 'Vagrantfile.config.yml'
  47.  
  48. Vagrant.configure(2) do |config|
  49. config.vm.box = "ubuntu/vivid64"
  50. config.vm.network "private_network", ip: vagrantConfig['ip']
  51.  
  52. config.vm.synced_folder vagrantConfig['synced_folder']['host_path'],vagrantConfig['synced_folder']['guest_path'], owner:"vagrant", group: "wwwdata", mount_options:["dmode=775, fmode=664"]
  53.  
  54. # VirtualBox specific settings
  55. config.vm.provider "virtualbox" do |vb|
  56. vb.gui = false
  57. vb.memory = "2048"
  58. vb.cpus = 2
  59. end
  60.  
  61. config.vm.provision "file", source: "~/.gitconfig", destination:".gitconfig"
  62. config.vm.provision "shell", inline: "sudo apt-get update"
  63.  
  64. config.vm.provision "shell", inline: "sudo apt-get -y install php5 php5-devphp5-curl php5-imagick php5-gd php5-mcrypt php5-mhash php5-mysql php5-xdebug php5-intl php5-xsl"
  65. config.vm.provision "shell", inline: "sudo php5enmod mcrypt"
  66. config.vm.provision "shell", inline: "echo "xdebug.max_nesting_level=200">> /etc/php5/apache2/php.ini"
  67. config.vm.provision "shell", inline: "sudo apt-get -y install phpunit"
  68.  
  69. config.vm.provision "shell", inline: "sudo debconf-set-selections <<<'mysql-server mysql-server/root_password password #{vagrantConfig['mysql']['password']}'"
  70. config.vm.provision "shell", inline: "sudo debconf-set-selections <<<'mysql-server mysql-server/root_password_again password #{vagrantConfig['mysql']['password']}'"
  71. config.vm.provision "shell", inline: "sudo apt-get -y install mysql-server"
  72. config.vm.provision "shell", inline: "sudo service mysql start"
  73. config.vm.provision "shell", inline: "sudo update-rc.d mysql defaults"
  74.  
  75. config.vm.provision "shell", inline: "sudo apt-get -y install apache2"
  76. config.vm.provision "shell", inline: "sudo update-rc.d apache2 defaults"
  77. config.vm.provision "shell", inline: "sudo service apache2 start"
  78. config.vm.provision "shell", inline: "sudo a2enmod rewrite"
  79. config.vm.provision "shell", inline: "sudo awk '/<Directory\/>/,/AllowOverride None/{sub("None", "All",$0)}{print}'/etc/apache2/apache2.conf > /tmp/tmp.apache2.conf"
  80. config.vm.provision "shell", inline: "sudo mv /tmp/tmp.apache2.conf/etc/apache2/apache2.conf"
  81. config.vm.provision "shell", inline: "sudo awk '/<Directory\/var\/www\/>/,/AllowOverride None/{sub("None", "All",$0)}{print}'/etc/apache2/apache2.conf > /tmp/tmp.apache2.conf"
  82. config.vm.provision "shell", inline: "sudo mv /tmp/tmp.apache2.conf/etc/apache2/apache2.conf"
  83. config.vm.provision "shell", inline: "sudo service apache2 stop"
  84.  
  85. config.vm.provision "shell", inline: "sudo rm -Rf /var/www/html"
  86. config.vm.provision "shell", inline: "sudo ln -s #{vagrantConfig['synced_folder']['guest_path']} /var/www/html"
  87.  
  88. config.vm.provision "shell", inline: "curl -sS https://getcomposer.org/installer | php"
  89. config.vm.provision "shell", inline: "mv composer.phar /usr/local/bin/composer"
  90. config.vm.provision "shell", inline: "composer clearcache"
  91. config.vm.provision "shell", inline: "echo '{"http-basic": {"repo.magento.com": {"username": "#{vagrantConfig ['http_basic']['repo_magento_com']['username']}","password": "#{vagrantConfig['http_basic']['repo_magento_com']['password']} "}},"github-oauth": {"github.com": "#{vagrantConfig['github_oauth']['github_com']}"}}' >> /root/.composer/auth.json"
  92. config.vm.provision "shell", inline: "composer create-project—repositoryurl=https://repo.magento.com/ magento/project- community-edition/var/www/html/"
  93.  
  94. config.vm.provision "shell", inline: "sudo mysql—user=#{vagrantConfig['mysql']['username']}—password=#{vagrantConfig['mysql']['password']} -e "CREATE DATABASE #{vagrantConfig['magento']['db_name']};""
  95. config.vm.provision "shell", inline: "sudo php /var/www/html/bin/magento setup:install --base- url="#{vagrantConfig['magento']['base_url']}" --dbhost="#{vagrantConfig['mysql']['host']}" --db- user="#{vagrantConfig['mysql']['username']}" --db- password="#{vagrantConfig['mysql']['password']}" --db- name="#{vagrantConfig['magento']['db_name']}" --admin- firstname="#{vagrantConfig['magento']['admin_firstname']}"—admin-lastname="#{vagrantConfig['magento']['admin_lastname']}" --admin-email="#{vagrantConfig['magento']['admin_email']}"—admin-user="#{vagrantConfig['magento']['admin_user']}"—admin-password="#{vagrantConfig['magento']['admin_password']}" --backend- frontname="#{vagrantConfig['magento']['backend_frontname']}" - -language="#{vagrantConfig['magento']['language']}"—currency="#{vagrantConfig['magento']['currency']}"—timezone="#{vagrantConfig['magento']['timezone']}""
  96. config.vm.provision "shell", inline: "sudo php /var/www/html/bin/magento deploy:mode:set developer"
  97. config.vm.provision "shell", inline: "sudo php /var/www/html/bin/magento cache:disable"
  98. config.vm.provision "shell", inline: "sudo php /var/www/html/bin/magento cache:flush"
  99. config.vm.provision "shell", inline: "sudo php /var/www/html/bin/magento setup:performance:generate-fixtures /var/www/html/setup/performancetoolkit/profiles/ce/small.xml"
  100.  
  101.  
  102.  
  103. end
Add Comment
Please, Sign In to add comment