# @s-ui/deploy

> CLI to deploy of sui-based projects

Latest version **2.11.0** (published 2019-03-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install @s-ui/deploy
pnpm add @s-ui/deploy
yarn add @s-ui/deploy
bun add @s-ui/deploy
```

Provides the command `sui-deploy`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.11.0 |
| Published | 2019-03-19 |
| First published | 2017-09-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 15 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 180 |
| Author | David Almeida |
| Maintainers | cvz, davidbarna, schibstedspain |

## Links

- npm: https://www.npmjs.com/package/@s-ui/deploy
- Repository: https://github.com/SUI-Components/sui
- Homepage: https://github.com/SUI-Components/sui/tree/master/packages/sui-deploy#readme
- Issues: https://github.com/SUI-Components/sui/issues
- npm.io page: https://npm.io/package/@s-ui/deploy

## Dependencies (5)

- [commander](https://npm.io/package/commander.md) 2.9.0
- [git-branch](https://npm.io/package/git-branch.md) 2.0.1
- [now-client](https://npm.io/package/now-client.md) 1.1.1
- [@s-ui/helpers](https://npm.io/package/@s-ui/helpers.md) 1
- [lodash.kebabcase](https://npm.io/package/lodash.kebabcase.md) 4.1.1

## Recent versions

- 2.11.0 (latest) — 2019-03-19
- 2.8.0-beta.0 (beta) — 2018-09-17
- 2.9.0 — 2018-10-17
- 2.8.0 — 2018-10-02
- 2.7.0 — 2018-07-26
- 2.6.0 — 2018-07-16
- 2.5.0 — 2018-07-10
- 2.4.0 — 2018-07-09
- 2.3.0 — 2018-07-09
- 2.2.0 — 2018-07-09
- 2.1.0 — 2018-07-05
- 2.0.0 — 2018-05-22
- 1.7.0 — 2018-05-22
- 1.6.0 — 2017-09-15
- 1.5.0 — 2017-09-07
- … 1 more at https://npm.io/package/@s-ui/deploy/versions

## README

# sui-deploy

> CLI to deploy of sui-based projects.

It provides:

* Common way to deploy our projects
* SPA deployments

## Installation

```sh
$ 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:

```sh
$ 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

```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 `:`.

```sh
$ 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.

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

#### `-b, --branch`

Append git branch name to deploy name.

```sh
$ 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

```sh
$ 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.

```sh
$ export NOW_TOKEN=my-token-from-now
```

## Help

Run the following command for further options:

```sh
$ sui-deploy help
```

or

```sh
$ sui-deploy spa --help
```

## Example package.json

```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:

```sh
$ npm run build; npm run deploy
```

---
_Source: https://npm.io/package/@s-ui/deploy · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
