Skip to content

refactor!: deprecate mirrors assets #429

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion docs/production-installation-using-helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ For more values and their usages, refer to [all values](https://github.com/chaos
Currently, the latest CustomResourceDefinition (CRD) is not applied during the Helm upgrading, which might cause errors. To avoid this situation, you can apply the latest CRD manually:

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/crd.yaml | kubectl create -f -`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/manifests/crd.yaml | kubectl create -f -`}
</PickVersion>

:::
Expand Down
12 changes: 6 additions & 6 deletions docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,27 +45,27 @@ To install Chaos Mesh in a test environment, run the following script:
]}>
<TabItem value="k8s">
<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash`}
</PickVersion>
</TabItem>
<TabItem value="kind">
<PickVersion>{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash -s -- --local kind`}</PickVersion>
<PickVersion>{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash -s -- --local kind`}</PickVersion>

If you want to specify a `kind` version, add the `--kind-version xx` parameter at the end of the script, for example:

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash -s -- --local kind --kind-version v0.20.0`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash -s -- --local kind --kind-version v0.20.0`}
</PickVersion>

</TabItem>
<TabItem value="k3s">
<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash -s -- --k3s`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash -s -- --k3s`}
</PickVersion>
</TabItem>
<TabItem value="microk8s">
<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash -s -- --microk8s`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash -s -- --microk8s`}
</PickVersion>
</TabItem>
</Tabs>
Expand All @@ -87,7 +87,7 @@ For more installation details, refer to the source code of the [`install.sh`](ht
To uninstall Chaos Mesh, execute the following command:

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash -s -- --template | kubectl delete -f -`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash -s -- --template | kubectl delete -f -`}
</PickVersion>

You can also delete the `chaos-mesh` namespace to directly uninstall Chaos Mesh:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ helm upgrade chaos-mesh chaos-mesh/chaos-mesh -n=chaos-mesh --set dashboard.crea
目前,Helm 在升级时不会应用最新的 CustomResourceDefinition (CRD),这可能会导致一些错误的发生。为了避免这种情况,请手动应用最新的 CRD:

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/crd.yaml | kubectl replace -f -`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/manifests/crd.yaml | kubectl replace -f -`}
</PickVersion>

:::
Expand Down
12 changes: 6 additions & 6 deletions i18n/zh/docusaurus-plugin-content-docs/current/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,33 +33,33 @@ import QuickRun from './common/\_quick-run.md'
要在试用环境中安装 Chaos Mesh,请运行以下脚本:

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash`}
</PickVersion>

:::note 注意

- 如果当前环境为 [kind](https://kind.sigs.k8s.io/),请在脚本后添加 `--local kind` 参数。

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash -s -- --local kind`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash -s -- --local kind`}
</PickVersion>

若需要指定 kind 版本,请在脚本后添加 `--kind-version xxx` 参数,如:

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash -s -- --local kind --kind-version v0.20.0`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash -s -- --local kind --kind-version v0.20.0`}
</PickVersion>

- 如果当前环境为 [K3s](https://k3s.io/),请在脚本后添加 `--k3s` 参数。

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash -s -- --k3s`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash -s -- --k3s`}
</PickVersion>

- 如果当前环境为 [Microk8s](https://microk8s.io/),请在脚本后添加 `--microk8s` 参数。

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash -s -- --microk8s`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash -s -- --microk8s`}
</PickVersion>

:::
Expand All @@ -81,7 +81,7 @@ import QuickRun from './common/\_quick-run.md'
如要卸载 Chaos Mesh,请执行以下命令:

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash -s -- --template | kubectl delete -f -`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash -s -- --template | kubectl delete -f -`}
</PickVersion>

也可以通过删除 `chaos-mesh` 命名空间直接卸载 Chaos Mesh:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ helm upgrade chaos-mesh chaos-mesh/chaos-mesh -n=chaos-mesh --set dashboard.crea
目前,Helm 在升级时不会应用最新的 CustomResourceDefinition (CRD),这可能会导致一些错误的发生。为了避免这种情况,请手动应用最新的 CRD:

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/crd.yaml | kubectl replace -f -`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/manifests/crd.yaml | kubectl replace -f -`}
</PickVersion>

:::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,33 +33,33 @@ import QuickRun from './common/\_quick-run.md'
要在试用环境中安装 Chaos Mesh,请运行以下脚本:

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash`}
</PickVersion>

:::note 注意

- 如果当前环境为 [kind](https://kind.sigs.k8s.io/),请在脚本后添加 `--local kind` 参数。

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash -s -- --local kind`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash -s -- --local kind`}
</PickVersion>

若需要指定 kind 版本,请在脚本后添加 `--kind-version xxx` 参数,如:

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash -s -- --local kind --kind-version v0.20.0`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash -s -- --local kind --kind-version v0.20.0`}
</PickVersion>

- 如果当前环境为 [K3s](https://k3s.io/),请在脚本后添加 `--k3s` 参数。

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash -s -- --k3s`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash -s -- --k3s`}
</PickVersion>

- 如果当前环境为 [Microk8s](https://microk8s.io/),请在脚本后添加 `--microk8s` 参数。

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash -s -- --microk8s`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash -s -- --microk8s`}
</PickVersion>

:::
Expand All @@ -81,7 +81,7 @@ import QuickRun from './common/\_quick-run.md'
如要卸载 Chaos Mesh,请执行以下命令:

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash -s -- --template | kubectl delete -f -`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash -s -- --template | kubectl delete -f -`}
</PickVersion>

也可以通过删除 `chaos-mesh` 命名空间直接卸载 Chaos Mesh:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ helm upgrade chaos-mesh chaos-mesh/chaos-mesh -n=chaos-mesh --set dashboard.crea
目前,Helm 在升级时不会应用最新的 CustomResourceDefinition (CRD),这可能会导致一些错误的发生。为了避免这种情况,请手动应用最新的 CRD:

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/crd.yaml | kubectl replace -f -`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/manifests/crd.yaml | kubectl replace -f -`}
</PickVersion>

:::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,33 +33,33 @@ import QuickRun from './common/\_quick-run.md'
要在试用环境中安装 Chaos Mesh,请运行以下脚本:

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash`}
</PickVersion>

:::note 注意

- 如果当前环境为 [kind](https://kind.sigs.k8s.io/),请在脚本后添加 `--local kind` 参数。

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash -s -- --local kind`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash -s -- --local kind`}
</PickVersion>

若需要指定 kind 版本,请在脚本后添加 `--kind-version xxx` 参数,如:

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash -s -- --local kind --kind-version v0.20.0`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash -s -- --local kind --kind-version v0.20.0`}
</PickVersion>

- 如果当前环境为 [K3s](https://k3s.io/),请在脚本后添加 `--k3s` 参数。

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash -s -- --k3s`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash -s -- --k3s`}
</PickVersion>

- 如果当前环境为 [Microk8s](https://microk8s.io/),请在脚本后添加 `--microk8s` 参数。

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash -s -- --microk8s`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash -s -- --microk8s`}
</PickVersion>

:::
Expand All @@ -81,7 +81,7 @@ import QuickRun from './common/\_quick-run.md'
如要卸载 Chaos Mesh,请执行以下命令:

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash -s -- --template | kubectl delete -f -`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash -s -- --template | kubectl delete -f -`}
</PickVersion>

也可以通过删除 `chaos-mesh` 命名空间直接卸载 Chaos Mesh:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ helm upgrade chaos-mesh chaos-mesh/chaos-mesh -n=chaos-mesh --set dashboard.crea
目前,Helm 在升级时不会应用最新的 CustomResourceDefinition (CRD),这可能会导致一些错误的发生。为了避免这种情况,请手动应用最新的 CRD:

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/crd.yaml | kubectl replace -f -`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/manifests/crd.yaml | kubectl replace -f -`}
</PickVersion>

:::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,33 +33,33 @@ import QuickRun from './common/\_quick-run.md'
要在试用环境中安装 Chaos Mesh,请运行以下脚本:

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash`}
</PickVersion>

:::note 注意

- 如果当前环境为 [kind](https://kind.sigs.k8s.io/),请在脚本后添加 `--local kind` 参数。

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash -s -- --local kind`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash -s -- --local kind`}
</PickVersion>

若需要指定 kind 版本,请在脚本后添加 `--kind-version xxx` 参数,如:

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash -s -- --local kind --kind-version v0.20.0`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash -s -- --local kind --kind-version v0.20.0`}
</PickVersion>

- 如果当前环境为 [K3s](https://k3s.io/),请在脚本后添加 `--k3s` 参数。

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash -s -- --k3s`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash -s -- --k3s`}
</PickVersion>

- 如果当前环境为 [Microk8s](https://microk8s.io/),请在脚本后添加 `--microk8s` 参数。

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash -s -- --microk8s`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash -s -- --microk8s`}
</PickVersion>

:::
Expand All @@ -81,7 +81,7 @@ import QuickRun from './common/\_quick-run.md'
如要卸载 Chaos Mesh,请执行以下命令:

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash -s -- --template | kubectl delete -f -`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash -s -- --template | kubectl delete -f -`}
</PickVersion>

也可以通过删除 `chaos-mesh` 命名空间直接卸载 Chaos Mesh:
Expand Down
15 changes: 2 additions & 13 deletions src/components/PickVersion.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,10 @@ export const usePickVersion = (siteConfig, versions) => {
return activeVersion ? activeVersion.name : latestStableVersion.name
}

function versionToGitHubRef(version) {
return version === 'latest' ? 'refs/heads/master' : `refs/tags/v${version}`
}

const PickVersion = ({
children,
// `replaced` represent the string would be replaced in the original content.
replaced = 'latest',
// When `isArchive` is true, it would be replaced as patterns like `refs/heads/master` or `refs/tags/vX.Y.Z`.
// When `isArchive` is false, it would be replaced with `vX.Y.Z`.
isArchive = false,
replaced = 'refs/heads/master',
className = 'language-bash',
}) => {
const { siteConfig } = useDocusaurusContext()
Expand All @@ -48,11 +41,7 @@ const PickVersion = ({
<BrowserOnly>
{() => {
const version = usePickVersion(siteConfig, versions)
const rendered = isArchive
? children.replace(replaced, versionToGitHubRef(version))
: version === 'latest'
? children
: children.replace(replaced, 'v' + version)
const rendered = version === 'latest' ? children : children.replace(replaced, `refs/tags/v${version}`)

return <CodeBlock className={className}>{rendered}</CodeBlock>
}}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function Home() {
<Translate id="home.tryitout">Try it out with the following command 👇</Translate>
</h2>
<PickVersion className="!tw-mb-0">
curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash
curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash
</PickVersion>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ For more values and their usages, refer to [all values](https://github.com/chaos
Currently, the latest CustomResourceDefinition (CRD) is not applied during the Helm upgrading, which might cause errors. To avoid this situation, you can apply the latest CRD manually:

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/crd.yaml | kubectl create -f -`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/manifests/crd.yaml | kubectl create -f -`}
</PickVersion>

:::
Expand Down
12 changes: 6 additions & 6 deletions versioned_docs/version-2.5.2/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,27 +45,27 @@ To install Chaos Mesh in a test environment, run the following script:
]}>
<TabItem value="k8s">
<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash`}
</PickVersion>
</TabItem>
<TabItem value="kind">
<PickVersion>{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash -s -- --local kind`}</PickVersion>
<PickVersion>{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash -s -- --local kind`}</PickVersion>

If you want to specify a `kind` version, add the `--kind-version xx` parameter at the end of the script, for example:

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash -s -- --local kind --kind-version v0.20.0`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash -s -- --local kind --kind-version v0.20.0`}
</PickVersion>

</TabItem>
<TabItem value="k3s">
<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash -s -- --k3s`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash -s -- --k3s`}
</PickVersion>
</TabItem>
<TabItem value="microk8s">
<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash -s -- --microk8s`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash -s -- --microk8s`}
</PickVersion>
</TabItem>
</Tabs>
Expand All @@ -87,7 +87,7 @@ For more installation details, refer to the source code of the [`install.sh`](ht
To uninstall Chaos Mesh, execute the following command:

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash -s -- --template | kubectl delete -f -`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/install.sh | bash -s -- --template | kubectl delete -f -`}
</PickVersion>

You can also delete the `chaos-mesh` namespace to directly uninstall Chaos Mesh:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ For more values and their usages, refer to [all values](https://github.com/chaos
Currently, the latest CustomResourceDefinition (CRD) is not applied during the Helm upgrading, which might cause errors. To avoid this situation, you can apply the latest CRD manually:

<PickVersion>
{`curl -sSL https://mirrors.chaos-mesh.org/latest/crd.yaml | kubectl create -f -`}
{`curl -sSL https://github.com/chaos-mesh/chaos-mesh/raw/refs/heads/master/manifests/crd.yaml | kubectl create -f -`}
</PickVersion>

:::
Expand Down
Loading