Giter Site home page Giter Site logo

gitter-badger / scottyjs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stojanovic/scottyjs

0.0 0.0 0.0 6.41 MB

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

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

License: MIT License

JavaScript 97.46% CSS 0.89% HTML 1.65%

scottyjs's Introduction

Scotty.js

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

scotty header

Build Status npm npm npm

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
  • --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)
  • --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)

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.

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

scottyjs's People

Contributors

fregante avatar notatestuser avatar simalexan avatar stojanovic avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.