static-cli

0.0.13 • Public • Published
  =============================
           __        __  _
     _____/ /_____ _/ /_(_)____
    / ___/ __/ __ `/ __/ / ___/
   (__  ) /_/ /_/ / /_/ / /__
  /____/\__/\__,_/\__/_/\___
  =============================

Magically fast static deploys.

What is it?

TLDR: Heroku for static applications. Ember, Gitbooks, Angular, whatever you want.

What do I need to know?

Each git sha you push to Static is immediately accessible in every environment.

It can be visited at http://{your-app}--{environment}.ui.groupondev.com?__package={git sha}

For example, to see Bling running against the staging servers for sha abc123:

It can be visited at http://bling--staging.ui.groupondev.com?__package=abc123

Once a package is pushed, it can be promoted to give it a named URL without needing to open a DNS request. (bling--staging.ui.groupondev.com, bling.ui.groupondev.com)

Static allows you to proxy certain paths to internal backend servers (for example, in an app deployed to bling.ui.groupondev.com, a request for bling.ui.groupondev.com/__/proxies/api will proxy to accounting-app1.snc1/api)

More efficient use of server resources (allows lots of static sites to share a smaller amount of resources).

All configuration is stored in the static.json file in the root of your project folder.

How do I use it?

In an Ember app

Installing

Ember Blueprint:

If you're using the Ember blueprint provided by UIE, it is already included. More information about the blueprint can be found here.

Pushing

Pushing sends your current package to the server, and gives you back a URL based on the current git sha.

ember deploy
> Your site is now available at https://my-app.ui.groupondev.com?__package=6d5e04e44701f9928434dd6ea5eb4933637e3247

Promoting

Promoting takes a pushed package and gives it a named URL.

ember deploy:promote SHA SUBDOMAIN

example:

ember deploy:promote 6d5e04e44701f9928434dd6ea5eb4933637e3247 production

Now, production.bling.ui.groupondev.com is the same as 6d5e04e44701f9928434dd6ea5eb4933637e3247.bling.ui.groupondev.com.

Listing

See all packages you've ever pushed.

ember deploy:list
> `PackageId`                             `URL`
> `6cbadef3-77cf-4051-8e0f-78fa35f60a64`  `bling.ui.groupondev.com?__package=6cbadef3-77cf-4051-8e0f-78fa35f60a64`
> `production`                            `bling.ui.groupondev.com`

In a non-Ember app

Installing

  1. Install the npm package.
npm install -g static-cli --registry=http://npm-registry.snc1
  1. Create your static.json config.
static init

Pushing

You should have your assets built prior to pushing. Configure the path to send up by setting the root key in your static.json.

Example:

Your assets get built to the ./dist folder in your project.

{
  "name": "bling",
  "root": "./dist",
  ...
}

Pushing sends your current package to the server, and gives you back a URL based on the current git sha.

static push

Promoting

Promoting takes a pushed package and gives it a named URL.

static promote SHA SUBDOMAIN

example:

static promote 6d5e04e44701f9928434dd6ea5eb4933637e3247 production

Listing

See all packages you've ever pushed.

static list
> `BuildId`                               `URL`
> `6cbadef3-77cf-4051-8e0f-78fa35f60a64`  `bling.ui.groupondev.com?__package=6cbadef3-77cf-4051-8e0f-78fa35f60a64`
> `production`                            `bling.ui.groupondev.com`

Who did it?

It's a product of the UI Engineering team (ui-engineering@groupon.com).

  • Dean Marano
  • Sean Massa
  • Trek Glowaki

Readme

Keywords

none

Package Sidebar

Install

npm i static-cli

Weekly Downloads

5

Version

0.0.13

License

none

Last publish

Collaborators

  • dmarano