Skip to content

dooly-ai/gulp-gcloud-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gulp-gcloud-sync

Sync files to a Google Cloud Storage bucket with Gulp.

publish will upload files to a given bucket.

sync will delete any files no longer in your local directory after X amount of days to a given bucket.

Install

yarn install gulp-gcloud-sync

Example

import gulp from 'gulp'
import parallelize from 'concurrent-transform';
import * as GGS from 'gulp-gcloud-sync

gulp.task('publish', () => {
  const opts = {
    bucket: 'bucketName,
    keyFilename: '../path/to/creds',
    projectId: 'projectId',
    verbose: false,
    simulate: false,
  }

  return gulp
    .src(['./static/**/*', '!./static/**/*.map'])
    .pipe(
      parallelize(
        GCP.publish({
          public: true,
          metadata: {
            cacheControl: 'no-cache, must-revalidate, public',
          },
          ...opts
        }),
        10,
      )
    )
    .pipe(GGS.sync({ days: 7, ...opts }))
});

About

Sync files to Google Cloud Storage with Gulp

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published