Add Vagrant environment specific config support#95
Open
patrickfweston wants to merge 3 commits intomasterfrom
Open
Add Vagrant environment specific config support#95patrickfweston wants to merge 3 commits intomasterfrom
patrickfweston wants to merge 3 commits intomasterfrom
Conversation
labbydev
reviewed
Jan 4, 2018
| gulp.task('develop', defaults.develop_tasks); | ||
|
|
||
| // Set develop-vagrant task | ||
| gulp.task('develop-vagrant', defaults.develop_tasks_vagrant); |
Contributor
There was a problem hiding this comment.
@patrickfweston is develop-vagrant and defaults.develop_tasks_vagrant running the same thing?
Contributor
Author
There was a problem hiding this comment.
Being honest, I've forgotten how the pieces fit together since I made this PR. It appears to me that I'm missing the definition of the default variable defaults.develop_tasks_vagrant in this PR. I believe it should be set up as such:
develop-vagrant is an ease-of-use task that calls the tasks defined in defaults.develop_tasks_vagrant. This is setup in the same way that develop calls the tasks defined in defaults.develop_tasks:
defaults.develop_tasks = ['sass', 'sculpin', 'watch'];
The only difference is that we use spress-serve-vagrant to serve the prototype so it runs with the appropriate config.
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.
Problem
Designers and developers often use Butler in different environments. Designers prefer to work locally for the increased speed, while developers work within Vagrant for Drupal support. Unfortunately, there is no easy way to differentiate this environment when running Butler. As a result, the URL in the
config.ymlfile must be changed from something likelocalhost:4000toproject-name.local:4000when the environment switches. This can be tedious to change and to avoid committing.Proposed Solution
This PR adds a special Gulp task named
butler-vagrantfor running Butler within Vagrant. It executes Spress with config for a new Vagrant environment located in theconfig_vagrant.ymlfile.It adds a task to Gulp named
spress-serve-vagrantto serve content at the appropriate URL.Next steps
Spress is supposed to allow per-environment configuration. We previously had a
config_dev.ymlfile. I couldn't get Spress to acknowledge the config in this file, but everything worked when I changed the environment fromdevtovagrant.I currently have the
develop-vagranttasks defined in thebutler.defaults.jsfile that is included in a project's overrides of the butler defaults. I don't believe this is the best place for it, but I wasn't sure where else to place it. Here is that code: