Skip to content

Commit a579a7a

Browse files
chore(build): add custom nginx task to grunt file
1 parent 7023799 commit a579a7a

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Gruntfile.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,24 @@ module.exports = function(grunt) {
160160
},done);
161161
});
162162

163+
grunt.registerTask('nginx_start', function(){
164+
var done = this.async();
165+
grunt.util.spawn({
166+
cmd: 'nginx',
167+
args: ['-c', '.nginx/nginx.conf', '-p', '.'],
168+
opts: {stdio: 'inherit'}
169+
},done);
170+
});
171+
172+
grunt.registerTask('nginx_stop', function(){
173+
var done = this.async();
174+
grunt.util.spawn({
175+
cmd: 'nginx',
176+
args: ['-c', '.nginx/nginx.conf', '-p', '.', '-s', 'stop'],
177+
opts: {stdio: 'inherit'}
178+
},done);
179+
});
180+
163181
grunt.loadNpmTasks('grunt-contrib-jshint');
164182
grunt.loadNpmTasks('grunt-jsduck');
165183
grunt.loadNpmTasks('grunt-contrib-concat');
@@ -169,4 +187,6 @@ module.exports = function(grunt) {
169187
grunt.registerTask('build', [ 'sizzle', 'concat:dist', 'jsduck', 'copy']);
170188

171189
grunt.registerTask('travis', ['jshint', 'build', 'karma_phantom', 'karma_browserstack']);
190+
191+
grunt.registerTask('travis_local', ['nginx_start', 'build', 'karma_browserstack', 'nginx_stop']);
172192
};

0 commit comments

Comments
 (0)