Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

78 lines (63 sloc) 1.794 kb
require 'bundler'
Bundler.require :development
require 'bundler/capistrano'
require 'capify-ec2/capistrano'
ssh_options[:forward_agent] = true
default_run_options[:pty] = true
set :application, "astor-dashboard"
set :scm, :git
##
## Deployment settings
##
set :repository, "https://github.com/malditogeek/astor-dashboard.git"
set :user, "ubuntu"
set :deploy_to, "/var/astor/#{application}"
set :user, user
set :branch, "master"
set :scm_verbose, false
set :use_sudo, false
ec2_roles :name => :app, :options => { :default => true }
set :keep_releases, 5
after "deploy:update", "deploy:cleanup"
after "deploy:update", "foreman:export"
after "deploy:update", "npm:install"
after "deploy:create_symlink", "haproxy:symlink"
namespace :deploy do
task :stop do
run "sudo stop dashboard"
end
task :start do
run "sudo start dashboard"
end
task :restart do
run "sudo start dashboard || sudo restart dashboard"
end
end
namespace :foreman do
desc "Export the Procfile to Ubuntu's upstart scripts"
task :export do
run "cd #{release_path} && sudo bundle exec foreman export upstart /etc/init -t config/upstart -a dashboard -c dashboard=1 -u #{user} -l #{shared_path}/log"
end
desc "Start the application services"
task :start do
sudo "start dashboard"
end
desc "Stop the application services"
task :stop do
sudo "stop dashboard"
end
end
namespace :npm do
desc "Install NPM dependencies"
task :install do
run "cd #{release_path} && npm install"
end
end
namespace :haproxy do
desc "Symlink HAproxy to the latest config"
task :symlink do
run "#{sudo} rm -f /etc/haproxy/haproxy.cfg"
run "#{sudo} ln -s #{release_path}/config/haproxy.cfg /etc/haproxy/haproxy.cfg"
run "#{sudo} /etc/init.d/haproxy reload"
end
end
Jump to Line
Something went wrong with that request. Please try again.