@s-ui/deploy

2.11.0 • Public • Published

sui-deploy

CLI to deploy of sui-based projects.

It provides:

  • Common way to deploy our projects
  • SPA deployments

Installation

$ npm install @s-ui/deploy --save-dev

CLI

When installed, a new CLI sui-deploy (node_modules/.bin/sui-deploy) is automatically available to deploy your projects.

Deploy a folder as an static SPA:

$ sui-deploy <name-of-project> [build-folder=./public] --now
$ sui-deploy spa <name-of-project> [build-folder=./public] --now

sui-deploy <name> [folder]

Deploys given folder. Handles:

  • docker run if DockerFile is found.
  • npm run start if package.json is found.
  • serve . otherwise.

sui-deploy spa <name> [folder]

Same as previous but deploys app as an SPA, adding the option of auth. A static server is run but not found routes point to index.html to make SPAs routing to work.

Options

--now

Only hosting service available. Deploys to now.sh

$ sui-deploy spa 'test-project' --now -p

Deploys to test-project.now.sh

-a, --auth <user:password> (only for spa)

HTTP authentication user and pass separated by :.

$ sui-deploy spa test-project --now -a 'my-user:my-password'

-p, --public

Force skipping auth to make your deployment public.

CAUTION: if your deployment is public, it's also indexable by search engines.

$ sui-deploy spa test-project --now -p

-b, --branch

Append git branch name to deploy name.

$ sui-deploy spa test-project --now -b -a 'my-user:my-password'

If your branch is my-feature, your code will be deployed to test-project-my-feature.now.sh

-e, --environmentVars

Append multiple env vars that will be passed to our deployer

$ sui-deploy spa test-project --now -b -a 'my-user:my-password' -e NODE_ENV=preproduction -e GH_AUTH_TOKEN=secret

Authentification

When --now option is set, sui-deploy needs a now token to deploy files. The token is obtain from the env variable NOW_TOKEN

You can set your token once with a simple command.

$ export NOW_TOKEN=my-token-from-now

Help

Run the following command for further options:

$ sui-deploy help

or

$ sui-deploy spa --help

Example package.json

{
  "name": "@my-scope/test-project",
  "version": "1.0.0",
  "scripts": {
    "build": "sui-bundler build -C",
    "deploy": "sui-deploy spa test-project --now -a 'my-user:my-password'"
  },
  "devDependencies": {
    "@s-ui/deploy": "2"
  }
}

To deploy your project:

$ npm run build; npm run deploy

Readme

Keywords

none

Package Sidebar

Install

npm i @s-ui/deploy

Weekly Downloads

75

Version

2.11.0

License

MIT

Unpacked Size

15.3 kB

Total Files

8

Last publish

Collaborators

  • daniel.perez.ext
  • albert.peiro
  • frandelacasa-adevinta
  • mariapaula.forero.ext
  • hpintos_adevinta
  • sziauberyte
  • victor.perez.adevinta
  • oscar-raig-adevinta
  • carlos.gonzalezl
  • carolina.mallo.ext
  • david.nieto
  • ferran.simon
  • xavi_conejo
  • sergi.quintela
  • jamile.radloff
  • xavi_ballestar
  • luz_adv
  • ignacio.rodriguez
  • carlosvillu-adevinta
  • diegomr
  • arturo.vicente
  • adria.velardos
  • emiliovz
  • dann41
  • ruben-martin
  • pol.valls
  • cristina.rodriguez.duque
  • sergio.escano
  • marc.benito
  • azahara
  • patricio.sartore
  • giovanny.sayas.ext
  • david.cuadrado.ext
  • alex.castells
  • beatrizip
  • pablo.rey-adevinta
  • sergiocollado
  • mango.sanchezredondo
  • cristhianb
  • alisa_bayanova
  • davidmartin2108
  • ferrangbtw
  • estefania_garcia
  • belen.santos
  • alfredo.arronte
  • joanleon-adv
  • giodelabarrera.adevinta
  • luis-garrido
  • aitor.rodriguez
  • jordi.munoz
  • oscar_ramirez
  • ignacio_navarro
  • a.ferrer
  • gfabregoadv
  • izeller
  • salvador.juan
  • oriol.egea
  • ivanmlaborda
  • alejandro.ferrante
  • pa.chruscinski.ext
  • isabelgomez87
  • jenifer.lopez
  • daniela.aguilera
  • pablogs
  • javier.miguel
  • oscar.gomez
  • marian.lucaci
  • alverd004
  • oriol.puig
  • nacho_torrella
  • xavi.murcia
  • chloe.leteinturier
  • javiauso
  • alfredo.zimperz
  • francisco.ruiz.lloret
  • fermin.adevinta
  • andresadv
  • schibstedspain