GithubHelp home page GithubHelp logo

serverless-s3-local-sync's Introduction

serverless-s3-local-sync

serverless plugin that syncs a directory with a local s3 bucket

Works with these plugins:

Example serverless.yml

plugins:
  - serverless-offline # this plugin uses offline hooks
  - serverless-s3-sync # not required but this plugin uses the s3Sync custom config
  - serverless-s3-local # creates the local 'bucket'
  - serverless-s3-local-sync # specify this plugin last, as it relies on the others

custom:
  s3: # serverless-s3-local config
    host: 0.0.0.0
    port: 5000
    directory: /tmp/s3bucket
    cors: false
    # noStart: true
  s3Sync: # serverless-s3-sync cobfig
    - bucketName: yourBucketName
      localDir: src 

serverless-s3-local-sync's People

Contributors

mbudm avatar vkartaviy avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

serverless-s3-local-sync's Issues

s3 key is missing the first letter of the file

Minor inconvenience but the cleanFilePathOfLocalDir eats up the first letter of the file name.

function cleanFilePathOfLocalDir(filePath, localDir) {
  return filePath.slice(localDir.length).replace(/^(\/)/, '');
}

->

function cleanFilePathOfLocalDir(filePath, localDir) {
  return filePath.slice(localDir.length - 1).replace(/^(\/)/, '');
}

serverless variable substitution

Hello,

The code does not work when using variables in serverless.yml. ex:
custom: ${file(serverless-${opt:stage, self:provider.stage}.yml):custom}

I read something about serverless calling all plugin constructors then doing variable processing.

I believe the code in the constructor:
this.s3Sync = this.serverless.service.custom.s3Sync;

should be moved into sync():
this.s3Sync = (this.serverless.service.custom && this.serverless.service.custom.s3Sync) || [];

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.