Skip to content

Commit

Permalink
optimize docs: install latest sealos version (labring#3638)
Browse files Browse the repository at this point in the history
  • Loading branch information
bxy4543 authored Aug 6, 2023
1 parent 6ed0859 commit 1a0028d
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 12 deletions.
27 changes: 21 additions & 6 deletions docs/4.0/docs/lifecycle-management/quick-start/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,26 @@ import TabItem from '@theme/TabItem';

# Installing Sealos

You can get the list of versions by running:

```bash
curl --silent "https://api.github.com/repos/labring/sealos/releases" | jq -r '.[].tag_name'
```

Note: While choosing the version, it's recommended to use a stable version. The versions like `v4.3.0-rcx`, `v4.3.0-alpha1` are pre-releases, use them with caution.

Set the 'VERSION' environment variable to the latest VERSION number, or replace 'version' with the Sealos version you want to install:

```shell
VERSION=`curl -s https://api.github.com/repos/labring/sealos/releases/latest | grep -oE '"tag_name": "[^"]+"' | head -n1 | cut -d'"' -f4`
```

## Binary Auto Download

```bash
$ curl -sfL https://raw.githubusercontent.com/labring/sealos/v4.2.0/scripts/install.sh \
| sh -s v4.2.0 labring/sealos
curl -sfL https://raw.githubusercontent.com/labring/sealos/${VERSION}/scripts/install.sh |
sh - ${VERSION} labring/sealos

```

## Binary Manual Download
Expand All @@ -20,16 +35,16 @@ $ curl -sfL https://raw.githubusercontent.com/labring/sealos/v4.2.0/scripts/ins
<TabItem value="amd64" label="amd64" default>

```bash
$ wget https://github.com/labring/sealos/releases/download/v4.2.0/sealos_4.2.0_linux_amd64.tar.gz \
&& tar zxvf sealos_4.2.0_linux_amd64.tar.gz sealos && chmod +x sealos && mv sealos /usr/bin
$ wget https://github.com/labring/sealos/releases/download/${VERSION}/sealos_${VERSION#v}_linux_amd64.tar.gz \
&& tar zxvf sealos_${VERSION#v}_linux_amd64.tar.gz sealos && chmod +x sealos && mv sealos /usr/bin
```

</TabItem>
<TabItem value="arm64" label="arm64">

```bash
$ wget https://github.com/labring/sealos/releases/download/v4.2.0/sealos_4.2.0_linux_arm64.tar.gz \
&& tar zxvf sealos_4.2.0_linux_arm64.tar.gz sealos && chmod +x sealos && mv sealos /usr/bin
$ wget https://github.com/labring/sealos/releases/download/${VERSION}/sealos_${VERSION#v}_linux_arm64.tar.gz \
&& tar zxvf sealos_${VERSION#v}_linux_arm64.tar.gz sealos && chmod +x sealos && mv sealos /usr/bin
```

</TabItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,26 @@ import TabItem from '@theme/TabItem';

# 安装sealos

你可以通过运行命令来获取版本列表:

```shell
curl --silent "https://api.github.com/repos/labring/sealos/releases" | jq -r '.[].tag_name'
```

> 注意:在选择版本时,建议使用稳定版本例如`v4.3.0`。像`v4.3.0-rc1``v4.3.0-alpha1`这样的版本是预发布版,请谨慎使用。
设置`VERSION`环境变量为latest版本号,或者将`VERSION`替换为您要安装的Sealos版本:

```shell
VERSION=`curl -s https://api.github.com/repos/labring/sealos/releases/latest | grep -oE '"tag_name": "[^"]+"' | head -n1 | cut -d'"' -f4`
```

## 二进制自动下载

```bash
$ curl -sfL https://raw.githubusercontent.com/labring/sealos/v4.2.0/scripts/install.sh \
| sh -s v4.2.0 labring/sealos
curl -sfL https://raw.githubusercontent.com/labring/sealos/${VERSION}/scripts/install.sh |
sh - ${VERSION} labring/sealos

```

## 二进制手动下载
Expand All @@ -20,16 +35,16 @@ $ curl -sfL https://raw.githubusercontent.com/labring/sealos/v4.2.0/scripts/ins
<TabItem value="amd64" label="amd64" default>

```bash
$ wget https://github.com/labring/sealos/releases/download/v4.2.0/sealos_4.2.0_linux_amd64.tar.gz \
&& tar zxvf sealos_4.2.0_linux_amd64.tar.gz sealos && chmod +x sealos && mv sealos /usr/bin
$ wget https://github.com/labring/sealos/releases/download/${VERSION}/sealos_${VERSION#v}_linux_amd64.tar.gz \
&& tar zxvf sealos_${VERSION#v}_linux_amd64.tar.gz sealos && chmod +x sealos && mv sealos /usr/bin
```

</TabItem>
<TabItem value="arm64" label="arm64">

```bash
$ wget https://github.com/labring/sealos/releases/download/v4.2.0/sealos_4.2.0_linux_arm64.tar.gz \
&& tar zxvf sealos_4.2.0_linux_arm64.tar.gz sealos && chmod +x sealos && mv sealos /usr/bin
$ wget https://github.com/labring/sealos/releases/download/${VERSION}/sealos_${VERSION#v}_linux_arm64.tar.gz \
&& tar zxvf sealos_${VERSION#v}_linux_arm64.tar.gz sealos && chmod +x sealos && mv sealos /usr/bin
```

</TabItem>
Expand Down
4 changes: 4 additions & 0 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ verify_downloader() {

get_release_version() {
VERSION=$1
# If the incoming version number is latest, get the latest version number from github
if [ "$VERSION" = "latest" ]; then
VERSION=$(curl -s https://api.github.com/repos/${OWN_REPO}/releases/latest | grep tag_name | cut -d '"' -f 4)
fi
info "Using ${VERSION} as release"
OWN_REPO=$2
if [ -z "$OWN_REPO" ]; then
Expand Down

0 comments on commit 1a0028d

Please sign in to comment.