1
0
mirror of https://github.com/danbee/danbarberphoto synced 2025-03-04 08:49:07 +00:00

Deploy to home directory

This commit is contained in:
Daniel Barber 2015-08-19 13:02:18 +01:00
parent cde05853d5
commit c211b4855c
2 changed files with 4 additions and 28 deletions

View File

@ -8,7 +8,7 @@ set :repo_url, 'git@github.com:danbee/danbarberphoto.git'
# ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp
# Default deploy_to directory is /var/www/my_app_name
set :deploy_to, '/var/apps/danbarberphoto'
set :deploy_to, '~/apps/danbarberphoto'
# Default value for :scm is :git
# set :scm, :git
@ -35,7 +35,7 @@ set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', '
# set :keep_releases, 5
#
set :rbenv_type, :user
set :rbenv_ruby, '2.2.1'
set :rbenv_ruby, '2.2.2'
namespace :deploy do
@ -51,34 +51,10 @@ namespace :deploy do
end
namespace :foreman do
desc 'Export the Procfile to Debian systemd scripts'
task :export do
on roles(:app) do |host|
log_path = shared_path.join('log')
environment_path = fetch(:foreman_env)
within release_path do
as :root do
execute :sudo, "foreman export initscript /etc/init.d/ -a #{fetch(:application)} -u #{host.user} -l #{log_path} -e #{environment_path}"
end
end
end
end
desc 'Start the application services'
task :start do
on roles(:app) do |host|
as :root do
execute :start, fetch(:application)
end
end
end
desc 'Stop the application services'
task :stop do
on roles(:app) do |host|
as :root do
execute :stop, fetch(:application)
end
execute :foreman, :start
end
end

View File

@ -7,7 +7,7 @@
# server 'example.com', user: 'deploy', roles: %w{app web}, other_property: :other_value
# server 'db.example.com', user: 'deploy', roles: %w{db}
server 'vps2.danbee.co.uk', user: 'danbarberphoto', roles: %w{app db web}
server 'vps2.danbee.co.uk', user: 'danbarber', roles: %w{app db web}