hfuimq
Last Updated: February 25, 2016
·
2.711K
· dz0ny
842dac7e3ee429930f6b9de12837fe60

capistrano + vagrant

Can be used for dev, staging server... You name it.

config/deploy.rb

set :application, "vagrant"
set :repository,  "."

set :scm, :none

# vagrant ssh-config > .ssh/config, change "Host default" to "Host vagrant"
role :web, "vagrant"     
role :app, "vagrant"

#default run and user
set :use_sudo, true
set :user, 'root'
set :run_method, :sudo

# Must be set for the password prompt from git to work
default_run_options[:pty] = true

#uses local defined vagrant ssh config .ssh/config
ssh_options[:forward_agent] = true

# in Vagrantfile config.vm.share_folder "airtime-devel", "/opt/airtime","./airtime-devel"
set :vagrant_mount_path, "/opt/airtime/devel/"

namespace :update do

  desc "Update playout"
  task :playout, :roles => :app do
    run "#{vagrant_mount_path}/install_minimal/airtime-install -p"
    run "airtime-liquidsoap -p /usr/lib/airtime/pypo/bin/liquidsoap_scripts/ls_script.liq"
  end

  desc "Update web"
  task :web, :roles => :app do
    run "#{vagrant_mount_path}/install_minimal/airtime-install -w"
  end

  desc "Update media monitor"
  task :media, :roles => :app do
    run "#{vagrant_mount_path}/install_minimal/airtime-install -m"
  end

end

desc 'Check setup'
task :check, :roles => :app do
  run "airtime-liquidsoap -p /usr/lib/airtime/pypo/bin/liquidsoap_scripts/ls_script.liq"
end

desc 'Tail airtime log'
task :tail_play, :roles => :app do
  run "airtime-log -t playout"
end

desc 'Tail airtime log'
task :tail_liq, :roles => :app do
  run "airtime-log -t liquidsoap"
end
Say Thanks
Respond

3 Responses
Add your response

6447
88451e8964faf5d2bf25768a1184595d

Tip on vagrant ssh-config was SO useful. Thanks!

over 1 year ago ·
6959
7e945991d1d70075cff59331d72ef4d8

You has this line:

# vagrant ssh-config > .ssh/config, change "Host default" to "Host vagrant"

You could instead config.vm.define = "vagrant" and now it will use that instead of default :)

over 1 year ago ·
11343
3f98c2813f9b55c867d044e7e030c222

vagrant ssh-config > .ssh/config should be vagrant ssh-config >> .ssh/config

over 1 year ago ·
Filed Under