Permalink
Browse files

Added gulp some gulp dependencies for a gulp build command for deploying

  • Loading branch information...
1 parent ad12e47 commit fa14aff53b0fafbcc99ddba609e612a2622fae8a @chriscasper chriscasper committed Aug 2, 2016
Showing with 42 additions and 13,268 deletions.
  1. +30 −12 gulpfile.js
  2. +5 −2 package.json
  3. +7 −13,254 static/js/index.js
View
@@ -11,7 +11,10 @@ var gulp = require('gulp'),
imageResize = require('gulp-image-resize'),
gulpif = require('gulp-if'),
autoprefixer = require('gulp-autoprefixer'),
- sourcemaps = require('gulp-sourcemaps');
+ sourcemaps = require('gulp-sourcemaps'),
+ clean = require('gulp-clean'),
+ shell = require('gulp-shell'),
+ runSequence = require('run-sequence');
// LESS
gulp.task('less', function() {
@@ -22,30 +25,30 @@ gulp.task('less', function() {
//.pipe(minifyCSS())
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('static/css'))
- .pipe(notify({ message: 'Finished compiling LESS'}));
+ .pipe(notify({ message: 'Compiling LESS'}));
});
// Javascript
gulp.task('js', function() {
return gulp.src(['src/js/moment.js', 'src/js/**/*.js'])
.pipe(concat('index.js'))
- //.pipe(uglify())
+ .pipe(uglify())
.pipe(gulp.dest('static/js'))
- .pipe(notify({ message: 'Finished JavaScript'}));
+ .pipe(notify({ message: 'Compiling JavaScript'}));
});
// Images
gulp.task('img', function() {
return gulp.src('src/img/**/*')
.pipe(gulp.dest('static/img'))
- .pipe(notify({ message: 'Finished copying image'}));
+ .pipe(notify({ message: 'Copying image'}));
});
// Fonts
gulp.task('font', function() {
return gulp.src('src/fonts/**/*')
.pipe(gulp.dest('static/fonts'))
- .pipe(notify({ message: 'Finished copying font'}));
+ .pipe(notify({ message: 'Copying font'}));
});
// Resize User Logos
@@ -55,7 +58,7 @@ gulp.task('userLogos', function() {
return gmfile.resize(150, 100);
}))
.pipe(gulp.dest('static/img/user_logos'))
- .pipe(notify({ message: 'Finished resizing image'}));
+ .pipe(notify({ message: 'Resizing user logo image'}));
});
// Resize Partner Logos
@@ -65,14 +68,14 @@ gulp.task('partnerLogos', function() {
return gmfile.resize(250, 150);
}))
.pipe(gulp.dest('static/img/partner_logos'))
- .pipe(notify({ message: 'Finished resizing partner logo'}));
+ .pipe(notify({ message: 'Resizing partner logo'}));
});
// Resize Documentaiton Images
gulp.task('docsImages', function() {
return gulp.src('src/documentation/**/*.{png,jpg,jpeg}')
.pipe(gulp.dest('static/img/documentation'))
- .pipe(notify({ message: 'Finished copying documentation image'}));
+ .pipe(notify({ message: 'Copying documentation image'}));
});
// Resize Blog Images
@@ -82,16 +85,26 @@ gulp.task('blogImages', function() {
width : 900
}))
.pipe(gulp.dest('static/img/blog'))
- .pipe(notify({ message: 'Finished resizing blog image'}));
+ .pipe(notify({ message: 'Resizing blog image'}));
});
// Will have to improve this later on
gulp.task('blogImagesGifs', function() {
return gulp.src('src/blog/**/*.gif')
.pipe(gulp.dest('static/img/blog'))
- .pipe(notify({ message: 'Finished copying gif blog image'}));
+ .pipe(notify({ message: 'Copying gif blog image'}));
});
+// Clean
+gulp.task('clean', function() {
+ return gulp.src('public')
+ .pipe(clean())
+ .pipe(notify({ message: 'Removing old build'}));
+});
+
+// HUGO
+gulp.task('hugo', shell.task('hugo'))
+
// Watch
gulp.task('watch', function() {
gulp.watch('src/less/**/*.less', [ 'less' ]);
@@ -106,4 +119,9 @@ gulp.task('watch', function() {
});
// Default Task
-gulp.task('default', [ 'less','js','img','font','watch', 'docsImages', 'userLogos', 'partnerLogos', 'blogImages', 'blogImagesGifs', 'watch' ]);
+gulp.task('default', [ 'less', 'js', 'img', 'font', 'docsImages', 'userLogos', 'partnerLogos', 'blogImages', 'blogImagesGifs', 'watch' ]);
+
+// Build for Production
+gulp.task('build', function (callback) {
+ runSequence( 'clean', [ 'less', 'js', 'img', 'font', 'docsImages', 'userLogos', 'partnerLogos', 'blogImages', 'blogImagesGifs' ], 'hugo', callback);
+});
View
@@ -6,18 +6,21 @@
"dependencies": {
"gulp": "^3.9.0",
"gulp-autoprefixer": "^3.0.1",
+ "gulp-clean": "^0.3.2",
"gulp-concat": "^2.6.0",
"gulp-debug": "^2.1.0",
"gulp-gm": "0.0.8",
"gulp-if": "^2.0.0",
"gulp-image-resize": "^0.7.1",
"gulp-less": "^3.0.3",
+ "gulp-minify-css": "^1.2.1",
"gulp-notify": "^2.2.0",
"gulp-rename": "^1.2.2",
+ "gulp-shell": "^0.5.2",
"gulp-sourcemaps": "^1.5.2",
- "gulp-minify-css": "^1.2.1",
"gulp-uglify": "^1.4.1",
- "gulp-watch": "^4.3.5"
+ "gulp-watch": "^4.3.5",
+ "run-sequence": "^1.2.2"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Oops, something went wrong.

0 comments on commit fa14aff

Please sign in to comment.