Note that there are some explanatory texts on larger screens.

plurals
  1. POCapistrano stage values do not override defaults
    primarykey
    data
    text
    <p>I define some stage specific capistrano variables but they do not override default values.</p> <p>config/deploy/staging.rb:</p> <pre><code>set :user, 'ec2-user' set :rails_env, 'staging' set :domain, 'test.etask.me' </code></pre> <p>config/deploy.rb:</p> <pre><code>set :application, 'etask' set :stages, %w(production staging) set :default_stage, "staging" require 'capistrano/ext/multistage' set :user, 'ec2-user' set(:unicorn_env) { rails_env } role(:web) { domain } role(:app) { domain } role(:db, :primary =&gt; true) { domain } set(:deploy_to) { "/home/#{user}/#{application}/#{fetch :rails_env}" } set(:current_path) { File.join(deploy_to, current_dir) } default_run_options[:pty] = false require 'rvm/capistrano' require 'bundler/capistrano' set :using_rvm, true set :rvm_ruby_string, '1.9.3' set :rvm_type, :user set :repository, 'git@bitbucket.org:adaptiveservices/etask-website.git' set :scm, :git set :branch, 'master' set :git_shallow_clone, 1 set :keep_releases, 3 set :use_sudo, false set :deploy_via, :remote_cache set :git_enable_submodules, 1 </code></pre> <p>cap deploy output:</p> <pre><code>triggering load callbacks * 2013-10-15 15:44:25 executing `staging' triggering start callbacks for `deploy' * 2013-10-15 15:44:25 executing `multistage:ensure' * 2013-10-15 15:44:25 executing `deploy' * 2013-10-15 15:44:25 executing `deploy:update' ** transaction: start * 2013-10-15 15:44:25 executing `deploy:update_code' updating the cached checkout on all servers executing locally: "git ls-remote git@bitbucket.org:adaptiveservices/etask-website.git master" command finished in 2270ms * executing "if [ -d /home/ec2-user/etask/production/shared/cached-copy ]; then cd /home/ec2-user/etask/production/shared/cached-copy &amp;&amp; git fetch -q origin &amp;&amp; git fetch --tags -q origin &amp;&amp; git reset -q --hard 88e8556a3cce96e77d51a40b96f2dcd1437c939a &amp;&amp; git submodule -q init &amp;&amp; git submodule -q sync &amp;&amp; export GIT_RECURSIVE=$([ ! \"`git --version`\" \\&lt; \"git version 1.6.5\" ] &amp;&amp; echo --recursive) &amp;&amp; git submodule -q update --init $GIT_RECURSIVE &amp;&amp; git clean -q -d -x -f; else git clone -q -b master --depth 1 git@bitbucket.org:adaptiveservices/etask-website.git /home/ec2-user/etask/production/shared/cache d-copy &amp;&amp; cd /home/ec2-user/etask/production/shared/cached-copy &amp;&amp; git checkout -q -b deploy 88e8556a3cce96e77d51a40b96f2dcd1437c939a &amp;&amp; git submodule -q init &amp;&amp; git submodule -q sync &amp;&amp; export GIT_RECURS IVE=$([ ! \"`git --version`\" \\&lt; \"git version 1.6.5\" ] &amp;&amp; echo --recursive) &amp;&amp; git submodule -q update --init $GIT_RECURSIVE; fi" </code></pre> <p>As you can see capistrano thinks that it is production environment (look at the cd /home/ec2-user/etask/<strong>production</strong>/shared/cached-copy). It uses default values instead of defined in deploy/staging.rb. Even if I check what the value of user variable - it throws an error (value is not defined) in spite the fact that I set user inside deploy/staging.rb. </p> <p>I have done all the things as described in <a href="https://github.com/sosedoff/capistrano-unicorn/wiki/Using-capistrano-unicorn-with-multistage-environment" rel="nofollow">capistrano wiki</a>. I looked through tons of other related posts and they do not solve my issue. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload