capistrano3

How can I instruct Capistrano 3 to load my shell environment variables set at remote host?

夙愿已清 提交于 2019-12-03 16:34:30
问题 I want to instruct Capistrano to load environment variables that are defined on remote server. How can I do that? It seems that when I export my environment variables inside .bashrc file, they are not taken into account by Capistrano. Capistrano seems to be executing a /usr/bin/env to create the environment for executing remote commands, but this does not seem to be loading the environment variables from .bashrc . Let me tell you also that I am using rvm-capistrano too (just in case it might

Skip database migration while deploying Rails application using Capistrano 3

拟墨画扇 提交于 2019-12-03 12:53:42
问题 When we run cap deploy , it runs all the migrations during deployment. We have to point the application to existing DB and don't want modify existing DB. Can anybody suggest how can we skip the migration step while deploying the application? 回答1: I suppose you are using capistrano/rails. According to the doc, you can require just what you need manually: # Capfile require 'capistrano/bundler' require 'capistrano/rails/assets' # require 'capistrano/rails/migrations' 来源: https://stackoverflow

Capistrano 3 + Sprockets 3 + Rails 4.2.1 won't deploy?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 11:42:49
问题 I ran bundle update and updated sprockets to 3.0.0. When I try to deploy via Capistrano 3 I get the following error: INFO [e54ac5ca] Running /usr/bin/env cp /var/www/testapp/releases/20150414002210/public/assets/manifest* /var/www/testapp/releases/20150414002210/assets_manifest_backup as deploy@xx.xxx.xxx.xx DEBUG [e54ac5ca] Command: cd /var/www/testapp/releases/20150414002210 && /usr/bin/env cp /var/www/testapp/releases/20150414002210/public/assets/manifest* /var/www/testapp/releases

NoMethodError: undefined method `on' for main:Object

£可爱£侵袭症+ 提交于 2019-12-03 10:26:40
when I try to bundle exec cap production deploy --trace I get an error message: deploy@h2540559:/www/apps/foodsoft$ bundle exec cap production deploy --trace ** Invoke production (first_time) ** Execute production ** Invoke load:defaults (first_time) ** Execute load:defaults ** Invoke rvm:hook (first_time) ** Execute rvm:hook cap aborted! NoMethodError: undefined method `on' for main:Object /usr/local/rvm/gems/ruby-2.0.0-p643/gems/capistrano-rvm-0.1.2/lib/capistrano/tasks/rvm.rake:17:in `block (2 levels) in <top (required)>' /usr/local/rvm/gems/ruby-2.0.0-p643/gems/rake-11.1.1/lib/rake/task.rb

How can I instruct Capistrano 3 to load my shell environment variables set at remote host?

邮差的信 提交于 2019-12-03 06:47:37
I want to instruct Capistrano to load environment variables that are defined on remote server. How can I do that? It seems that when I export my environment variables inside .bashrc file, they are not taken into account by Capistrano. Capistrano seems to be executing a /usr/bin/env to create the environment for executing remote commands, but this does not seem to be loading the environment variables from .bashrc . Let me tell you also that I am using rvm-capistrano too (just in case it might help). Any clue? Delameko Although this question is over six months old now, I'll leave this here in

Capistrano 3 sudo task

不想你离开。 提交于 2019-12-03 05:35:48
问题 I want to write a recipe with Capistrano 3 executing a task on the remote server with sudo. With Capistrano 2 this could be done for example: default_run_options[:pty] = true task :hello do run "#{sudo} cp ~/something /something" end With Capistrano 3 I found: set :pty, true But I could not get to execute a task running with sudo. How can I run a task with sudo? 回答1: The Capistrano 3 guide recommends the use of passwordless sudo. This allows your less-priveleged user execute the sudo command

Skip database migration while deploying Rails application using Capistrano 3

允我心安 提交于 2019-12-03 02:25:59
When we run cap deploy , it runs all the migrations during deployment. We have to point the application to existing DB and don't want modify existing DB. Can anybody suggest how can we skip the migration step while deploying the application? scorix I suppose you are using capistrano/rails . According to the doc, you can require just what you need manually: # Capfile require 'capistrano/bundler' require 'capistrano/rails/assets' # require 'capistrano/rails/migrations' 来源: https://stackoverflow.com/questions/28300592/skip-database-migration-while-deploying-rails-application-using-capistrano-3

Capistrano 3 + Sprockets 3 + Rails 4.2.1 won't deploy?

为君一笑 提交于 2019-12-03 02:10:45
I ran bundle update and updated sprockets to 3.0.0. When I try to deploy via Capistrano 3 I get the following error: INFO [e54ac5ca] Running /usr/bin/env cp /var/www/testapp/releases/20150414002210/public/assets/manifest* /var/www/testapp/releases/20150414002210/assets_manifest_backup as deploy@xx.xxx.xxx.xx DEBUG [e54ac5ca] Command: cd /var/www/testapp/releases/20150414002210 && /usr/bin/env cp /var/www/testapp/releases/20150414002210/public/assets/manifest* /var/www/testapp/releases/20150414002210/assets_manifest_backup DEBUG [e54ac5ca] cp: cannot stat ‘/var/www/testapp/releases

Rails 4 + Capistrano 3 : fatal: Could not read from remote repository while deploying

大兔子大兔子 提交于 2019-12-03 00:53:13
I am getting following error while deploying Rails 4 application using Capistrano 3 INFO [87512eb8] Running /usr/bin/env chmod +x /tmp/magnificent/git-ssh.sh as deploy@104.236.6.180 DEBUG [87512eb8] Command: /usr/bin/env chmod +x /tmp/magnificent/git-ssh.sh INFO [87512eb8] Finished in 0.444 seconds with exit status 0 (successful). INFO [1ec94dd1] Running /usr/bin/env git ls-remote --heads git@github.com:BoTreeConsultingTeam/magnificent.git as deploy@104.236.6.180 DEBUG [1ec94dd1] Command: ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/magnificent/git-ssh.sh /usr/bin/env git ls-remote --heads git@github

Capistrano 3 sudo task

只谈情不闲聊 提交于 2019-12-02 20:08:39
I want to write a recipe with Capistrano 3 executing a task on the remote server with sudo. With Capistrano 2 this could be done for example: default_run_options[:pty] = true task :hello do run "#{sudo} cp ~/something /something" end With Capistrano 3 I found: set :pty, true But I could not get to execute a task running with sudo. How can I run a task with sudo? The Capistrano 3 guide recommends the use of passwordless sudo. This allows your less-priveleged user execute the sudo command without having to enter a password via the PTY. You can use the task that Kentaro wrote above, and add