https://github.com/foo-software/s3-directory-sync-cli
A CLI to sync a local directory to an AWS S3 bucket.
https://github.com/foo-software/s3-directory-sync-cli
Last synced: 4 months ago
JSON representation
A CLI to sync a local directory to an AWS S3 bucket.
- Host: GitHub
- URL: https://github.com/foo-software/s3-directory-sync-cli
- Owner: foo-software
- Created: 2019-07-20T20:24:27.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T04:16:53.000Z (about 3 years ago)
- Last Synced: 2025-09-09T12:52:08.753Z (5 months ago)
- Language: JavaScript
- Size: 1.16 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## DEPRECATED
**This project has been deprecated and is no longer maintained** in favor of projects like [s3-sync-client](https://github.com/jeanbmar/s3-sync-client) which use the [AWS CLI command](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3/sync.html) directly. Comparatively, the linked project has much higher adoption and volume of maintainers / contributors. One reason for dropping support of this project is its major downfall in its lack of support for compression as noted in [issue #12](https://github.com/foo-software/s3-directory-sync-cli/issues/12).
Please consider using [s3-sync-client](https://github.com/jeanbmar/s3-sync-client) instead.
# `@foo-software/s3-directory-sync-cli`
> A CLI to sync a local directory with an AWS S3 bucket. Example usage could involve an automated deployment of a serverless web app. This command essentially uploads a folder to a bucket.
## Install
> For use within a project:
```bash
npm install @foo-software/s3-directory-sync-cli --save-dev
```
> For global use:
```bash
npm install @foo-software/s3-directory-sync-cli -g
```
## Usage
> Command line:
```bash
s3-directory-sync \
--S3_DIRECTORY_SYNC_ACCESS_KEY_ID abcdef \
--S3_DIRECTORY_SYNC_BUCKET ghijkl \
--S3_DIRECTORY_SYNC_LOCAL_DIRECTORY build \
--S3_DIRECTORY_SYNC_SECRET_ACCESS_KEY mnopqr \
/
```
> In a project `package.json` (assuming environment variables like `S3_DIRECTORY_SYNC_ACCESS_KEY_ID=abcdef`):
```json
{
"scripts": {
"deploy": "s3-directory-sync"
}
}
```
## Parameters
Parameters can either be passed in the command line as arguments or as environment variables.
Name
Description
Default
S3_DIRECTORY_SYNC_ACCESS_KEY_ID
The AWS accessKeyId for an S3 bucket.
--
S3_DIRECTORY_SYNC_BUCKET
The AWS Bucket for an S3 bucket.
--
S3_DIRECTORY_SYNC_DERIVE_CONTENT_TYPE
If set to true will derive `Content-Type` metadata from file extension via mime-types
false
S3_DIRECTORY_SYNC_SECRET_ACCESS_KEY
The AWS secretAccessKey for an S3 bucket.
--
S3_DIRECTORY_SYNC_LOCAL_DIRECTORY
The local directory to sync (upload), relative to the directory of the command execution.
--
S3_DIRECTORY_SYNC_PROGRESS
If set to true the CLI will display a progress bar. Might be buggy in CI which justifies this option.
false
S3_DIRECTORY_SYNC_REMOTE_DIRECTORY
The directory of an S3 bucket to sync from a local directory. An empty string signifies the root.
''
S3_DIRECTORY_SYNC_REMOVE_HTML_EXTENSIONS
If true HTML files will be uploaded with the `.html` extension omitted from the `Key`. This can be helpful if hosting an S3 website.
false
S3_DIRECTORY_SYNC_REMOVE_HTML_EXTENSIONS_EXCLUDE
An escape hatch to the above S3_DIRECTORY_SYNC_REMOVE_HTML_EXTENSIONS option. In the future, perhaps we could make this into a regex, but for now you can populate this value with a comma-separated list of paths relative to the local directory. Example static/html/iframe.html,static/html/iframe2.html (no glob pattern or dot prefix).
''
S3_DIRECTORY_SYNC_ACL
The Access Control Policy as documented.
public-read
S3_DIRECTORY_SYNC_STRICT
Set to true if remote files that don't exist locally should be removed.
false
## Credits
>
This package was brought to you by [Foo - a website quality monitoring tool](https://www.foo.software). Automatically test and monitor website performance, SEO and accessibility with Lighthouse. Analyze historical records of Lighthouse tests with automated monitoring. Report with confidence about SEO and performance improvements to stay on top of changes when they happen!