Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stage configuration variable not available via lazily loaded lambda #2014

Open
patrickbussmann opened this issue Mar 21, 2019 · 1 comment
Open

Comments

@patrickbussmann
Copy link

patrickbussmann commented Mar 21, 2019

Steps to reproduce

config/deploy.rb

set :deploy_to, ->{ "/var/www/vhosts/#{fetch(:application)}" }

config/deploy/production.rb

set :application, "example.org"

Expected behavior

Command cap production deploy -p --dry-run prints.

------- Printing current config variables -------
:deploy_to => "/var/www/vhosts/example.org"
:application => "example.org"

Actual behavior

Command cap production deploy -p --dry-run prints.

------- Printing current config variables -------
:deploy_to => "/var/www/vhosts/"
:application => "example.org"

System configuration

https://gist.github.com/patrickbussmann/d81bb558cdf4d55c24a5a3eb596b5b18

Additional information

I read the documentation here. https://capistranorb.com/documentation/faq/how-can-i-access-stage-configuration-variables/
And it says The deploy.rb configuration is executed first and then the stage file(s) from config/deploy/*.rb are executed next.
But for this I'm using this lambda lazily loaded thing.

So I think I made it right but the system understands it wrong.

@leehambley
Copy link
Member

Thanks for the report @patrickbussmann - fo be clear could you provide the config/deploy.rb and config/deploy/production.rb here? Please only redact passwords and IPs, includes/requires may be relevant for diagnosing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants