There are an increasing number of cases to publish simple Web sites and static sites on Amazon S3. There are also cases where CloudFront is used for speeding up display and using SSL / TLS. However, the uploading method will still be similar to FTP.
I would like to use Scotty.js there. It will go from uploading to publishing using CloudFront with one command.
How to use Scotty.js
I just ran it. We create buckets, upload files and publish using CloudFront.
$ scotty --website --bucket demo.moongift.jp
create ✤ /demo.moongift.jp bucket
bucket ✤ demo.moongift.jp
upload ✤ completed (102b, 0.72s)
config ✤ set as a website
config ✤ set cdn
It is an option of Scotty.js.
$ scotty --help
Scotty ✤ deploy static websites or folders to AWS S3 with a single command
Version: 1.6.0
✤ ✤ ✤
USAGE:
scotty {options} or beam-me-up {options}
AVAILABLE OPTIONS:
--help or -h Print this help
--version or -v Print the current version
--quiet or -q Suppress output when executing commands | default: false
--website or -w Set uploaded folder as a static website | default: false
--spa Set uploaded folder as a single page app and redirect all non-existing pages to index.html | default: false
--source or -s Source of the folder that will be uploaded | default: current folder
--bucket or -b Name of the S3 bucket | default: name of the current folder
--region or -r AWS region where the files will be uploaded | default: saved region if exists or a list to choose one if it is not saved yet
--force or -f Update the bucket without asking, region can be overridden with -r | default: false
--update or -u Update existing bucket | default: false
--delete or -d Delete existing bucket | default: false
✤ ✤ ✤
Beam me up, Scotty!
More info: https://github.com/stojanovic/scottyjs
Changelog/release history: https://github.com/stojanovic/scottyjs/releases
Scotty.js requires S3 and CloudFront operation authority. Regions are also heard for the first time.
If you add
--spa
, it will be in web application mode, and index.html will be loaded when there is no access destination file.
Scotty.js is JavaScript open source software (MIT License).
No comments:
Post a Comment