Nothing happens after Capistrano deploy command












0














I am using Capistrano gem for deploy management of my Ruby on Rails app. Its connected with AWS server, EC2, MySQL Redis. While I am putting my command "cap production deploy" or "cap staging deploy" nothing happens. I just got stuck there.



To add here my SSH key is properly added. And in my AWS security groups, only the authorized IPs are added to have the permission of deploying. My IPs are also added.



But when I add open ports 0.0.0.0/0 in all security groups it allows me to deploy. But I shouldn't add open ports for the sace of application security.



What can be the reason and how to solve these?



screenshot of my console, nothing happens



X



Below is my deploy.rb file:



SSHKit.config.command_map[:rake] = 'bundle exec rake'
# config valid only for current version of Capistrano
lock '3.8.1'

set :application, 'my_app'
set :repo_url, 'git@gitlab.com:_____'
set :deploy_via, :remote_cache

set :rvm_roles, [:app, :web]
set :rvm_type, :user
set :rvm_ruby_version, 'ruby-2.4.0'

set :log_level, :debug
set :pty, false
set :linked_files, %w{config/application.yml config/database.yml}
set :linked_dirs, %w{log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system public/assets public/uploads}

set :keep_releases, 10
set :whenever_roles, [:web, :app,:db]
set :whenever_identifier, "#{fetch(:application)}_#{fetch(:stage)}"

namespace :deploy do

desc 'restart (upgrade) unicorn server'
task :restart do
invoke 'unicorn:restart'
end

after :finishing, 'deploy:cleanup'
after 'deploy:publishing', 'deploy:restart'

after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
within release_path do
execute :rake, 'tmp:cache:clear'
end
end
end

end

namespace :delayed_job do

desc 'List of running delayed job workers'
task :list do
on roles(:all) do |host|
execute :ps, 'aux | grep delayed_job'
end
end

desc 'Stop delayed_job workers forcefully'
task :kill do
on roles(:all) do |host|
execute :kill, "-9 $(ps aux | grep delayed_job | awk '{print $2}')"
end
end

end

task :upload_secret_files do
on roles(:all) do |host|
begin
execute "mkdir -p #{shared_path}/config"
rescue
end
upload! 'config/application.yml', "#{shared_path}/config/application.yml"
upload! 'config/database.yml', "#{shared_path}/config/database.yml"
end
end

task :log do
on roles(:all) do |host|
execute "tail -f #{current_path}/log/#{fetch(:rails_env)}.log"
end
end

desc 'Invoke a rake command on the remote server'
task :invoke, [:command] => 'deploy:set_rails_env' do |task, args|
on primary(:app) do
within current_path do
with rails_env: fetch(:rails_env) do
rake args[:command]
end
end
end
end









share|improve this question
























  • check your capistrano log file (on your app's logs folder), maybe there's something on the file
    – arieljuod
    Nov 10 at 17:31










  • Please post your deploy.rb code here.
    – Mohit Kumar
    Nov 10 at 20:02










  • @MohitKumar deploy.rb code is added above just below my post.
    – Shakil Mahmood
    Nov 10 at 21:20










  • @arieljuod checked my log file. Nothing unusual there..
    – Shakil Mahmood
    Nov 10 at 21:21










  • Did you get any timeout message ?
    – Mohit Kumar
    Nov 10 at 23:13
















0














I am using Capistrano gem for deploy management of my Ruby on Rails app. Its connected with AWS server, EC2, MySQL Redis. While I am putting my command "cap production deploy" or "cap staging deploy" nothing happens. I just got stuck there.



To add here my SSH key is properly added. And in my AWS security groups, only the authorized IPs are added to have the permission of deploying. My IPs are also added.



But when I add open ports 0.0.0.0/0 in all security groups it allows me to deploy. But I shouldn't add open ports for the sace of application security.



What can be the reason and how to solve these?



screenshot of my console, nothing happens



X



Below is my deploy.rb file:



SSHKit.config.command_map[:rake] = 'bundle exec rake'
# config valid only for current version of Capistrano
lock '3.8.1'

set :application, 'my_app'
set :repo_url, 'git@gitlab.com:_____'
set :deploy_via, :remote_cache

set :rvm_roles, [:app, :web]
set :rvm_type, :user
set :rvm_ruby_version, 'ruby-2.4.0'

set :log_level, :debug
set :pty, false
set :linked_files, %w{config/application.yml config/database.yml}
set :linked_dirs, %w{log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system public/assets public/uploads}

set :keep_releases, 10
set :whenever_roles, [:web, :app,:db]
set :whenever_identifier, "#{fetch(:application)}_#{fetch(:stage)}"

namespace :deploy do

desc 'restart (upgrade) unicorn server'
task :restart do
invoke 'unicorn:restart'
end

after :finishing, 'deploy:cleanup'
after 'deploy:publishing', 'deploy:restart'

after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
within release_path do
execute :rake, 'tmp:cache:clear'
end
end
end

end

namespace :delayed_job do

desc 'List of running delayed job workers'
task :list do
on roles(:all) do |host|
execute :ps, 'aux | grep delayed_job'
end
end

desc 'Stop delayed_job workers forcefully'
task :kill do
on roles(:all) do |host|
execute :kill, "-9 $(ps aux | grep delayed_job | awk '{print $2}')"
end
end

end

task :upload_secret_files do
on roles(:all) do |host|
begin
execute "mkdir -p #{shared_path}/config"
rescue
end
upload! 'config/application.yml', "#{shared_path}/config/application.yml"
upload! 'config/database.yml', "#{shared_path}/config/database.yml"
end
end

task :log do
on roles(:all) do |host|
execute "tail -f #{current_path}/log/#{fetch(:rails_env)}.log"
end
end

desc 'Invoke a rake command on the remote server'
task :invoke, [:command] => 'deploy:set_rails_env' do |task, args|
on primary(:app) do
within current_path do
with rails_env: fetch(:rails_env) do
rake args[:command]
end
end
end
end









share|improve this question
























  • check your capistrano log file (on your app's logs folder), maybe there's something on the file
    – arieljuod
    Nov 10 at 17:31










  • Please post your deploy.rb code here.
    – Mohit Kumar
    Nov 10 at 20:02










  • @MohitKumar deploy.rb code is added above just below my post.
    – Shakil Mahmood
    Nov 10 at 21:20










  • @arieljuod checked my log file. Nothing unusual there..
    – Shakil Mahmood
    Nov 10 at 21:21










  • Did you get any timeout message ?
    – Mohit Kumar
    Nov 10 at 23:13














0












0








0







I am using Capistrano gem for deploy management of my Ruby on Rails app. Its connected with AWS server, EC2, MySQL Redis. While I am putting my command "cap production deploy" or "cap staging deploy" nothing happens. I just got stuck there.



To add here my SSH key is properly added. And in my AWS security groups, only the authorized IPs are added to have the permission of deploying. My IPs are also added.



But when I add open ports 0.0.0.0/0 in all security groups it allows me to deploy. But I shouldn't add open ports for the sace of application security.



What can be the reason and how to solve these?



screenshot of my console, nothing happens



X



Below is my deploy.rb file:



SSHKit.config.command_map[:rake] = 'bundle exec rake'
# config valid only for current version of Capistrano
lock '3.8.1'

set :application, 'my_app'
set :repo_url, 'git@gitlab.com:_____'
set :deploy_via, :remote_cache

set :rvm_roles, [:app, :web]
set :rvm_type, :user
set :rvm_ruby_version, 'ruby-2.4.0'

set :log_level, :debug
set :pty, false
set :linked_files, %w{config/application.yml config/database.yml}
set :linked_dirs, %w{log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system public/assets public/uploads}

set :keep_releases, 10
set :whenever_roles, [:web, :app,:db]
set :whenever_identifier, "#{fetch(:application)}_#{fetch(:stage)}"

namespace :deploy do

desc 'restart (upgrade) unicorn server'
task :restart do
invoke 'unicorn:restart'
end

after :finishing, 'deploy:cleanup'
after 'deploy:publishing', 'deploy:restart'

after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
within release_path do
execute :rake, 'tmp:cache:clear'
end
end
end

end

namespace :delayed_job do

desc 'List of running delayed job workers'
task :list do
on roles(:all) do |host|
execute :ps, 'aux | grep delayed_job'
end
end

desc 'Stop delayed_job workers forcefully'
task :kill do
on roles(:all) do |host|
execute :kill, "-9 $(ps aux | grep delayed_job | awk '{print $2}')"
end
end

end

task :upload_secret_files do
on roles(:all) do |host|
begin
execute "mkdir -p #{shared_path}/config"
rescue
end
upload! 'config/application.yml', "#{shared_path}/config/application.yml"
upload! 'config/database.yml', "#{shared_path}/config/database.yml"
end
end

task :log do
on roles(:all) do |host|
execute "tail -f #{current_path}/log/#{fetch(:rails_env)}.log"
end
end

desc 'Invoke a rake command on the remote server'
task :invoke, [:command] => 'deploy:set_rails_env' do |task, args|
on primary(:app) do
within current_path do
with rails_env: fetch(:rails_env) do
rake args[:command]
end
end
end
end









share|improve this question















I am using Capistrano gem for deploy management of my Ruby on Rails app. Its connected with AWS server, EC2, MySQL Redis. While I am putting my command "cap production deploy" or "cap staging deploy" nothing happens. I just got stuck there.



To add here my SSH key is properly added. And in my AWS security groups, only the authorized IPs are added to have the permission of deploying. My IPs are also added.



But when I add open ports 0.0.0.0/0 in all security groups it allows me to deploy. But I shouldn't add open ports for the sace of application security.



What can be the reason and how to solve these?



screenshot of my console, nothing happens



X



Below is my deploy.rb file:



SSHKit.config.command_map[:rake] = 'bundle exec rake'
# config valid only for current version of Capistrano
lock '3.8.1'

set :application, 'my_app'
set :repo_url, 'git@gitlab.com:_____'
set :deploy_via, :remote_cache

set :rvm_roles, [:app, :web]
set :rvm_type, :user
set :rvm_ruby_version, 'ruby-2.4.0'

set :log_level, :debug
set :pty, false
set :linked_files, %w{config/application.yml config/database.yml}
set :linked_dirs, %w{log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system public/assets public/uploads}

set :keep_releases, 10
set :whenever_roles, [:web, :app,:db]
set :whenever_identifier, "#{fetch(:application)}_#{fetch(:stage)}"

namespace :deploy do

desc 'restart (upgrade) unicorn server'
task :restart do
invoke 'unicorn:restart'
end

after :finishing, 'deploy:cleanup'
after 'deploy:publishing', 'deploy:restart'

after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
within release_path do
execute :rake, 'tmp:cache:clear'
end
end
end

end

namespace :delayed_job do

desc 'List of running delayed job workers'
task :list do
on roles(:all) do |host|
execute :ps, 'aux | grep delayed_job'
end
end

desc 'Stop delayed_job workers forcefully'
task :kill do
on roles(:all) do |host|
execute :kill, "-9 $(ps aux | grep delayed_job | awk '{print $2}')"
end
end

end

task :upload_secret_files do
on roles(:all) do |host|
begin
execute "mkdir -p #{shared_path}/config"
rescue
end
upload! 'config/application.yml', "#{shared_path}/config/application.yml"
upload! 'config/database.yml', "#{shared_path}/config/database.yml"
end
end

task :log do
on roles(:all) do |host|
execute "tail -f #{current_path}/log/#{fetch(:rails_env)}.log"
end
end

desc 'Invoke a rake command on the remote server'
task :invoke, [:command] => 'deploy:set_rails_env' do |task, args|
on primary(:app) do
within current_path do
with rails_env: fetch(:rails_env) do
rake args[:command]
end
end
end
end






ruby-on-rails amazon-web-services deployment rubygems capistrano






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 10 at 21:20

























asked Nov 10 at 15:08









Shakil Mahmood

13




13












  • check your capistrano log file (on your app's logs folder), maybe there's something on the file
    – arieljuod
    Nov 10 at 17:31










  • Please post your deploy.rb code here.
    – Mohit Kumar
    Nov 10 at 20:02










  • @MohitKumar deploy.rb code is added above just below my post.
    – Shakil Mahmood
    Nov 10 at 21:20










  • @arieljuod checked my log file. Nothing unusual there..
    – Shakil Mahmood
    Nov 10 at 21:21










  • Did you get any timeout message ?
    – Mohit Kumar
    Nov 10 at 23:13


















  • check your capistrano log file (on your app's logs folder), maybe there's something on the file
    – arieljuod
    Nov 10 at 17:31










  • Please post your deploy.rb code here.
    – Mohit Kumar
    Nov 10 at 20:02










  • @MohitKumar deploy.rb code is added above just below my post.
    – Shakil Mahmood
    Nov 10 at 21:20










  • @arieljuod checked my log file. Nothing unusual there..
    – Shakil Mahmood
    Nov 10 at 21:21










  • Did you get any timeout message ?
    – Mohit Kumar
    Nov 10 at 23:13
















check your capistrano log file (on your app's logs folder), maybe there's something on the file
– arieljuod
Nov 10 at 17:31




check your capistrano log file (on your app's logs folder), maybe there's something on the file
– arieljuod
Nov 10 at 17:31












Please post your deploy.rb code here.
– Mohit Kumar
Nov 10 at 20:02




Please post your deploy.rb code here.
– Mohit Kumar
Nov 10 at 20:02












@MohitKumar deploy.rb code is added above just below my post.
– Shakil Mahmood
Nov 10 at 21:20




@MohitKumar deploy.rb code is added above just below my post.
– Shakil Mahmood
Nov 10 at 21:20












@arieljuod checked my log file. Nothing unusual there..
– Shakil Mahmood
Nov 10 at 21:21




@arieljuod checked my log file. Nothing unusual there..
– Shakil Mahmood
Nov 10 at 21:21












Did you get any timeout message ?
– Mohit Kumar
Nov 10 at 23:13




Did you get any timeout message ?
– Mohit Kumar
Nov 10 at 23:13

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53240254%2fnothing-happens-after-capistrano-deploy-command%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53240254%2fnothing-happens-after-capistrano-deploy-command%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

Xamarin.form Move up view when keyboard appear

Post-Redirect-Get with Spring WebFlux and Thymeleaf

Anylogic : not able to use stopDelay()