Merge pull request #713 from google/synch-zip

make zip file generation synchronous and deterministic before pushed to cloud
master
Marc Cohen 2015-07-06 12:16:18 +01:00
commit c74abfe1f1
1 changed files with 5 additions and 4 deletions

View File

@ -482,7 +482,7 @@ gulp.task('serve', ['default'], function() {
// Generate release archive containing just JS, CSS, Source Map deps
gulp.task('zip:mdl', function() {
gulp.src(['dist/material?(.min)@(.js|.css)?(.map)', 'LICENSE', 'bower.json', 'package.json'])
return gulp.src(['dist/material?(.min)@(.js|.css)?(.map)', 'LICENSE', 'bower.json', 'package.json'])
.pipe($.zip('mdl.zip'))
.pipe(gulp.dest('dist'));
});
@ -507,7 +507,7 @@ var fileFilter = $.filter([
gulp.task('zip:templates', function() {
// Stream of all `dist` files and other package manager files from root
gulp.src(['dist/**/*.*', 'LICENSE', 'bower.json', 'package.json'])
return gulp.src(['dist/**/*.*', 'LICENSE', 'bower.json', 'package.json'])
.pipe(fileFilter)
.pipe($.zip('mdl-templates.zip'))
.pipe(fileFilter.restore())
@ -527,7 +527,7 @@ gulp.task('genCodeFiles', function() {
// global, high performance caching/content delivery network (CDN) service.
// This task requires gsutil to be installed and configured.
// For info on gsutil: https://cloud.google.com/storage/docs/gsutil.
gulp.task('pushCodeFiles', ['zip:mdl', 'zip:templates'], function() {
gulp.task('pushCodeFiles', function() {
// Build dest path, info message, cache control and gsutil cmd to copy
// each object into a GCS bucket. The dest is a version specific path.
// The gsutil -m option requests parallel copies.
@ -545,7 +545,7 @@ gulp.task('pushCodeFiles', ['zip:mdl', 'zip:templates'], function() {
// Upload the goodies to a separate GCS bucket with versioning.
// Using a sep bucket avoids the risk of accidentally blowing away
// old versions in the microsite bucket.
gulp.src('')
return gulp.src('')
.pipe($.shell([
gsutilCpCmd + codeFiles + ' ' + dest + '/' + pkg.version,
gsutilCacheCmd + ' ' + dest + '/' + pkg.version
@ -554,6 +554,7 @@ gulp.task('pushCodeFiles', ['zip:mdl', 'zip:templates'], function() {
gulp.task('publish:code', function (cb) {
runSequence(
['zip:mdl', 'zip:templates'],
'genCodeFiles',
'pushCodeFiles',
cb);