Created
May 8, 2017 05:19
-
-
Save staycreativedesign/fce74c5aa08a37c14ef81643e12a865a to your computer and use it in GitHub Desktop.
mina nginx server restart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #There is a plugin called mina-nginx which is overkill all I am trying to do is restart my nginx after I deploy my sinatra app. I have this code | |
| require 'mina/rails' | |
| require 'mina/git' | |
| # require 'mina/rbenv' # for rbenv support. (https://rbenv.org) | |
| require 'mina/rvm' # for rvm support. (https://rvm.io) | |
| set :domain, 'dot' | |
| set :deploy_to, 'foo' | |
| set :repository, 'bar' | |
| #set :repository, 'biz' | |
| set :branch, 'master' | |
| set :forward_agent, true # SSH forward_agent. | |
| # This task is the environment that is loaded for all remote run commands, such as | |
| # `mina deploy` or `mina rake`. | |
| task :environment do | |
| invoke :'rvm:use', 'ruby-2.3.1' | |
| end | |
| # Put any custom commands you need to run at setup | |
| # All paths in `shared_dirs` and `shared_paths` will be created on their own. | |
| task :setup do | |
| command %{ gem install bundler } | |
| # command %{rbenv install 2.3.0} | |
| end | |
| desc "Deploys the current version to the server." | |
| task :deploy do | |
| deploy do | |
| # Put things that will set up an empty directory into a fully set-up | |
| # instance of your project. | |
| invoke :'git:clone' | |
| invoke :'bundle:install' | |
| invoke :'deploy:cleanup' | |
| invoke :restart | |
| end | |
| end | |
| task :restart do | |
| comment "Restarting Nginx Server" | |
| command "sudo service nginx restart" | |
| end | |
| ``` | |
| #Now every time I try to run my restart command it doesn't work. It hangs on the sudo service nginx restart because it's waiting for a #password to be entered by why do I need a password if I am using ssh forwarding? | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment