mirror of
https://github.com/ENSL/ensl.org.git
synced 2025-05-31 08:51:13 +00:00
Updated unicorn config
Updated gem versions Removed foreman
This commit is contained in:
parent
81700faa1d
commit
bc1c00aa02
8 changed files with 77 additions and 111 deletions
|
@ -3,6 +3,7 @@ lock '3.1.0'
|
|||
set :application, 'ensl'
|
||||
set :deploy_user, 'deploy'
|
||||
set :deploy_to, '/var/www/virtual/ensl.org/deploy'
|
||||
set :deploy_via, :remote_cache
|
||||
set :pty, true
|
||||
|
||||
set :scm, :git
|
||||
|
@ -11,14 +12,18 @@ set :keep_releases, 10
|
|||
|
||||
set :rbenv_type, :user
|
||||
set :rbenv_ruby, '2.1.1'
|
||||
set :rbenv_sudo, "sudo /home/#{fetch(:deploy_user)}/.rbenv/bin/rbenv sudo"
|
||||
|
||||
set :unicorn_config_path, "config/unicorn.rb"
|
||||
set :unicorn_rack_env, fetch(:rails_env)
|
||||
|
||||
set :writable_dirs, %w{public tmp}
|
||||
set :linked_files, %w{.env}
|
||||
set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle
|
||||
public/system public/local public/uploads}
|
||||
|
||||
set :writable_dirs, %w{public tmp}
|
||||
set :normalize_asset_timestamps, %{public/images public/javascripts public/stylesheets}
|
||||
set :normalize_asset_timestamps, %{public/images
|
||||
public/javascripts
|
||||
public/stylesheets}
|
||||
|
||||
namespace :deploy do
|
||||
namespace :check do
|
||||
|
@ -38,43 +43,9 @@ namespace :deploy do
|
|||
end
|
||||
end
|
||||
|
||||
desc 'Restart application'
|
||||
task :restart do
|
||||
invoke 'foreman:export'
|
||||
invoke 'foreman:restart'
|
||||
invoke 'unicorn:restart'
|
||||
end
|
||||
|
||||
after :publishing, :restart
|
||||
end
|
||||
|
||||
namespace :foreman do
|
||||
desc "Export the Procfile to Ubuntu's upstart scripts"
|
||||
task :export do
|
||||
on roles(:app) do |host|
|
||||
within release_path do
|
||||
execute fetch(:rbenv_sudo), "bundle exec foreman export upstart /etc/init -a #{fetch(:application)} -u #{fetch(:deploy_user)} -l #{fetch(:deploy_to)}/shared/log"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
desc "Start the application services"
|
||||
task :start do
|
||||
on roles(:app) do |host|
|
||||
execute "sudo service #{fetch(:application)} start"
|
||||
end
|
||||
end
|
||||
|
||||
desc "Stop the application services"
|
||||
task :stop do
|
||||
on roles(:app) do |host|
|
||||
execute "sudo service #{fetch(:application)} stop"
|
||||
end
|
||||
end
|
||||
|
||||
desc "Restart the application services"
|
||||
task :restart do
|
||||
on roles(:app) do |host|
|
||||
execute "sudo service #{fetch(:application)} start || #{sudo} service #{fetch(:application)} restart"
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue