# shippy-cli

[![version][npm-image]][npm-url]

> [!WARNING]
> Openshift is now deprecated. Using the `main` environment is longer recommended. Please use `shippy environment gke`.

The indefatigable TELUS digital delivery platform assistant.

- Clone and deploy [reference architecture](https://github.com/telus/reference-architecture) starter kits
- Onboard users into OpenShift & HashiCorp Vault
- Create squads & assign tech leads & members
- Create projects & assign them to squads
- Toggle between environments & projects
- Edit Vault secrets & policies
- Bonanza of memes & laffs

## Get it

```bash
npm install -g @telus/shippy-cli
```

## Run it

`Please make sure you are not running any application on port 3000 during shippy login, as the OAuth app will consume the port 3000 behind the scene`

### Help

```bash
shippy help
```

### Initialize development environment tooling

```bash
shippy init
```

### Search reference architecture documentation

```bash
shippy howdoi <feature>
```

### Login

```bash
shippy login
```

### Set environment and project

```bash
shippy environment main
shippy project myproject
shippy status
```

### Clone and deploy GitHub repos from starter kits

```bash
shippy create repo my-repo-name
shippy create pipeline my-repo-name
shippy create webhook my-repo-name
```

### Change all the things!

```bash
shippy <create/get/edit/delete> <resource>
```

### Use YAML

```bash
shippy get user test.user > testuser.yaml
shippy edit user test.user -f=testuser.yaml
```

### Create a New User (requires escalated privileges)

```bash
shippy create user <name>
```

_Note: Expected convention is your long-form name separated by a period (ie. john.doe)_

### Create a New Squad (requires escalated privileges)

```bash
shippy create squad <squadname>
```

### Edit Existing Squad (requires escalated privileges)

```bash
shippy edit squad <squadname>
```

### Create a New Project (requires escalated privileges)

```bash
shippy environment <sandbox|main>
shippy create project <project>
```

_Note: Expected convention is your project's domain name/URL (ie. telus.com/foo would be_ `foo`_, and bar-baz.telus.com would be_ `bar-baz`)

### Edit Existing Project (requires escalated privileges)

\_Note: follow the prompts to add or remove squads from the project

```bash
shippy edit project <project>
```

### Create a starter-kit derived application

```bash
shippy environment <sandbox|main>
shippy project <myproject>
shippy create repo <myproject>
```

_Note: You will be prompted with a list of starter-kits_

### Deploy your application pipeline to Openshift

```bash
shippy environment <sandbox|main>
shippy project <myproject>
shippy create pipeline <name>
```

### Create a webhook to fire from GitHub to Jenkins

```bash
shippy environment <sandbox|main>
shippy project <myproject>
shippy create webhook <repository_name>
```

### Create a new secret in Vault

```bash
shippy environment <sandbox|main>
shippy project <myproject>
shippy create secret <name>
key: <name>
value: <REDACTED>
```

_Note: You will be taken to your preferred editor to paste the_ `value` _in_

### Chill out

```bash
shippy party
```

---

> Github: [@telus](https://github.com/telus) •
> Twitter: [@telusdigital](https://twitter.com/telusdigital)

[npm-url]: https://www.npmjs.com/package/@telus/shippy-cli
[npm-image]: https://img.shields.io/npm/v/@telus/shippy-cli.svg?style=for-the-badge&logo=npm
