1.0.5 • Published 2 years ago

@itkyk/aws-s3-sync v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

@itkyk/aws-s3-sync

install

$ npm i -D @itkyk/aws-s3-sync

Introduce

  1. Add init command to script in package.json.
{
  "script": {
    "init": "sync --init"
  }
}
  1. Execute init command.This command makes .env.template in ./s3.
$ npm run init
  1. Open .env.template, then write AWS/S3 settings.

  2. Rename .env.template from .template to target name. ex) .env.template → .env.preview

  3. Add deploy command to script in package.jsonThe location of "preview" will be the name you changed from template earlier.
{
  "script": {
      "init": "sync --init",
      "deploy": "sync --deploy preview"
  }
}
  1. If execute npm run deploy, sync s3 bucket.

setting env

keydescriptiondefault
maxAsyncS330
s3RetryCount3
s3RetryDelay1000
multipartUploadThreshold20971520
multipartUploadSize15728640
regionap-northeast-1
accessKeyIdYour IAM access keynone
secretAccessKeyYour IAM secret access keynone(required)
localRootTarget directory to uploadnone(required)
deleteRemoteWhether to delete unnecessary files in bucket when uploading.false
bucketYout S3 Bucket Namenone(required)
prefixYour Bucket prefix pathnone(not required)
distributionIDYour CloudFront distribution ID.If set distributionID, when finished S3 sync, create invalidation.none(not required)
distributionPathsWhen create invalidation, set object path from this param .If need two or more paths, please put , between path./*