Skip to content

Commit

Permalink
Merge branch 'main' into lh/notarization-setup
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopalet committed Feb 5, 2024
2 parents cb666ee + 4897784 commit fe95234
Show file tree
Hide file tree
Showing 208 changed files with 5,519 additions and 379 deletions.
13 changes: 9 additions & 4 deletions CONTRIBUTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ Your contribution is welcome! Thank you for your interest in contributing to the

## Developer Guide

Prerequisites:

- [`Go`](https://go.dev/doc/install) 1.21+
- [`yamllint`](https://yamllint.readthedocs.io/en/stable/quickstart.html)

### Repository structure

The CLI commands are located under `internal/cmd`, where each folder includes the source code for a `group` of commands. Inside `pkg` you can find several useful packages that are shared by the commands and provide additional functionality such as `flags`, `globalflags`, `tables`, etc.
Expand All @@ -23,9 +28,9 @@ Check the [Authentication](README.md#authentication) section on the README.
These commands can be executed from the project root:

- `make project-tools`: install the required dependencies
- `make build`: compiles the CLI and saves the binary under _./bin/stackit_
- `make lint`: lint the code and examples
- `make generate-docs`: generates Markdown documentation for every command
- `make build`: compile the CLI and save the binary under _./bin/stackit_
- `make lint`: lint the code
- `make generate-docs`: generate Markdown documentation for every command
- `make test`: run unit tests

#### Local development
Expand Down Expand Up @@ -54,7 +59,7 @@ To test your changes, you can either:

To make your contribution, follow these steps:

1. Check open or recently closed [Pull Requests](https://github.com/stackitcloud/stackit-cli/pulls) and [Issues](https://github.com/stackitcloud/stackit-cli/issues)to make sure the contribution you are making has not been already tackled by someone else.
1. Check open or recently closed [Pull Requests](https://github.com/stackitcloud/stackit-cli/pulls) and [Issues](https://github.com/stackitcloud/stackit-cli/issues) to make sure the contribution you are making has not been already tackled by someone else.
2. Fork the repo.
3. Make your changes in a branch that is up-to-date with the original repo's `main` branch.
4. Commit your changes including a descriptive message
Expand Down
44 changes: 28 additions & 16 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Installation

## macOS
## Package managers

The STACKIT CLI is available to download and install through the [Homebrew](https://brew.sh/) package manager.
### macOS

The STACKIT CLI can be installed through the [Homebrew](https://brew.sh/) package manager.

1. First, you need to register the [STACKIT tap](https://github.com/stackitcloud/homebrew-tap) via:

Expand All @@ -13,44 +15,54 @@ brew tap stackitcloud/tap
2. You can then install the CLI via:

```shell
brew install stackit-cli
brew install stackit
```

## Linux
### Linux

We will soon distribute the STACKIT CLI via [Snap](https://snapcraft.io/). For the moment, you can either install via [Homebrew](https://brew.sh/) or refer to the [manual installation](#manual-installation) guide.
We are working on distributing the CLI using a package manager for Linux. For the moment, you can either install via [Homebrew](https://brew.sh/) or refer to the [manual installation](#manual-installation) guide.

## Windows
### Windows

We will soon distribute the STACKIT CLI via [Chocolatey](https://chocolatey.org/). For the moment, please refer to the [manual installation](#manual-installation) guide.
We are working on distributing the CLI using a package manager for Windows. For the moment, please refer to the [manual installation](#manual-installation) guide.

## Manual installation

Alternatively, you can get the STACKIT CLI by downloading a pre-compiled binary or compiling it from source.
You can also get the STACKIT CLI by compiling it from source or downloading a pre-compiled binary.

### Pre-compiled binary
### Compile from source

1. Download the binary corresponding to your operating system and CPU architecture from our [Releases](https://github.com/stackitcloud/stackit-cli/releases) page
2. Extract the contents of the file to your file system and move it to your preferred location (e.g. your home directory)
3. (For macOS only) Right click on the executable, select "Open". You will see a dialog stating the identity of the developer cannot be confirmed. Click on "Open" to allow the app to run on your Mac. We soon plan to certificate the STACKIT CLI to be trusted by macOS
If you have Go 1.16+ installed, you can directly install via:

### Compile from source
```shell
go install github.com/stackitcloud/stackit-cli@latest
```

> For more information, please refer to the [`go install` documentation](https://go.dev/ref/mod#go-install)
Alternativelly, you can:

1. Clone the repository
2. Build the application locally by running:

```bash
$ make build
make build
```

To use the application from the root of the repository, you can run:

```bash
$ ./bin/stackit <GROUP> <SUB-GROUP> <COMMAND> <ARGUMENT> <FLAGS>
./bin/stackit <GROUP> <SUB-GROUP> <COMMAND> <ARGUMENT> <FLAGS>
```

3. Skip building and run the Go application directly using:

```bash
$ go run . <GROUP> <SUB-GROUP> <COMMAND> <ARGUMENT> <FLAGS>
go run . <GROUP> <SUB-GROUP> <COMMAND> <ARGUMENT> <FLAGS>
```

### Pre-compiled binary

1. Download the binary corresponding to your operating system and CPU architecture from our [Releases](https://github.com/stackitcloud/stackit-cli/releases) page
2. Extract the contents of the file to your file system and move it to your preferred location (e.g. your home directory)
3. (For macOS only) Right click on the executable, select "Open". You will see a dialog stating the identity of the developer cannot be confirmed. Click on "Open" to allow the app to run on your Mac. We soon plan to certificate the STACKIT CLI to be trusted by macOS
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ After successful authentication, the CLI stores credentials in your OS keychain.
To authenticate as a user, run the command below and follow the steps in your browser.

```bash
$ stackit auth login
stackit auth login
```

### Activate a service account

To authenticate using a service account, run:

```bash
$ stackit auth activate-service-account
stackit auth activate-service-account
```

For more details on how to setup authentication using a service account, check our [authentication guide](./AUTHENTICATION.md).
Expand All @@ -94,27 +94,27 @@ For more details on how to setup authentication using a service account, check o
You can configure the CLI using the command:

```bash
$ stackit config
stackit config
```

The configurations are stored in `~/stackit/cli-config.json` and are valid for all commands. For example, you can set a default `project-id` by running:

```bash
$ stackit config set --project-id xxxx-xxxx-xxxxx
stackit config set --project-id xxxx-xxxx-xxxxx
```

To remove it, you can run:

```bash
$ stackit config unset --project-id
stackit config unset --project-id
```

Run the `config set` command with the flag `--help` to get a list of all of the available configuration options.

You can lookup your current configuration by checking the configuration file or by running:

```bash
$ stackit config list
stackit config list
```

You can also edit the configuration file manually.
Expand Down
9 changes: 8 additions & 1 deletion docs/stackit.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

Manage STACKIT resources using the command line

### Synopsis

Manage STACKIT resources using the command line.
This CLI is in a BETA state.
More services and functionality will be supported soon. Your feedback is appreciated!

```
stackit [flags]
```
Expand All @@ -21,9 +27,10 @@ stackit [flags]

* [stackit auth](./stackit_auth.md) - Provides authentication functionality
* [stackit config](./stackit_config.md) - CLI configuration options
* [stackit curl](./stackit_curl.md) - Execute an authenticated HTTP request to an endpoint
* [stackit curl](./stackit_curl.md) - Executes an authenticated HTTP request to an endpoint
* [stackit dns](./stackit_dns.md) - Provides functionality for DNS
* [stackit mongodbflex](./stackit_mongodbflex.md) - Provides functionality for MongoDB Flex
* [stackit opensearch](./stackit_opensearch.md) - Provides functionality for OpenSearch
* [stackit organization](./stackit_organization.md) - Provides functionality regarding organizations
* [stackit project](./stackit_project.md) - Provides functionality regarding projects
* [stackit service-account](./stackit_service-account.md) - Provides functionality for service accounts
Expand Down
6 changes: 3 additions & 3 deletions docs/stackit_auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Provides authentication functionality

### Synopsis

Provides authentication functionality
Provides authentication functionality.

```
stackit auth [flags]
Expand All @@ -28,6 +28,6 @@ stackit auth [flags]
### SEE ALSO

* [stackit](./stackit.md) - Manage STACKIT resources using the command line
* [stackit auth activate-service-account](./stackit_auth_activate-service-account.md) - Activate service account authentication
* [stackit auth login](./stackit_auth_login.md) - Login to the STACKIT CLI
* [stackit auth activate-service-account](./stackit_auth_activate-service-account.md) - Authenticates using a service account
* [stackit auth login](./stackit_auth_login.md) - Logs in to the STACKIT CLI

4 changes: 2 additions & 2 deletions docs/stackit_auth_activate-service-account.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## stackit auth activate-service-account

Activate service account authentication
Authenticates using a service account

### Synopsis

Activate authentication using service account credentials.
Authenticates to the CLI using service account credentials.
Subsequent commands will be authenticated using the service account credentials provided.
For more details on how to configure your service account, check our Authentication guide at https://github.com/stackitcloud/stackit-cli/blob/main/AUTHENTICATION.md.

Expand Down
4 changes: 2 additions & 2 deletions docs/stackit_auth_login.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## stackit auth login

Login to the STACKIT CLI
Logs in to the STACKIT CLI

### Synopsis

Login to the STACKIT CLI
Logs in to the STACKIT CLI using a user account.

```
stackit auth login [flags]
Expand Down
8 changes: 4 additions & 4 deletions docs/stackit_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CLI configuration options

### Synopsis

CLI configuration options
CLI configuration options.

```
stackit config [flags]
Expand All @@ -28,7 +28,7 @@ stackit config [flags]
### SEE ALSO

* [stackit](./stackit.md) - Manage STACKIT resources using the command line
* [stackit config list](./stackit_config_list.md) - List the current CLI configuration values
* [stackit config set](./stackit_config_set.md) - Set CLI configuration options
* [stackit config unset](./stackit_config_unset.md) - Unset CLI configuration options
* [stackit config list](./stackit_config_list.md) - Lists the current CLI configuration values
* [stackit config set](./stackit_config_set.md) - Sets CLI configuration options
* [stackit config unset](./stackit_config_unset.md) - Unsets CLI configuration options

4 changes: 2 additions & 2 deletions docs/stackit_config_list.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## stackit config list

List the current CLI configuration values
Lists the current CLI configuration values

### Synopsis

List the current CLI configuration values
Lists the current CLI configuration values.

```
stackit config list [flags]
Expand Down
9 changes: 5 additions & 4 deletions docs/stackit_config_set.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
## stackit config set

Set CLI configuration options
Sets CLI configuration options

### Synopsis

Set CLI configuration options.
All of the configuration options can be set using an environment variable, which takes precedence over what is configured.
Sets CLI configuration options.
All of the configuration options can be set using an environment variable, which takes precedence over what is configured.
The environment variable is the name of the flag, with underscores ("_") instead of dashes ("-") and the "STACKIT" prefix.
Example: to set the project ID you can set the environment variable STACKIT_PROJECT_ID
Example: to set the project ID you can set the environment variable STACKIT_PROJECT_ID.

```
stackit config set [flags]
Expand All @@ -33,6 +33,7 @@ stackit config set [flags]
-h, --help Help for "stackit config set"
--membership-custom-endpoint string Membership custom endpoint
--mongodbflex-custom-endpoint string MongoDB Flex custom endpoint
--opensearch-custom-endpoint string OpenSearch custom endpoint
--resource-manager-custom-endpoint string Resource manager custom endpoint
--service-account-custom-endpoint string Service Account custom endpoint
--session-time-limit string Maximum time before authentication is required again. Can't be larger than 24h. Examples: 3h, 5h30m40s (BETA: currently values greater than 2h have no effect)
Expand Down
5 changes: 3 additions & 2 deletions docs/stackit_config_unset.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## stackit config unset

Unset CLI configuration options
Unsets CLI configuration options

### Synopsis

Unset CLI configuration options
Unsets CLI configuration options.

```
stackit config unset [flags]
Expand All @@ -31,6 +31,7 @@ stackit config unset [flags]
-h, --help Help for "stackit config unset"
--membership-custom-endpoint Membership custom endpoint
--mongodbflex-custom-endpoint MongoDB Flex custom endpoint
--opensearch-custom-endpoint OpenSearch custom endpoint
--output-format Output format
--project-id Project ID
--resource-manager-custom-endpoint Resource Manager custom endpoint
Expand Down
4 changes: 2 additions & 2 deletions docs/stackit_curl.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## stackit curl

Execute an authenticated HTTP request to an endpoint
Executes an authenticated HTTP request to an endpoint

### Synopsis

Execute an HTTP request to an endpoint, using the authentication provided by the CLI
Executes an HTTP request to an endpoint, using the authentication provided by the CLI.

```
stackit curl URL [flags]
Expand Down
2 changes: 1 addition & 1 deletion docs/stackit_dns.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Provides functionality for DNS

### Synopsis

Provides functionality for DNS
Provides functionality for DNS.

```
stackit dns [flags]
Expand Down
6 changes: 3 additions & 3 deletions docs/stackit_dns_record-set.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Provides functionality for DNS record set

### Synopsis

Provides functionality for DNS record set
Provides functionality for DNS record set.

```
stackit dns record-set [flags]
Expand All @@ -29,8 +29,8 @@ stackit dns record-set [flags]

* [stackit dns](./stackit_dns.md) - Provides functionality for DNS
* [stackit dns record-set create](./stackit_dns_record-set_create.md) - Creates a DNS record set
* [stackit dns record-set delete](./stackit_dns_record-set_delete.md) - Delete a DNS record set
* [stackit dns record-set describe](./stackit_dns_record-set_describe.md) - Get details of a DNS record set
* [stackit dns record-set delete](./stackit_dns_record-set_delete.md) - Deletes a DNS record set
* [stackit dns record-set describe](./stackit_dns_record-set_describe.md) - Shows details of a DNS record set
* [stackit dns record-set list](./stackit_dns_record-set_list.md) - List DNS record sets
* [stackit dns record-set update](./stackit_dns_record-set_update.md) - Updates a DNS record set

2 changes: 1 addition & 1 deletion docs/stackit_dns_record-set_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Creates a DNS record set

### Synopsis

Creates a DNS record set
Creates a DNS record set.

```
stackit dns record-set create [flags]
Expand Down
4 changes: 2 additions & 2 deletions docs/stackit_dns_record-set_delete.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## stackit dns record-set delete

Delete a DNS record set
Deletes a DNS record set

### Synopsis

Delete a DNS record set
Deletes a DNS record set.

```
stackit dns record-set delete RECORD_SET_ID [flags]
Expand Down
4 changes: 2 additions & 2 deletions docs/stackit_dns_record-set_describe.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## stackit dns record-set describe

Get details of a DNS record set
Shows details of a DNS record set

### Synopsis

Get details of a DNS record set
Shows details of a DNS record set.

```
stackit dns record-set describe RECORD_SET_ID [flags]
Expand Down
Loading

0 comments on commit fe95234

Please sign in to comment.