Override composer task parameters from your environment (stage|production) config file#41
Open
t0k4rt wants to merge 2 commits intocapistrano:masterfrom
Open
Override composer task parameters from your environment (stage|production) config file#41t0k4rt wants to merge 2 commits intocapistrano:masterfrom
t0k4rt wants to merge 2 commits intocapistrano:masterfrom
Conversation
Author
|
Any feedback ? |
Member
|
This PR caught me while I was away on vacation so it got lost in the shuffle. Despite this being a limitation of Capistrano, I'd be open to potentially including a solution for it in this extension. But I'd prefer if the code changes could be limited to only addressing that problem for one. There seems to be other changes going on in this PR. Can it be reduced to the minimum required to fix the original issue? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi, I ran into the same problems as described here #39 #22
In the composer task, shared_path and release_path are not evaluated accordingly to the environment.
The bug is simple to reproduce:
When you override
deploy_topath in your stage|production ruby file with a path different from your deploy.rb file, the composer task will run with the deploy.rbdeploy_topath so that both release and shared path will be wrong when launching composer tasks.The workaround I found is to load default paths using lambdas:
I added the variable composer_path so that I can override the SSHKit command_map with a lambda (since
SSHkit.config.command_map = ->{ fetch(:myvar) }doesn't seem to work).Also, instead of overriding the command in the deploy.rb, I override the variable directly in the rake tasks so that the variable is set accordingly to the environment we are deploying in.
With these changes, you can do whatever you want:
deploy_topathcomposer_pathcomposer_working_dirFrom your stage or deploy.rb files
I also added other stuffs:
composer:install_executabletask (with a ask)(
before 'composer:run', 'composer:check')What do you thing about this ?