https://github.com/takamin/frontup
A command to upload files to a S3 bucket and create invalidation of AWS CloudFront distribution.
https://github.com/takamin/frontup
aws cloudfront npm s3 uploader
Last synced: 2 months ago
JSON representation
A command to upload files to a S3 bucket and create invalidation of AWS CloudFront distribution.
- Host: GitHub
- URL: https://github.com/takamin/frontup
- Owner: takamin
- License: mit
- Created: 2019-04-14T10:19:23.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-04-30T21:43:04.000Z (about 3 years ago)
- Last Synced: 2025-03-15T04:46:56.892Z (over 1 year ago)
- Topics: aws, cloudfront, npm, s3, uploader
- Language: JavaScript
- Size: 456 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
frontup
=======
A command to upload files to a S3 bucket and create invalidation of AWS
CloudFront distribution.
This command needs official AWS-CLI.
And you must setup the profile (~/.aws) to connect for AWS.
Currently, this command invalidates all content paths after uploading.
## INSTALL
`npm install --global frontup`
or
`npm install --save-dev frontup`
If the global install fails, once uninstalling might be a solution.
## USAGE
```console
$ frontup -h
Usage: frontup [frontup_config_js] [OPTION]
AWS S3 contents uploader distributed by AWS cloudfront distribution.
PARAMETERS:
frontup_config_js (Optional)
A configuration filename.
Default: "./frontup.config.js"
OPTIONS:
-n, --dry-run Do not upload any files, but print the files and target keys
-v, --version display version
-h, --help display this help
A configuration file must be decalared as a CommonJs module.
It must export an object like below.
module.exports = {
"CloudFrontDistributionId": "",
"S3BucketName": "",
"Files": {
"": "",
"": [
"",
.
.
.
],
"": {
"path": "",
"exclude": [
"",
.
.
.
],
},
.
.
.
},
};
Installation: npm install frontup
Respository: https://github.com/takamin/frontup
```
Here is an example of configuration file.
__frontup.config.js__:
```javascript
module.exports = {
"CloudFrontDistributionId": "",
"S3BucketName": "",
"Files": {
"": "",
"": [
"",
.
.
.
],
"": {
"path": "",
"exclude": [
"",
.
.
.
],
},
.
.
.
},
};
```
__`cloudfront-distribution-id`:__
The id of CloudFront distribution.
__`s3-bucket-name`:__
The S3 bucket name which the contents published by the ClodFront distribution
are stored.
__`destination-s3-key`:__
The destination S3 Key.
If this must be a folder key, it should be ended with a slash(`/`).
__`relative-path-name`:__
The name to upload file or directory.
This must be a relative pathname from the current working directory.
__Do not start with `./`, `../` or `/`__ for the pathname.
If the pathname is directory, all the files will be uploaded.
__`regular-expression-to-exclude`__
To exclude specific files, Write regular expressions matching to the excluding
file name.
## LICENSE
Copyright (c) 2019 Koji Takami
This software is released under the [MIT License](./LICENSE)