@pascencio/gulp-s3-deploy

1.0.3 • Public • Published

gulp-s3-deploy

s3 plugin for gulp

Info

This plugin is a fork of gulp-s3-publish.

FIX Issue reported here

Usage

First, install gulp-s3-deploy and aws-sdk as a development dependency:

npm i --save-dev @pascencio/gulp-s3-deploy aws-sdk

Then, use it in your gulpfile.js:

const { upload, clean } = require('@pascencio/gulp-s3-deploy');
const { S3 } = require('aws-sdk'); 

const client = new S3();

const uploadOpts = {
  bucket: 'my-s3-bucket',
  // uploadPath: 's3/upload/path',
  // delay: 0,
  // maxConcurrency: 1,
  putObjectParams: {
    ACL: 'public-read'
  },
  // dryRun: false,
};

const cleanOpts = {
  bucket: 'my-s3-bucket',
  // uploadPath: 's3/upload/path'
  // whitelist: [
  //   { type: 'key', path: 'keep-this-file.txt' },
  //   { type: 'keyPrefix', path: 'keep-this-path' },
  // ],
  // dryRun: false,
};

// Upload files to S3
// and clean orphaned files
gulp.task('deploy', () => {
  return gulp.src('./dist/**/*')
    .pipe(upload(client, uploadOpts))
    .pipe(clean(client, cleanOpts))
});

License

MIT License

Readme

Keywords

Package Sidebar

Install

npm i @pascencio/gulp-s3-deploy

Weekly Downloads

6

Version

1.0.3

License

MIT

Unpacked Size

11 kB

Total Files

8

Last publish

Collaborators

  • pascencio