Skip to content

Commit

Permalink
Reorganised docs to be easier to parse
Browse files Browse the repository at this point in the history
Doc rehash
  • Loading branch information
TWinsnes committed Sep 11, 2023
2 parents 3c6c9a3 + 75b2126 commit a9fc197
Show file tree
Hide file tree
Showing 15 changed files with 390 additions and 155 deletions.
221 changes: 68 additions & 153 deletions README.md

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ Ideally releasing should be done often with small increments when possible. Unle
breaking change is blocking the release, or no fixes/features have been merged, a good
target release cadence is between every 1 or 2 weeks.

Our [release process](.github/workflows/release.yml) will create the following artifacts:
- A signed Darwin Fat Binary (for Intel and ARM MAC devices)
- Linux ARM & x86_64 binary
- Windows ARM & x86_64 binary
- Docker Container pushed to hava/cli


## Retracting a release

Expand Down
2 changes: 1 addition & 1 deletion cicd-examples/README.md → docs/cicd-examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The following are sample CICD pipelines for various platforms. We recommend choo

## Gitlab CI

- [Gitlab CI](./gitlab/.gitla-ci.yml) (Uses the docker image)
- [Gitlab CI](./gitlab/.gitlab-ci.yml) (Uses the docker image)


## Circle CI
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 9 additions & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

Binaries are created as part of a release, check out the [Release Page](https://github.com/teamhava/hava-ui-cli/releases) for the latest version.

- [Installation](#installation)
- [Pre-Requisites](#pre-requisites)
- [Environment Variable](#environment-variable)
- [Configuration File](#configuration-file)
- [Precedence](#precedence)
- [Running in Automation/CICD](#running-in-automationcicd)



**MacOs Installation amd64 OR arm64**
```sh
Expand Down Expand Up @@ -76,7 +84,7 @@ hava --config <location-to-config-file> source list
`hava` CLI will use the following precedence when determining which item to take
- environmen variable
- environment variable
- config file
- default
Expand Down
125 changes: 125 additions & 0 deletions docs/outputs-format.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
## Output Formats

- [Output Formats](#output-formats)
- [Table Output](#table-output)
- [Json Output](#json-output)
- [CSV Output](#csv-output)
- [Markdown Output](#markdown-output)
- [HTML Output](#html-output)


### Table Output
A table is the default format when outputting information about hava sources

```bash
hava source list
╭───┬───────────────┬──────────────────────────────────────┬──────────────────────┬───────────────┬────────┬─────────────────────────────────────────╮
│ │ DISPLAYNAME │ ID │ INFO │ NAME │ STATE │ TYPE │
├───┼───────────────┼──────────────────────────────────────┼──────────────────────┼───────────────┼────────┼─────────────────────────────────────────┤
│ 1 │ dev │ 4f14c115-3b0d-40ea-b075-6df9b2fb81c9 │ AKIAIOSFODNN7EXAMPLE │ dev │ active │ Sources::AWS::Keys │
│ 2 │ GCPDevChange3 │ f2a26440-10bf-43d1-9742-8361de30590f │ credentials.json │ GCPDevChange3 │ active │ Sources::GCP::ServiceAccountCredentials │
╰───┴───────────────┴──────────────────────────────────────┴──────────────────────┴───────────────┴────────┴─────────────────────────────────────────╯
```

### Json Output


```bash
hava source list --json | jq
[
{
"DisplayName": "dev",
"Id": "4f14c115-3b0d-40ea-b075-6df9b2fb81c9",
"Info": "AKIAIOSFODNN7EXAMPLE",
"Name": "dev",
"State": "active",
"Type": "Sources::AWS::Keys"
},
{
"DisplayName": "GCPDevChange3",
"Id": "f2a26440-10bf-43d1-9742-8361de30590f",
"Info": "credentials.json",
"Name": "GCPDevChange3",
"State": "active",
"Type": "Sources::GCP::ServiceAccountCredentials"
}
]
```

### CSV Output

```bash
hava source list --csv
,DisplayName,Id,Info,Name,State,Type
1,dev,4f14c115-3b0d-40ea-b075-6df9b2fb81c9,AKIAIOSFODNN7EXAMPLE,dev,active,Sources::AWS::Keys
2,GCPDevChange3,f2a26440-10bf-43d1-9742-8361de30590f,credentials.json,GCPDevChange3,active,Sources::GCP::ServiceAccountCredentials
```


### Markdown Output

```bash
hava source list --markdown
| | DisplayName | Id | Info | Name | State | Type |
| ---:| --- | --- | --- | --- | --- | --- |
| 1 | dev | 4f14c115-3b0d-40ea-b075-6df9b2fb81c9 | AKIAIOSFODNN7EXAMPLE | dev | active | Sources::AWS::Keys |
| 2 | GCPDevChange3 | f2a26440-10bf-43d1-9742-8361de30590f | credentials.json | GCPDevChange3 | active | Sources::GCP::ServiceAccountCredentials |
```


### HTML Output

```
hava source list --html
<table class="go-pretty-table">
<thead>
<tr>
<th>&nbsp;</th>
<th>DisplayName</th>
<th>Id</th>
<th>Info</th>
<th>Name</th>
<th>State</th>
<th>Type</th>
</tr>
</thead>
<tbody>
<tr>
<td align="right">1</td>
<td>appGCP</td>
<td>09409035-87d4-478b-bec0-25349825d390</td>
<td>credentials.json</td>
<td>appGCP</td>
<td>active</td>
<td>Sources::GCP::ServiceAccountCredentials</td>
</tr>
<tr>
<td align="right">2</td>
<td>devTestAWS</td>
<td>a2d8d0c8-0fd4-4483-ab2a-71e4ef58e093</td>
<td>AKIAIOSFODNN7EXAMPLE</td>
<td>devTestAWS</td>
<td>active</td>
<td>Sources::AWS::Keys</td>
</tr>
<tr>
<td align="right">3</td>
<td>devTestAWScar</td>
<td>c3b9d2d7-0cb1-4fd1-92d7-beed7ceb7b22</td>
<td>arn:aws:iam::777777777777:role/HavaCAR</td>
<td>devTestAWScar</td>
<td>active</td>
<td>Sources::AWS::CrossAccountRole</td>
</tr>
<tr>
<td align="right">4</td>
<td>devTestAzure</td>
<td>76903928-8ae0-4ccb-8dee-ede61db9dc5c</td>
<td>uPfVzmPStDe9ya</td>
<td>devTestAzure</td>
<td>inactive</td>
<td>Sources::Azure::Credentials</td>
</tr>
</tbody>
</table>
```
116 changes: 116 additions & 0 deletions docs/source_cmds.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# Source Commands

- [Source Commands](#source-commands)
- [Source List all](#source-list-all)
- [Source List SourceID](#source-list-sourceid)
- [Source Sync SourceID](#source-sync-sourceid)
- [Source Create AWS (Using Access Keys)](#source-create-aws-using-access-keys)
- [Source Create AWS (Using Cross Account Role)](#source-create-aws-using-cross-account-role)
- [Source Create GCP](#source-create-gcp)
- [Source Create Azure](#source-create-azure)
- [Source Delete](#source-delete)
- [Source Update AWS|AZURE|GCP](#source-update-awsazuregcp)


`hava source -h`

```bash
Create/List/Delete/Update sources to Hava for different providers (AWS/Azure/Google Cloud)

Usage:
hava source [flags]
hava source [command]

Available Commands:
create Create sources to Hava
delete Delete sources to Hava
list List sources of Hava
sync Sync sources to Hava
update Update sources to Hava

Flags:
--all hava source --all
-h, --help help for source
--sourceId string sourceId of AWS|Azure|GCP source
```

## Source List all

`hava source list`

```
╭───┬─────────────┬──────────────────────────────────────┬──────────────────────┬────────────┬────────┬────────────────────╮
│ │ DISPLAYNAME │ ID │ INFO │ NAME │ STATE │ TYPE │
├───┼─────────────┼──────────────────────────────────────┼──────────────────────┼────────────┼────────┼────────────────────┤
│ 1 │ devTestAWS │ 8eb192e2-9beb-466b-ae14-c05fc8403cf4 │ AKIAIOSFODNN7EXAMPLE │ devTestAWS │ active │ Sources::AWS::Keys │
╰───┴─────────────┴──────────────────────────────────────┴──────────────────────┴────────────┴────────┴────────────────────╯
```

## Source List SourceID

`hava source list --source-id a58b7cb1-f9da-42ad-9fc1-8dc61b0d3e38`


## Source Sync SourceID

`hava source sync a58b7cb1-f9da-42ad-9fc1-8dc61b0d3e38`


## Source Create AWS (Using Access Keys)

`hava source create aws --name dev --access-key $AWS_ACCESS_KEY_ID --secret-key $AWS_SECRET_ACCESS_KEY`

```bash
[INFO] Created AWS Source for the following source:

╭───┬─────────────┬──────────────────────────────────────┬──────────────────────┬────────────┬────────┬────────────────────╮
│ │ DISPLAYNAME │ ID │ INFO │ NAME │ STATE │ TYPE │
├───┼─────────────┼──────────────────────────────────────┼──────────────────────┼────────────┼────────┼────────────────────┤
│ 1 │ devTestAWS │ 040d5b5e-03b9-4343-9393-8ad0794512f4 │ AKIAIOSFODNN7EXAMPLE │ devTestAWS │ queued │ Sources::AWS::Keys │
╰───┴─────────────┴──────────────────────────────────────┴──────────────────────┴────────────┴────────┴────────────────────╯
```

## Source Create AWS (Using Cross Account Role)

`hava source create aws --name devCAR --role-arn $AWS_CROSS_ACCOUNT_ROLE`

```bash
[INFO] Created AWS Source for the following source:

╭───┬─────────────┬──────────────────────────────────────┬────────────────────────────────────────┬────────┬────────┬────────────────────────────────╮
│ │ DISPLAYNAME │ ID │ INFO │ NAME │ STATE │ TYPE │
├───┼─────────────┼──────────────────────────────────────┼────────────────────────────────────────┼────────┼────────┼────────────────────────────────┤
│ 1 │ devCAR │ 31f9b6a6-4e48-400a-8ced-5bfc2a1aacc2 │ arn:aws:iam::123456789012:role/HavaCAR │ devCAR │ queued │ Sources::AWS::CrossAccountRole │
╰───┴─────────────┴──────────────────────────────────────┴────────────────────────────────────────┴────────┴────────┴────────────────────────────────╯
```

## Source Create GCP

`hava source create gcp --name GCPDev --configFile $GCP_ENCODED_FILE`

```bash
[INFO] Created GCP Source for the following source:

╭───┬─────────────┬──────────────────────────────────────┬──────────────────┬────────┬────────┬─────────────────────────────────────────╮
│ │ DISPLAYNAME │ ID │ INFO │ NAME │ STATE │ TYPE │
├───┼─────────────┼──────────────────────────────────────┼──────────────────┼────────┼────────┼─────────────────────────────────────────┤
│ 1 │ GCPDev │ 8818d864-46e9-4b8d-acdd-a31d8936e62f │ credentials.json │ GCPDev │ queued │ Sources::GCP::ServiceAccountCredentials │
╰───┴─────────────┴──────────────────────────────────────┴──────────────────┴────────┴────────┴─────────────────────────────────────────╯
```

## Source Create Azure

`hava create source azure --name AzureDev --client-id $ARM_CLIENT_ID --tenant-id $ARM_TENANT_ID --subscription-id $ARM_SUBSCRIPTION_ID`


## Source Delete

`hava source delete 22872411-20e8-4b6e-aa46-41866c9c1897`

![hava_delete_sources](./images/hava_source_delete.cast.gif)


## Source Update AWS|AZURE|GCP

`hava source update gcp --name GCPDevChange --source-id f2a26440-10bf-43d1-9742-8361de30590f`

65 changes: 65 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
## Usage
- [Usage](#usage)
- [Print hava CLI help](#print-hava-cli-help)
- [Create and List Sources](#create-and-list-sources)
- [CLI JSON Output](#cli-json-output)
- [Sync Sources](#sync-sources)
- [Delete Sources](#delete-sources)
- [CLI Completion Setup](#cli-completion-setup)
- [CLI Interactive Config Setup](#cli-interactive-config-setup)

### Print hava CLI help

![print help](./images/hava_help.cast.gif)


`hava -h`

```bash
A CLI to interface with the Hava platform.

Hava CLI empowers engineers the ability to automate and interact
with the Hava platform.

Usage:
hava [command]

Available Commands:
completion Generate the autocompletion script for the specified shell
help Help about any command
source Create/List/Delete/Update sources to Hava

Flags:
--autoapprove Auto approve the hava command. --autoapprove, false by default
-h, --help help for hava
-v, --version version for hava

Use "hava [command] --help" for more information about a command.
```

### Create and List Sources

![hava_create_list](./images/hava_create_list_sources.cast.gif)

### CLI JSON Output

![hava_json_out](./images/hava_CLI_json_output.cast.gif)


### Sync Sources

![hava_print_source](./images/hava_source_sync.cast.gif)

### Delete Sources

![hava_delete_sources](./images/hava_source_delete.cast.gif)

### CLI Completion Setup

![hava_cli_completion](./images/hava_cli_completion.cast.gif)

### CLI Interactive Config Setup

The following will trigger when no `HAVA_TOKEN` found as an environment variable AND Config file found AND `AUTOMATION=1` is not set.

![hava_config_setup](./images/hava_config_setup.cast.gif)

0 comments on commit a9fc197

Please sign in to comment.