github.com/dahs81/otto@v0.2.1-0.20160126165905-6400716cf085/builtin/app/ruby/data/common/dev/Vagrantfile.tpl (about)

     1  {% extends "compile:data/app/dev/Vagrantfile.tpl" %}
     2  
     3  {% block vagrant_config %}
     4    config.vm.provision "shell", inline: $script_app, privileged: false
     5  {% endblock %}
     6  
     7  {% block footer %}
     8  $script_app = <<SCRIPT
     9  . /otto/scriptpacks/STDLIB/main.sh
    10  . /otto/scriptpacks/RUBY/main.sh
    11  otto_init
    12  
    13  # Make it so that `vagrant ssh` goes directly to the correct dir
    14  vagrant_default_cd "vagrant" "/vagrant"
    15  
    16  # Go to our working directory and install gems
    17  cd /vagrant
    18  ruby_gemfile_apt
    19  otto_output "Bundling gem dependencies..."
    20  bundle
    21  
    22  {% if app_type == "rails" %}
    23    otto_output "Detected Rails application"
    24  
    25    if has_gem pg; then
    26      otto_output "Detected the pg gem, installing PostgreSQL..."
    27      . /etc/default/locale
    28      oe sudo apt-get install -y postgresql-9.1
    29      oe sudo -u postgres createuser --superuser vagrant
    30    fi
    31  
    32    otto_output "Preparing the database..."
    33    oe "bundle exec rake db:setup || bundle exec rake db:migrate"
    34  {% endif %}
    35  
    36  SCRIPT
    37  {% endblock %}