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

Add Vagrant environment specific config support #95

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ gulp.task('spress-serve', ['sass'], function () {
.pipe(exec(defaults.spress_bin + ' site:build --server --source=' + defaults.spress_home));
});

gulp.task('spress-serve-vagrant', ['sass'], function () {
return gulp.src(defaults.spress_home)
.pipe(exec('fuser 4000/tcp --kill || true'))
.pipe(exec(defaults.spress_bin + ' site:build --server --env=vagrant --source=' + defaults.spress_home));
});

gulp.task('spress-build', function () {
return gulp.src(defaults.spress_home)
.pipe(exec(defaults.spress_bin + ' site:build --source=' + defaults.spress_home));
Expand Down Expand Up @@ -162,6 +168,9 @@ gulp.task('watch', function() {
// Set Develop task
gulp.task('develop', defaults.develop_tasks);

// Set develop-vagrant task
gulp.task('develop-vagrant', defaults.develop_tasks_vagrant);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@patrickfweston is develop-vagrant and defaults.develop_tasks_vagrant running the same thing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.


// Set a test task
gulp.task('test', ['lint', 'audit']);

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ npm install --save --save-exact palantirnet/butler
````
"scripts": {
"butler": "node_modules/butler/node_modules/.bin/gulp --gulpfile node_modules/butler/Gulpfile.js",
"butler-vagrant": "node_modules/butler/node_modules/.bin/gulp --gulpfile node_modules/butler/Gulpfile.js develop-vagrant",
"develop": "node_modules/butler/node_modules/.bin/gulp --gulpfile node_modules/butler/Gulpfile.js develop",
"tests": "node_modules/butler/node_modules/.bin/gulp --gulpfile node_modules/butler/Gulpfile.js test",
"deploy": "node_modules/butler/node_modules/.bin/gulp --gulpfile node_modules/butler/Gulpfile.js spress-deploy"
Expand Down
4 changes: 0 additions & 4 deletions STYLEGUIDE_TEMPLATE_SPRESS/config_dev.yml

This file was deleted.

3 changes: 3 additions & 0 deletions STYLEGUIDE_TEMPLATE_SPRESS/config_vagrant.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Site configuration for running Butler and Spress inside of vagrant
url: ''
debug: true