Questions tagged [capistrano3]

Capistrano is an open source tool for running scripts on multiple servers; its main use is deploying web applications. It automates the process of making a new version of an application available on one or more web servers, including supporting tasks such as changing databases.

Learn more from their website: http://capistranorb.com/

Online Screencasts

825 questions
11
votes
2 answers

How to run schema:load on the initial capistrano 3 deploy of my rails app

I would like to run db:schema:load in place of db:migrate on the initial deploy of my rails app. This used to be fairly trivial, as seen in this stack overflow question, but in Capistrano 3, they have deprecated the deploy:cold task. The initial…
Adam Albrecht
  • 6,680
  • 4
  • 31
  • 35
10
votes
3 answers

Error reading response length from authentication socket

In my ruby on rails project, I am using capistrano , unicorn, postgresql and nginx for deploying my project. when I run cap production git:check I am getting this error: Error reading response length from authentication socket. log trace: INFO…
Mezbah
  • 1,247
  • 2
  • 17
  • 32
10
votes
1 answer

NoMethodError: undefined method `map' for :roles:Symbol in Capistrano 3

I'm trying to upgrade some of my Ruby on Rails projects from Capistrano 2.x to Capistrano 3.x. I followed this great tutorial to setup configuration files. My configuration files looks like this: Capfile require 'capistrano/setup' require…
Adrià Carro
  • 697
  • 1
  • 10
  • 22
10
votes
2 answers

Capistrano 3 Sudo Password Hangs

I have the following capistrano 3 task: desc 'Add root scheduled tasks' task :root_schedules do on roles(:all) do within release_path do execute :sudo, :bundle, 'exec whenever -w config/root_schedule.rb -u root' end end end I…
zquintana
  • 371
  • 2
  • 5
  • 13
10
votes
2 answers

How to pass arguments to Capistrano 3 tasks in deploy.rb

Here is an tutorial how to pass parameters to an capistrano 3 task. namespace :task do desc 'Execute the specific cmd task' task :invoke, :command do |task, args| on roles(:app) do execute :cmd, args[:command] end end end Can…
michamilz
  • 101
  • 1
  • 3
10
votes
1 answer

Capistrano 3: use server custom variable in task

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:…
a.yastreb
  • 1,493
  • 1
  • 10
  • 11
9
votes
6 answers

Capistrano Deploy Failing on git:check - Permission denied (publickey)

Local OS: Windows 10 Pro (using Git Bash as my terminal) Staging Server OS: Ubuntu 16.04 LTS I've been struggling to get a basic Capistrano deploy working on my staging server. I followed this guide to set up Capistrano. The deployment process…
Alexander
  • 3,959
  • 2
  • 31
  • 58
9
votes
1 answer

RVM, Capistrano 3 and bundle fail

I am using Capistrano 3: ➜ webapp git:(rails) ✗ cap --version Capistrano Version: 3.1.0 (Rake Version: 10.1.1) My Capfile is: # Load DSL and Setup Up Stages require 'capistrano/setup' # Includes default deployment tasks require…
nanounanue
  • 7,942
  • 7
  • 41
  • 73
9
votes
1 answer

How do I configure remote refs for git + capistrano 3 in ROR deployment?

I am trying to use capistrano (for the first time) to deploy my rails app. First the essentials, I am using: ruby 1.9.3p362 Rails 3.2.13 rvm 1.24.7 Capistrano 3.0.1 Phusion Passenger 4.0.26 Ubuntu 12.04 LTS I get the following error when…
Thomas
  • 2,426
  • 3
  • 23
  • 38
8
votes
2 answers

Rails secrets.yml VS Dotenv VS Figaro with Capistrano on AWS

There are several posts ans Stack Overflow questions about how to manage API tokens on the web, but I see a lot of people repeat what they read somewhere else, often with contradictions... How do you deal with API Tokens, secrets and the like…
8
votes
1 answer

Capistrano 3 Before and After Hooks

I just switched to using Capistrano 3 and ran into some issues with the before and after hooks documentation. In the docs it show the following for calling existing tasks before :starting, :ensure_user after :finishing, :notify If I use this syntax…
Nvick
  • 290
  • 2
  • 10
8
votes
2 answers

How do I set environment variables in Capistrano 3?

In Capistrano 2, you could do something like this: set :default_environment, { 'PATH' => '$PATH:/opt/rubies/ruby-2.1.1/bin' } Is there an equivalent in cap 3?
Robin Clowers
  • 2,150
  • 18
  • 28
8
votes
1 answer

How to run Capistrano task based on environment or server properties?

I have a namespace and a couple tasks in the namespace that run after deploy:updated. Here is an example: namespace :myservice do task :start do on roles(:app) do sudo :start, "my/application" end end end I'd love for one of these…
Andy Shinn
  • 26,561
  • 8
  • 75
  • 93
8
votes
2 answers

Capistrano 3.0 — How securely prompt for password now?

Prior to 3.0 there was a way to do that: # ... set :mysql_password, proc { Capistrano::CLI.password_prompt "Gimme remote database server password. Don't worry, I won't tell anyone: " } # ... namespace :db do desc 'Dump remote database' task…
jibiel
  • 8,175
  • 7
  • 51
  • 74
7
votes
2 answers

error command webpack not found when I deploy with capistrano

ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux] 00:00 git:wrapper 01 mkdir -p /tmp ✔ 01 root@157.230.93.52 2.312s Uploading /tmp/git-ssh-jec_access-production-jeanlinux.sh 100.0% 02 chmod 700…
Jean Linux
  • 217
  • 5
  • 19
1 2
3
54 55