Skip to content

Commit

Permalink
Took daft experiences into account (#8)
Browse files Browse the repository at this point in the history
Co-authored-by: INGE KNUDSEN <ingeknudsen@INGEs-MacBook-Pro.local>
  • Loading branch information
ingeknudsen and INGE KNUDSEN authored Mar 19, 2020
1 parent ce8ef77 commit 78a9536
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# radix-cli

NOTE: This project is currently a work in progress prototype

The command line interface for Radix, which is to enable users of Radix platform in automation around their application on the platform. This document is for developers of the Radix CLI, or anyone interested in poking around.

## Installation
Expand Down Expand Up @@ -81,7 +79,7 @@ docker run -it -v %HOME%:/home/radix-cli docker.pkg.github.com/equinor/radix-cli

## Modes of running

There are generally two modes of running the CLI:
There are generally two modes of running the CLI. Both cases may use configuration in your \$HOME/.radix folder:

### Interactively

Expand All @@ -91,15 +89,26 @@ CLI will use users privileges to access the Radix API server. Context informatio

### Using a machine user

CLI can also use a machine user for authenticating with the API server. This will be done through a bearer token of a service account connected to your application. The service account token will be provided to you under configuration page of your application. There are two ways to feed this token to the CLI. Either using standard input. The should be done like this:
CLI can also use a machine user for authenticating with the API server. This will be done through a bearer token of a service account connected to your application. The service account token will be provided to you under configuration page of your application. For more information on this see [this](https://www.radix.equinor.com/guides/deploy-only/#machine-user-token) guide. There are two ways to feed this token to the CLI. Either using standard input. The should be done like this:

`echo <your service account token> | rx --token-stdin list applications`

Alternatively, you can use an environment variable for the token:

```
export APP_SERVICE_ACCOUNT_TOKEN=<your service account token>
rx --token-environment list applications
rx --token-environment get application
```

Note that using your own token obtained through `az account get-access-token` may not work, because the size of the token may be too big.

## Problems encountered

Problem: Failed to acquire a token: refreshing the expired token: refreshing token: adal: Refresh request failed. Status Code = '400'
Solution: Remove your .radix folder

```
rm -rf $HOME/.radix/
```

## Development
Expand All @@ -118,6 +127,8 @@ Client code is generated from swagger contract definition of the latest contract
make generate-client
```

NOTE: If there is a change to the API, you make need to point to the API environment which holds the correct swagger definition.

### Building and releasing

We are making releases available as github releases using [go-releaser](https://goreleaser.com/). The release process is controlled by the .goreleaser.yml file. To make a release:
Expand All @@ -126,6 +137,12 @@ We are making releases available as github releases using [go-releaser](https://
make release VERSION=0.0.1 RELASE_NOTE="First release"
```

To generate a local version for debugging purposes, it can be built using:

```
CGO_ENABLED=0 GOOS=darwin go build -ldflags "-s -w" -a -installsuffix cgo -o ./rx
```

### Security

There is a app registration associated with the Radix CLI, `Omnia Radix CLI`, with API permissions to `Omnia Radix Web Console - Production Clusters` to allow for the device code flow when running in interactive mode

0 comments on commit 78a9536

Please sign in to comment.