Skip to content

Add new topic on setting up your environment for replicated #3351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions docs/partials/replicated-cli/_install-docker.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
:::note
For Windows users, Replicated recommends using Windows Subsystem for Linux (WSL2) and installing the Replicated using the Linux installations above. See [Linux / Windows Subsystem for Linux (WSL2)](#linux-wsl2).
:::

Installing in Docker environments requires that you set the `REPLICATED_API_TOKEN` environment variable to authorize the Replicated CLI with an API token. For more information, see [(Optional) Set Environment Variables](#env-var) below.

To install and run the latest Replicated CLI in Docker environments:

1. Generate a service account or user API token in the vendor portal. To create new releases, the token must have `Read/Write` access. See [Generating API Tokens](/vendor/replicated-api-tokens).

1. Get the latest Replicated CLI installation files from the [replicatedhq/replicated repository](https://github.com/replicatedhq/replicated/releases) on GitHub.

Download and install the files. For simplicity, the usage in the next step is represented assuming that the CLI is downloaded and installed to the desktop.

1. Authorize the Replicated CLI:

- Through a Docker container:

```shell
docker run \
-e REPLICATED_API_TOKEN=$TOKEN \
replicated/vendor-cli --help
```
Replace `TOKEN` with your API token.

- On Windows:

```dos
docker.exe run \
-e REPLICATED_API_TOKEN=%TOKEN% \
replicated/vendor-cli --help
```

Replace `TOKEN` with your API token.

For more information about the `docker run` command, see [docker run](https://docs.docker.com/engine/reference/commandline/run/) in the Docker documentation.
10 changes: 10 additions & 0 deletions docs/partials/replicated-cli/_install-linux.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Run the following command:

```shell
curl -Ls $(curl -s https://api.github.com/repos/replicatedhq/replicated/releases/latest \
| grep "browser_download_url.*linux_amd64.tar.gz" \
| cut -d : -f 2,3 \
| tr -d \") -o replicated.tar.gz
tar xf replicated.tar.gz replicated && rm replicated.tar.gz
mv replicated /usr/local/bin/replicated
```
18 changes: 18 additions & 0 deletions docs/partials/replicated-cli/_install-mac.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Run one of the following commands:

- With Brew:

```shell
brew install replicatedhq/replicated/cli
```

- Without Brew:

```shell
curl -Ls $(curl -s https://api.github.com/repos/replicatedhq/replicated/releases/latest \
| grep "browser_download_url.*darwin_all.tar.gz" \
| cut -d : -f 2,3 \
| tr -d \") -o replicated.tar.gz
tar xf replicated.tar.gz replicated && rm replicated.tar.gz
mv replicated /usr/local/bin/replicated
```
70 changes: 9 additions & 61 deletions docs/reference/replicated-cli-installing.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import Verify from "../partials/replicated-cli/_verify-install.mdx"
import InstallMac from "../partials/replicated-cli/_install-mac.mdx"
import InstallLinux from "../partials/replicated-cli/_install-linux.mdx"
import InstallDocker from "../partials/replicated-cli/_install-docker.mdx"
import Sudo from "../partials/replicated-cli/_sudo-install.mdx"
import Login from "../partials/replicated-cli/_login.mdx"
import Logout from "../partials/replicated-cli/_logout.mdx"
Expand Down Expand Up @@ -30,24 +33,7 @@ You can install and run the Replicated CLI in the following environments:

To install and run the latest Replicated CLI on MacOS:

1. Run one of the following commands:

- With Brew:

```shell
brew install replicatedhq/replicated/cli
```

- Without Brew:

```shell
curl -Ls $(curl -s https://api.github.com/repos/replicatedhq/replicated/releases/latest \
| grep "browser_download_url.*darwin_all.tar.gz" \
| cut -d : -f 2,3 \
| tr -d \") -o replicated.tar.gz
tar xf replicated.tar.gz replicated && rm replicated.tar.gz
mv replicated /usr/local/bin/replicated
```
1. <InstallMac/>

<Sudo/>

Expand All @@ -59,20 +45,13 @@ To install and run the latest Replicated CLI on MacOS:

1. <Logout/>

### Linux
### Linux / Windows Subsystem for Linux (WSL) {#linux-wsl2}

To install and run the latest Replicated CLI on Linux:
To install and run the latest Replicated CLI on Linux or Windows Subsystem for Linux (WSL):

1. Run the following command:
1. For Windows users, first install Linux on Windows using WSL2. See [How to install Linux on Windows with WSL](https://learn.microsoft.com/en-us/windows/wsl/install).

```shell
curl -Ls $(curl -s https://api.github.com/repos/replicatedhq/replicated/releases/latest \
| grep "browser_download_url.*linux_amd64.tar.gz" \
| cut -d : -f 2,3 \
| tr -d \") -o replicated.tar.gz
tar xf replicated.tar.gz replicated && rm replicated.tar.gz
mv replicated /usr/local/bin/replicated
```
1. <InstallLinux/>

<Sudo/>

Expand All @@ -86,38 +65,7 @@ To install and run the latest Replicated CLI on Linux:

### Docker / Windows

Installing in Docker environments requires that you set the `REPLICATED_API_TOKEN` environment variable to authorize the Replicated CLI with an API token. For more information, see [(Optional) Set Environment Variables](#env-var) below.

To install and run the latest Replicated CLI in Docker environments:

1. Generate a service account or user API token in the vendor portal. To create new releases, the token must have `Read/Write` access. See [Generating API Tokens](/vendor/replicated-api-tokens).

1. Get the latest Replicated CLI installation files from the [replicatedhq/replicated repository](https://github.com/replicatedhq/replicated/releases) on GitHub.

Download and install the files. For simplicity, the usage in the next step is represented assuming that the CLI is downloaded and installed to the desktop.

1. Authorize the Replicated CLI:

- Through a Docker container:

```shell
docker run \
-e REPLICATED_API_TOKEN=$TOKEN \
replicated/vendor-cli --help
```
Replace `TOKEN` with your API token.

- On Windows:

```dos
docker.exe run \
-e REPLICATED_API_TOKEN=%TOKEN% \
replicated/vendor-cli --help
```

Replace `TOKEN` with your API token.

For more information about the `docker run` command, see [docker run](https://docs.docker.com/engine/reference/commandline/run/) in the Docker documentation.
<InstallDocker/>

## (Optional) Set Environment Variables {#env-var}

Expand Down
Loading