Skip to content

Commit

Permalink
Build with local assets
Browse files Browse the repository at this point in the history
  • Loading branch information
feloy committed Aug 4, 2021
1 parent d531f1d commit ba8c8d4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@ clean-api-reference: ## Clean all directories in API reference directory, preser

api-reference: clean-api-reference ## Build the API reference pages. go needed
cd api-ref-generator/gen-resourcesdocs && \
go run cmd/main.go kwebsite --config-dir config/v1.21/ --file api/v1.21/swagger.json --output-dir ../../content/en/docs/reference/kubernetes-api --templates templates
go run cmd/main.go kwebsite --config-dir ../../api-ref-assets/config/ --file ../../api-ref-assets/api/swagger.json --output-dir ../../content/en/docs/reference/kubernetes-api --templates ../../api-ref-assets/templates
22 changes: 7 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,23 +73,15 @@ To update the reference pages for a new Kubernetes release (replace v1.20 in the
git submodule update --init --recursive --depth 1
```

2. Create a new API revision into the submodule, and add the Swagger specification:
2. Update the Swagger specification:

```bash
mkdir api-ref-generator/gen-resourcesdocs/api/v1.20
curl 'https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/openapi-spec/swagger.json' > api-ref-generator/gen-resourcesdocs/api/v1.20/swagger.json
```

3. Copy the table of contents and fields configuration for the new release from a previous one:

```bash
mkdir api-ref-generator/gen-resourcesdocs/api/v1.20
cp api-ref-generator/gen-resourcesdocs/api/v1.19/* api-ref-generator/gen-resourcesdocs/api/v1.20/
```
```
curl 'https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/openapi-spec/swagger.json' > api-ref-assets/api/swagger.json
```

4. Adapt the files `toc.yaml` and `fields.yaml` to reflect the changes between the two releases
3. In `api-ref-assets/config/`, adapt the files `toc.yaml` and `fields.yaml` to reflect the changes of the new release.

5. Next, build the pages:
4. Next, build the pages:

```bash
make api-reference
Expand All @@ -104,7 +96,7 @@ To update the reference pages for a new Kubernetes release (replace v1.20 in the

In a web browser, go to <http://localhost:1313/docs/reference/kubernetes-api/> to view the API reference.

6. When all changes of the new contract are reflected into the configuration files `toc.yaml` and `fields.yaml`, create a Pull Request with the newly generated API reference pages.
5. When all changes of the new contract are reflected into the configuration files `toc.yaml` and `fields.yaml`, create a Pull Request with the newly generated API reference pages.

## Troubleshooting

Expand Down

0 comments on commit ba8c8d4

Please sign in to comment.