1.0.5 • Published 2 years ago
@itkyk/aws-s3-sync v1.0.5
@itkyk/aws-s3-sync
install
$ npm i -D @itkyk/aws-s3-sync
Introduce
- Add init command to script in package.json.
{
"script": {
"init": "sync --init"
}
}
- Execute init command.This command makes
.env.template
in./s3
.
$ npm run init
Open
.env.template
, then write AWS/S3 settings.Rename
.env.template
from.template
to target name. ex) .env.template → .env.preview- 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"
}
}
- If execute
npm run deploy
, sync s3 bucket.
setting env
key | description | default |
---|---|---|
maxAsyncS3 | 30 | |
s3RetryCount | 3 | |
s3RetryDelay | 1000 | |
multipartUploadThreshold | 20971520 | |
multipartUploadSize | 15728640 | |
region | ap-northeast-1 | |
accessKeyId | Your IAM access key | none |
secretAccessKey | Your IAM secret access key | none(required) |
localRoot | Target directory to upload | none(required) |
deleteRemote | Whether to delete unnecessary files in bucket when uploading. | false |
bucket | Yout S3 Bucket Name | none(required) |
prefix | Your Bucket prefix path | none(not required) |
distributionID | Your CloudFront distribution ID.If set distributionID, when finished S3 sync, create invalidation. | none(not required) |
distributionPaths | When create invalidation, set object path from this param .If need two or more paths, please put , between path. | /* |