Override composer task parameters from your environment (stage|production) config file #41
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_to
path in your stage|production ruby file with a path different from your deploy.rb file, the composer task will run with the deploy.rbdeploy_to
path 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_to
pathcomposer_path
composer_working_dir
From your stage or deploy.rb files
I also added other stuffs:
composer:install_executable
task (with a ask)(
before 'composer:run', 'composer:check'
)What do you thing about this ?