capistrano3

NoMethodError: undefined method `on' for main:Object

元气小坏坏 提交于 2019-12-09 08:11:14
问题 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

Capistrano 3 assets:precompile takes hours. Stops at css file

只愿长相守 提交于 2019-12-09 03:31:14
问题 Just as it says, I can't get capistrano 3 to do assets:precompile correctly. Even after hours, it still says writing to the .css file on the server. UPDATE: I was playing around and I tried a m1.medium. Same thing happened when it got to a certain point it simply stopped precompiling. Not errors are thrown, the cursor simply flashes. It looks like it is still working, as it just says: I, [2013-12-31T01:18:45.210416 #31413] INFO -- : Writing /var/www/app/releases/20131231011622/public/assets

Capistrano change user after ssh log-in - deploy as another user

雨燕双飞 提交于 2019-12-08 08:13:05
问题 In my staging.rb file i need to connect with "ubuntu" username server '**.**.****.**', user: 'ubuntu', roles: %w{web app db} In my deploy.rb set :deploy_to, -> { "/var/www/myuser/myuser.com/capi" } Server var/www/myuser/myuser.com# ls -la total 32 drwxrwx--- 8 myuser myuser 4096 Jul 9 14:54 . drwxrwx--- 5 myuser myuser 4096 Feb 26 17:18 .. drwxrwx--- 7 myuser myuser 4096 May 7 13:48 beta drwxr-xr-x 2 myuser myuser 4096 Jul 9 14:54 capi drwxrwx--- 9 myuser myuser 4096 May 8 20:15 quiz drwxrwx-

Restart application no longer working with Cap 3.1 and Rails 4

核能气质少年 提交于 2019-12-08 07:45:03
问题 The following task was working before we upgraded to Rails 4 and Cap 3.1 desc 'Restart application' task :restart do on roles(:web), in: :sequence, wait: 5 do execute :touch, release_path.join('tmp/restart.txt') end end First of all, I know Cap 3.1 doesn't implicitly call :restart anymore so I added the following: after :publishing, :restart However, it fails on attempting to 'touch' the restart.txt file so that Apache will reload the application. cap aborted! touch stdout: Nothing written

Capistrano returning wrong release_path

岁酱吖の 提交于 2019-12-08 02:27:24
问题 I have a question about capistrano version 3.2.1. In my deploy.rb file I'm using the following line: set :theme_path, "#{release_path}/web/app/themes/myproject" The variable release_path is not showing to latest release folder, lets say 201409151420 as it should, but it is pointing to folder current , so the output is: DEBUG[68031037] Command: cd /var/www/myproject/current/web/app/themes/myproject && ( WP_ENV=staging /usr/bin/env npm install --silent ) The output should be: DEBUG[68031037]

To use bash --login by default with capistrano 3 + sshkit + rvm

给你一囗甜甜゛ 提交于 2019-12-08 02:18:20
问题 I have following cap3 task task :gemset do on roles(:all) do if remote_dir_exists?(".rvm") execute :rvm, :gemset, :use, "#{ Configs.rvm.ruby }@#{ Configs.rvm.gemset } --create" else info "RVM not installed" end end end for settings rvm: ruby: ruby-2.0.0-p247 gemset: cap3 it should execute on my server following command rvm gemset use ruby-2.0.0-p247@cap3 --create but it gives to me DEBUG [9bd5fc11] RVM is not a function, selecting rubies with 'rvm use ...' will not work. DEBUG [9bd5fc11]

Deploying a git submodule with Capistrano 3

Deadly 提交于 2019-12-07 22:36:19
问题 My project repo includes Wordpress as a git submodule. When deploying via Capistrano 3, the submodule directory is barren. project --wordpress --images I am using git and :deploy_via, :remote_cache How can I tell Capistrano to also deploy the submodule? 回答1: I found a great script from corny that overrides the git task in Capistrano. Place this script in lib/capistrano/tasks/git.cap and use cap stage deploy as normal. https://gist.github.com/corny/7459729 # Save this file as lib/capistrano

Run tasks as another user

て烟熏妆下的殇ゞ 提交于 2019-12-07 22:25:53
问题 Using Capistrano v3 , how can I run all remote tasks through su as another user? I cannot find anything in the official documentation (http://capistranorb.com/) For my use case, there is one SSH user and one user for every virtual host. User A connects to the server and should run all commands as user B. 回答1: This isn't much of an answer, but I don't think what you are trying to do is possible without code modifications. Here's why: There are two primary cases where you would use a different

Capistrano 3: Run task only on a single server from a pool of servers assigned a role

為{幸葍}努か 提交于 2019-12-07 06:14:07
问题 I have 20 servers that are in the "web" role. I have a task I need to perform on only one of them as the change affects shared storage. My current solution is a hack to get around this (below). Looking for a better way, I don't have a ton of ruby or cap experience. task :checkout_project_properties do num_runs = 0 on roles(:web), in: :sequence do if num_runs > 0 abort('Only running on one server. Exiting') end execute("checkout-project-properties #{uc_stage} #{repo} #{branch}") num_runs += 1

Capistrano 3: use server custom variable in task

独自空忆成欢 提交于 2019-12-06 21:53:37
问题 I have multi-stage multi-server setup and in my task I need to use server name e.g. in stagin.rb I have: set :stage, :staging # Define servers server 'xxx.xx.xx.xxx', user: 'deploy', roles: %w{app}, name: 'app1' server 'xxx.xx.xx.yyy', user: 'deploy', roles: %w{app}, name: 'app2' and I want to use that "name" variable in my task: task :configure do on roles(:app), in: :parallel do # how do I get server name here? end end 回答1: If you want to return the hostname / IP, then it will be task