capistrano3

Capistrano log level

人走茶凉 提交于 2019-11-29 13:49:40
问题 I've set my Capistrano configuration's log level to error to prevent verbose output. In deploy.rb I've added set :log_level, :error . This works great. However, when I run commands via execute , it isn't printed as it's being written under the log level of DEBUG . How can I get the output of execute commands to be printed out? I am able to use capture with the combination of puts to output it, but this doesn't help when I have to stream the logs. 回答1: You can do this by defining the following

Capistrano 3 change ssh_options inside task

依然范特西╮ 提交于 2019-11-29 07:43:48
I trying to run capistrano v.3 task in same stage with diferent ssh_options. my production.rb say: set :stage, :production set :user, 'deploy' set :ssh_options, { user: 'deploy' } With this configuration capistrano connect with user deploy which is correct for the rest of taks. But I need connect it for one specific task with an_other_user wich is well configured in server. Then my recipe say: ... tasks with original user ... task :my_task_with_an_other_user do set :user, 'an_other_user' set :ssh_options, { user: 'an_other_user' } on roles(:all) do |host| execute :mkdir, '-p', 'mydir' end end

Capistrano error tar: This does not look like a tar archive

好久不见. 提交于 2019-11-29 02:00:15
问题 INFO [050fe961] Running mkdir -p /home/rails/rails- capistrano/releases/20140114234157 on staging-rails DEBUG [050fe961] Command: cd /home/rails/rails-capistrano/repo && ( PATH=/opt/ruby/bin:$PATH GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/rails/git-ssh.sh mkdir -p /home/rails/rails-capistrano/releases/20140114234157 ) INFO [050fe961] Finished in 0.142 seconds with exit status 0 (successful). INFO [2dea2fe5] Running git archive feature/Capistrano | tar -x -C /home/rails/rails-capistrano/releases

SSHKit::Runner::ExecuteError

拥有回忆 提交于 2019-11-28 19:32:18
$ bundle exec cap production deploy (Backtrace restricted to imported tasks) cap aborted! SSHKit::Runner::ExecuteError: Exception while executing as Psara@sakura: git exit status: 128 git stdout: Nothing written git stderr: Permission denied (publickey). fatal: The remote end hung up unexpectedly SSHKit::Command::Failed: git exit status: 128 git stdout:Nothing written git stderr: Permission denied (publickey). fatal: The remote end hung up unexpectedly Tasks: TOP => git:check (See full trace by running task with --trace) The deploy has failed with an error: Exception while executing as Psara

SSH Agent Forwarding not working

你。 提交于 2019-11-28 16:18:38
问题 I'm having an hard time trying to configure Capistrano 3.1 to deploy an app hosted on Github. I'm following Capistrano Documentation and I have successfully completed the first step (SSH keys from workstation to servers) and on the second one (From our servers to the repository host) I'm able to successfully run ssh -A deploy@one-of-my-servers.com 'git ls-remote git@github.com:my_user/my_repo.git' : 18f38afz261df35d462f7f4e2ca847d22f148a06 HEAD 18f38afz261df35d462f7f4e2ca847d22f148a06 refs

Capistrano and environment variables

匆匆过客 提交于 2019-11-27 18:19:52
I've switched to using environment variables for configuration and it works very well - except when I have to deploy or run tasks with capistrano. Capistrano 3 seems to execute each command prefixed with /usr/bin/env which erases any environment variables I've set through .bashrc . EDIT - on doing some more reasearch, this might not be the issue, the issue might be because capistrano executes as a non-login, non-interactive shell and does not load .bashrc or .bash_profile . Still stuck, though. What would be the best way of making sure the environment vars are set when capistrano executes its

Capistrano and environment variables

試著忘記壹切 提交于 2019-11-26 19:27:00
问题 I've switched to using environment variables for configuration and it works very well - except when I have to deploy or run tasks with capistrano. Capistrano 3 seems to execute each command prefixed with /usr/bin/env which erases any environment variables I've set through .bashrc . EDIT - on doing some more reasearch, this might not be the issue, the issue might be because capistrano executes as a non-login, non-interactive shell and does not load .bashrc or .bash_profile . Still stuck,