Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/rgrupesh/website-karmada in…
Browse files Browse the repository at this point in the history
…to con-docs
  • Loading branch information
rgrupesh committed Feb 28, 2023
2 parents 9611325 + 602f6b0 commit bf3ed04
Show file tree
Hide file tree
Showing 3 changed files with 191 additions and 0 deletions.
95 changes: 95 additions & 0 deletions docs/developers/document-releasing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
title: Documentation Releasing
---

Every minor release will have a corresponding documentation release. This guide is an introduction of the whole release procedure.

## Keep Multilingual Documents in Sync(manually)

Sometimes contributors do not update the content of the documentation in all languages. Before releasing, ensure the multilingual documents are in sync.
This will be tracked by an issue. The issue should follow the format:

```
This issue is to track documents which needs to sync zh for release 1.x:
* #268
```

## Update Reference Documents(manually)

Before releasing, we need to update reference docs in the website, which includes CLI references and component references. The whole process is done by scripts automatically.
Follow these steps to update reference docs.

1. Clone `karmada-io/karmada` and `karmada-io/website` to the local environment. It's recommended to step up these two projects in the same folder.

```shell
$ git clone https://github.com/karmada-io/karmada.git
$ git clone https://github.com/karmada-io/website.git


$ tree -L 1
#.
#├── karmada
#├── website
```

2. Run generate command in karmada root dir.

```shell
cd karmada/
go run ./hack/tools/genkarmadactldocs/gen_karmadactl_docs.go ../website/docs/reference/karmadactl/karmadactl-commands/
go run ./hack/tools/genkarmadactldocs/gen_karmadactl_docs.go ../website/i18n/zh/docusaurus-plugin-content-docs/current/reference/karmadactl/karmadactl-commands/
```

Generate reference docs of each component one by one. Here we take `karmada-apiserver` as an example.
```shell
cd karmada/
go build ./hack/tools/gencomponentdocs/.
./hack/tools/gencomponentdocs/gencomponentdocs karmada-apiserver ../website/docs/reference/components/
./hack/tools/gencomponentdocs/gencomponentdocs karmada-apiserver ../website/i18n/zh/docusaurus-plugin-content-docs/current/reference/components/
```

## Setup release-1.x(manually)

1. Update versions.json

```shell
cd website/
vim versions.json

[
v1.5.0 # add a new version tag
v1.4.0
v1.3.0
]
```

2. Update versioned_docs

```shell
mkdir versioned_docs/version-v1.5.0
cp docs/* versioned_docs/version-v1.5.0/*
```

3. Update versioned_sidebars

```shell
cp versioned_sidebars/version-v1.4.0-sidebars.json versioned_sidebars/version-v1.5.0-sidebars.json
sed -i'' -e "s/version-v1.4.0/version-v1.5.0/g" versioned_sidebars/version-v1.5.0-sidebars.json
# update version-v1.5.0-sidebars.json based on sidebars.js
```

3. Update versioned_docs for zh

```shell
mkdir i18n/zh/docusaurus-plugin-content-docs/version-v1.5.0
cp i18n/zh/docusaurus-plugin-content-docs/current/* i18n/zh/docusaurus-plugin-content-docs/version-v1.5.0/*
```

4. Update versioned_sidebars for zh

```shell
cp i18n/zh/docusaurus-plugin-content-docs/current.json i18n/zh/docusaurus-plugin-content-docs/version-v1.5.0.json
sed -i'' -e "s/Next/v1.5.0/g" i18n/zh/docusaurus-plugin-content-docs/version-v1.5.0.json
```

## Check the difference of website and send a pull request(manually)
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
title: Documentation Releasing
---

Every minor release will have a corresponding documentation release. This guide is an introduction of the whole release procedure.

## Keep Multilingual Documents in Sync(manually)

Sometimes contributors do not update the content of the documentation in all languages. Before releasing, ensure the multilingual documents are in sync.
This will be tracked by an issue. The issue should follow the format:

```
This issue is to track documents which needs to sync zh for release 1.x:
* #268
```

## Update Reference Documents(manually)

Before releasing, we need to update reference docs in the website, which includes CLI references and component references. The whole process is done by scripts automatically.
Follow these steps to update reference docs.

1. Clone `karmada-io/karmada` and `karmada-io/website` to the local environment. It's recommended to step up these two projects in the same folder.

```shell
$ git clone https://github.com/karmada-io/karmada.git
$ git clone https://github.com/karmada-io/website.git


$ tree -L 1
#.
#├── karmada
#├── website
```

2. Run generate command in karmada root dir.

```shell
cd karmada/
go run ./hack/tools/genkarmadactldocs/gen_karmadactl_docs.go ../website/docs/reference/karmadactl/karmadactl-commands/
go run ./hack/tools/genkarmadactldocs/gen_karmadactl_docs.go ../website/i18n/zh/docusaurus-plugin-content-docs/current/reference/karmadactl/karmadactl-commands/
```

Generate reference docs of each component one by one. Here we take `karmada-apiserver` as an example.
```shell
cd karmada/
go build ./hack/tools/gencomponentdocs/.
./hack/tools/gencomponentdocs/gencomponentdocs karmada-apiserver ../website/docs/reference/components/
./hack/tools/gencomponentdocs/gencomponentdocs karmada-apiserver ../website/i18n/zh/docusaurus-plugin-content-docs/current/reference/components/
```

## Setup release-1.x(manually)

1. Update versions.json

```shell
cd website/
vim versions.json

[
v1.5.0 # add a new version tag
v1.4.0
v1.3.0
]
```

2. Update versioned_docs

```shell
mkdir versioned_docs/version-v1.5.0
cp docs/* versioned_docs/version-v1.5.0/*
```

3. Update versioned_sidebars

```shell
cp versioned_sidebars/version-v1.4.0-sidebars.json versioned_sidebars/version-v1.5.0-sidebars.json
sed -i'' -e "s/version-v1.4.0/version-v1.5.0/g" versioned_sidebars/version-v1.5.0-sidebars.json
# update version-v1.5.0-sidebars.json based on sidebars.js
```

3. Update versioned_docs for zh

```shell
mkdir i18n/zh/docusaurus-plugin-content-docs/version-v1.5.0
cp i18n/zh/docusaurus-plugin-content-docs/current/* i18n/zh/docusaurus-plugin-content-docs/version-v1.5.0/*
```

4. Update versioned_sidebars for zh

```shell
cp i18n/zh/docusaurus-plugin-content-docs/current.json i18n/zh/docusaurus-plugin-content-docs/version-v1.5.0.json
sed -i'' -e "s/Next/v1.5.0/g" i18n/zh/docusaurus-plugin-content-docs/version-v1.5.0.json
```

## Check the difference of website and send a pull request(manually)
1 change: 1 addition & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ module.exports = {
"developers/performance-test-setup-for-karmada",
"developers/releasing",
"developers/customize-karmada-scheduler",
"developers/document-releasing"
],
},
{
Expand Down

0 comments on commit bf3ed04

Please sign in to comment.