kibana/oas_docs/makefile
Jean-Louis Leysens b3d1d7a89c
[8.16] [OAS] Publish OAS bundles to bump.sh (#197482) (#200136)
# Backport

This will backport the following commits from `main` to `8.16`:
- [[OAS] Publish OAS bundles to bump.sh
(#197482)](https://github.com/elastic/kibana/pull/197482)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Jean-Louis
Leysens","email":"jeanlouis.leysens@elastic.co"},"sourceCommit":{"committedDate":"2024-11-14T08:15:47Z","message":"[OAS]
Publish OAS bundles to bump.sh (#197482)\n\n## Summary\r\n\r\nPublish
OAS docs to bump.sh on merge to `main` or `8.x`\r\n\r\n## To
reviewers\r\n* For now actual publication requires a manual step on
bump.sh (so\r\nthings aren't going live immediately)\r\n* Will get to
serverless OAS docs next!\r\n\r\n## Blockers\r\n\r\n* Address vulnerable
deps before
merging:\r\nhttps://github.com/bump-sh/cli/issues/583\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"8278b0650ad4bb35e1a702889afad1f96eae2cd6","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Feature:OAS","v8.16.0","backport:version","v8.17.0"],"number":197482,"url":"https://github.com/elastic/kibana/pull/197482","mergeCommit":{"message":"[OAS]
Publish OAS bundles to bump.sh (#197482)\n\n## Summary\r\n\r\nPublish
OAS docs to bump.sh on merge to `main` or `8.x`\r\n\r\n## To
reviewers\r\n* For now actual publication requires a manual step on
bump.sh (so\r\nthings aren't going live immediately)\r\n* Will get to
serverless OAS docs next!\r\n\r\n## Blockers\r\n\r\n* Address vulnerable
deps before
merging:\r\nhttps://github.com/bump-sh/cli/issues/583\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"8278b0650ad4bb35e1a702889afad1f96eae2cd6"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197482","number":197482,"mergeCommit":{"message":"[OAS]
Publish OAS bundles to bump.sh (#197482)\n\n## Summary\r\n\r\nPublish
OAS docs to bump.sh on merge to `main` or `8.x`\r\n\r\n## To
reviewers\r\n* For now actual publication requires a manual step on
bump.sh (so\r\nthings aren't going live immediately)\r\n* Will get to
serverless OAS docs next!\r\n\r\n## Blockers\r\n\r\n* Address vulnerable
deps before
merging:\r\nhttps://github.com/bump-sh/cli/issues/583\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"8278b0650ad4bb35e1a702889afad1f96eae2cd6"}},{"branch":"8.16","label":"v8.16.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.17.0","labelRegex":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Lisa Cawley <lcawley@elastic.co>
2024-11-27 15:58:38 +01:00

55 lines
No EOL
2.5 KiB
Makefile

# ELASTICSEARCH CONFIDENTIAL
# __________________
#
# Copyright Elasticsearch B.V. All rights reserved.
#
# NOTICE: All information contained herein is, and remains
# the property of Elasticsearch B.V. and its suppliers, if any.
# The intellectual and technical concepts contained herein
# are proprietary to Elasticsearch B.V. and its suppliers and
# may be covered by U.S. and Foreign Patents, patents in
# process, and are protected by trade secret or copyright
# law. Dissemination of this information or reproduction of
# this material is strictly forbidden unless prior written
# permission is obtained from Elasticsearch B.V.
.PHONY: api-docs
api-docs: ## Generate Serverless and ESS Kibana OpenAPI bundles
$(MAKE) merge-api-docs
$(MAKE) api-docs-overlay
.PHONY: merge-api-docs
merge-api-docs: ## Merge Serverless and ESS Kibana OpenAPI bundles with kbn-openapi-bundler
@node scripts/merge_ess_oas.js
.PHONY: merge-api-docs-stateful
merge-api-docs-stateful: ## Merge only kibana.yaml
@node scripts/merge_ess_oas.js
.PHONY: api-docs-lint
api-docs-lint: ## Run redocly API docs linter
@npx @redocly/cli lint "output/*.yaml" --config "linters/redocly.yaml" --format stylish --max-problems 500
.PHONY: api-docs-lint-stateful
api-docs-lint-stateful: ## Run redocly API docs linter on kibana.yaml
@npx @redocly/cli lint "output/kibana.yaml" --config "linters/redocly.yaml" --format stylish --max-problems 500
.PHONY: api-docs-overlay
api-docs-overlay: ## Apply all overlays
@npx bump-cli overlay "output/kibana.yaml" "overlays/kibana.overlays.yaml" > "output/kibana.tmp1.yaml"
@npx bump-cli overlay "output/kibana.tmp1.yaml" "overlays/alerting.overlays.yaml" > "output/kibana.tmp2.yaml"
@npx bump-cli overlay "output/kibana.tmp2.yaml" "overlays/connectors.overlays.yaml" > "output/kibana.tmp3.yaml"
@npx bump-cli overlay "output/kibana.tmp3.yaml" "overlays/kibana.overlays.shared.yaml" > "output/kibana.tmp4.yaml"
@npx @redocly/cli bundle output/kibana.tmp4.yaml --ext yaml -o output/kibana.yaml
rm output/kibana.tmp*.yaml
.PHONY: api-docs-preview
api-docs-preview: ## Generate a preview for kibana.yaml and kibana.serverless.yaml
@echo "Rendering stateful docs preview..."
@npx bump-cli preview "output/kibana.yaml"
help: ## Display help
@awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
#------------- <https://suva.sh/posts/well-documented-makefiles> --------------
.DEFAULT_GOAL := help