Hi, I’m just starting to get to grips with using Capistrano. Watched the screencast by Scott and felt like I was understanding the thinking behind it all.
I’m developing locally on a mac using a Vagrant VM (ubuntu14,nginx,mysql). So far I’ve done the following:
- Installed Ruby 2.0 on my Mac
- Run through the steps here: GitHub - roots/bedrock: WordPress boilerplate with Composer, easier configuration, and an improved folder structure as far as
‘Deploying with Capistrano’ - Commited everything to a git repo (bitbucket)
- Edited config/deploy.rb with my repo details,
deploy_to
path and application name, kept branch always set to master - ran
bundle exec cap development deploy
At this point nothing happens and I get the message:
Stage not set, please call something such as
cap production deploy
, where production is a stage you have defined.
In the screencast you appear to have your ‘stage’ set as development by default, I wasn’t sure and beginning to get confused now… next I looked at config/deploy/staging.rb, and found the following line:
set :stage, :staging
So out of curiosity tried putting the following in my deploy.rb:
set :stage, :development
Once again, ran bundle exec cap development deploy
:
Stage not set, please call something such as
cap production deploy
, where production is a stage you have defined.
That’s about as far as I got before time restraints meant I just needed to get on with my project for now. I’d really like to implement Capistrano, can anyone help me get past this? Setting the ‘Stage’ initially doesn’t seem to be mentioned in the screencast or the bedrock docs.
Another thing was confusing me which was - why does deploy.rb not have any commented out example of how to connect via ssh? Is it assumed you won’t be using ssh for your dev deploy?
If I was to deploy to my Vagrant VM, would the following lines in deploy.rb be suitable?:
server 'example.dev', user: 'vagrant', roles: %w{web app db}
set :ssh_options, { keys: %w(../../puphpet/files/dot/ssh/insecure_private_key) }
(I generated my Vagrant VM with puphpet and this is the correct path to the key I believe, relative to my config/deploy.rb)
Thanks in advance to anyone who can help me get my head round this