• This repository has been archived on 17/Jul/2021
  • Stars
    star
    705
  • Rank 64,230 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 7 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Deploy static websites and single page apps to AWS S3 and CloudFront with a single command

Scotty.js

As you probably noticed, Scotty.js is not active anymore. Working on Scotty.js was fun, but AWS released AWS Amplify in the meantime, and tools such as Scotty.js are no longer needed. Please take a look at the AWS Amplify Console. It's an excellent tool for hosting static websites and single-page applications.


Deploy static websites or folders to AWS S3 with a single command

scotty header

Build Status npm npm npm Join the chat at https://gitter.im/scottyjs/scotty

Install

Scotty.js is available on NPM. Install it as a global dependency to be able to use scotty command anywhere:

npm install scottyjs --global

Use

Beam me up, Scotty

To deploy a static folder to AWS S3 run:

scotty {options}

or

beam-me-up {options}

Available options

  • --help or -h - Print this help
  • --version or -v - Print the current version
  • --noclipboard or -n - Do not copy the URL to clipboard (default: false)
  • --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 (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)
  • --prefix or -p - Prefix on the S3 bucket (default: the root of the bucket)
  • --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 (default: false, forced region can be overridden with -r)
  • --update or -u - Update existing bucket (default: false)
  • --delete or -d - Delete existing bucket (default: false)
  • --nocdn or -c - Disable Cloudfront handling (default: false)
  • --urlonly or -o - Only output the resulting URL, CDN or S3 according to options (default: false)
  • --expire or -e - delete objects on bucket older than n days (default: no expiration)
  • --profile or -a - AWS profile to be used (default: 'default')
  • --empty or -y - Empty the bucket (Delete all objects before upload files) (default: false)

Examples

Create React App application

Full tutorial: http://medium.com/@slobodan/single-command-deployment-for-single-page-apps-29941d62ef97

To deploy CRA apps simply run npm run build in your project root folder to create build version.

Then deploy build version using following command:

scotty --spa --source ./build

Or, if you want to specify bucket name run:

scotty --spa --source ./build --bucket some-bucket-name

With --spa flag, Scotty will set required redirects for your single page app, so your app can use pushState out of the box.

Shared bucket application

To deploy multiple apps to a single bucket you can make use of the --prefix option. This comes in handy when your CI system deploys to a staging system with each branch as a pathname. Eg. the master branch should go to bucket root (/), so you do not set the prefix. The feature/fancy-stuff branch should go to the bucket path feature/fancy-stuff so just add this as the prefix. Here comes a command line example:

# deploy your master branch build to bucket root
scotty --source ./build --bucket some-bucket-name
# deploy your branch build to the branch name on the bucket
scotty --source_ ./build --bucket some-bucket-name --prefix your/branch

Test

We use Jasmine for unit and integration tests. Unless there is a very compelling reason to use something different, please continue using Jasmine for tests. The existing tests are in the spec folder. Here are some useful command shortcuts:

Run all the tests:

npm test

Run only some tests:

npm test -- filter=prefix

Get detailed hierarchical test name reporting:

npm test -- full

License

MIT -- see LICENSE

More Repositories

1

alexa-skill-kit

Library for effortless Alexa Skill development with AWS Lambda
JavaScript
280
star
2

alexa-message-builder

Simple message builder for Alexa replies.
JavaScript
100
star
3

lambda-audio

Run Sound eXchange (SoX), the Swiss Army knife of audio manipulation, with Lame on AWS Lambda
JavaScript
58
star
4

space-explorer-bot

A small FB Messenger chat bot using NASA API and Claudia Bot Builder.
JavaScript
57
star
5

huh

"Virus due to computers having unsafe sex." - Random BOFH-style excuses
JavaScript
33
star
6

vreme

Date formatting by example
JavaScript
31
star
7

souffleur

Simple command line prompt with retry for empty answers
JavaScript
21
star
8

cyrillic-to-latin

Convert cyrillic characters to latin.
JavaScript
20
star
9

fuckyou

Kill any process (╯°□°)╯︵ ssǝɔoɹd
JavaScript
14
star
10

random

4
star
11

crypto-skill

Crypto Skill - an Alexa skill developed at NoSlidesConf 2017 live coding session
JavaScript
4
star
12

holyjs-bot

Simple Telegram bot for HolyJS conference
JavaScript
4
star
13

space-explorer-bot-viber

Space Explorer bot for Viber
JavaScript
4
star
14

laptop-friendly-bot

LaptopFriendly chatbot
JavaScript
4
star
15

artproject-scraper

Get random art and metadata from Google Art Project
JavaScript
3
star
16

web-bot-ui

JavaScript
2
star
17

bartender-skill

Bartender skill for Alexa can recommend a cocktail and give you an info about ingredients and preparation.
JavaScript
2
star
18

serverless-apps-with-typescript-article

[WIP]
TypeScript
1
star
19

website

Personal website
1
star
20

test-video

1
star
21

how-to-build-a-website-that-will-eventually-work-on-mars

Conferece talk
1
star
22

workshop-meetup-app-frontend

JavaScript
1
star
23

amsterdam-facts

A serverless API demo for AmsterdamJS conference
JavaScript
1
star
24

for-conferences

Abstracts and links for videos/slides of my conference talks
1
star
25

fake-css-mouse-tracking

Just an old demo
CSS
1
star
26

serverless-svg-to-png-converter

1
star
27

scottyjs.com

Website for Scotty.js
HTML
1
star
28

flipout

Flip text upside-down
JavaScript
1
star
29

offlineweb.rocks

1
star
30

github-issue-to-slack-channel

Send Github issues to Slack channel via AWS Lambda and NodeJS
JavaScript
1
star