Skip to content

Commit

Permalink
Add tables in doc files
Browse files Browse the repository at this point in the history
  • Loading branch information
carljavier committed Sep 11, 2023
1 parent c432e98 commit 75b2126
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 47 deletions.
96 changes: 50 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ Check out our [current roadmap and drivers](./ROADMAP.md) for Hava CLI.
- [Configuration File](#configuration-file)
- [Precedence](#precedence)
- [Running in Automation/CICD](#running-in-automationcicd)
- [Source Commands](#source-commands)
- [Source List all](#source-list-all)
- [Source Create AWS (Using Access Keys)](#source-create-aws-using-access-keys)
- [Output Formats](#output-formats)
- [Table Output](#table-output)
- [Json Output](#json-output)
- [Source Commands](#source-commands)
- [Source List all](#source-list-all)
- [Source Create AWS (Using Access Keys)](#source-create-aws-using-access-keys)
- [Build Local Binary](#build-local-binary)
- [Testing Locally](#testing-locally)

Expand Down Expand Up @@ -112,6 +112,8 @@ The config file can also be specified by using the `--config <filename>` flag as
hava --config <location-to-config-file> source list
```

If no environment variable or config file found AND not running in automation, user will be met with an [interactive configuration file setup](./docs/usage.md#cli-interactive-config-setup). setup.

### Precedence

`hava` CLI will use the following precedence when determining which variables to utilise:
Expand All @@ -126,7 +128,51 @@ When running `hava` CLI in automation or a CICD pipeline, we recommend export/se

Some commands do require human inputs or can be bypassed with a flag (eg `--autoapprove`).

Checkout our [Github CLI Test workflow](./docs/cicd-examples/github/workflows/cli-test.yml) and other [CICD examples](./docs/cicd-examples/README.md) for other platforms like Gitlab-CI and Azure DevOps.
Checkout our [Github CLI Test workflow](./.github/workflows/cli-test.yml) and other [CICD examples](./docs/cicd-examples/README.md) for other platforms like [Gitlab-CI](./docs/cicd-examples/gitlab/.gitlab-ci.yml) and [Azure DevOps](./docs/cicd-examples/azuredevops/azure-pipelines.yml).


## Output Formats

Table is the default format, however there are output formats of JSON (--json), CSV (--csv) , Markdown (--markdown) and HTML (--html)
See [output formats for more information](./docs/outputs-format.md).

### 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"
}
]
```

# Source Commands

Expand Down Expand Up @@ -181,48 +227,6 @@ Flags:
More [`hava source` commands found here](./docs/source_cmds.md).


## Output Formats

Table is the default format, however there are output formats of JSON (--json), CSV (--csv) , Markdown (--markdown) and HTML (--html)
See [output formats for more information](./docs/outputs-format.md).

### 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"
}
]
```

# Build Local Binary
`make local-build` will build a local binary
Expand Down
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
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
6 changes: 6 additions & 0 deletions docs/outputs-format.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## 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
Expand Down
14 changes: 14 additions & 0 deletions docs/source_cmds.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# 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
Expand Down Expand Up @@ -95,6 +107,8 @@ Flags:

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

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


## Source Update AWS|AZURE|GCP

Expand Down
10 changes: 10 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
## 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

Expand Down Expand Up @@ -52,4 +60,6 @@ Use "hava [command] --help" for more information about a command.

### 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 75b2126

Please sign in to comment.