Skip to content

Commit

Permalink
API Docs - Section - Introduction, Authentication & others (#858)
Browse files Browse the repository at this point in the history
* ci: add dev-only API generation

* ci: use the new rdme API v7.x

* doc: port content from readme to github

* doc: refactore logs.md

* doc: update Bearer Auth

* doc: add PMM server configuration page

* fix: typo in basic auth

* ci: add api version parameter

* fix: swagger validate typo
  • Loading branch information
Alex Tymchuk authored Apr 4, 2022
1 parent 304df07 commit 638c904
Show file tree
Hide file tree
Showing 10 changed files with 12,064 additions and 31 deletions.
29 changes: 19 additions & 10 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,30 @@ on:
push:
branches:
- main
workflow_dispatch:
inputs:
version:
description: "API Version on readme.io"
required: true
default: "v1.0" # v0.0 stands for the dev version

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: percona-platform/checkout@v2
- uses: percona-platform/github-readme-sync@v2
- uses: percona-platform/checkout@v3

- name: Sync GA API to Readme
uses: percona-platform/[email protected]
with:
readme-oas-key: ${{ secrets.README_TOKEN }}
rdme: openapi ./api/swagger/swagger.json --id=61deab764c98639400162c1b --key=${{ secrets.README_TOKEN }}

# OPTIONAL CONFIG, use if necessary
oas-file-path: "./api/swagger/swagger.json"
api-version: "v1.0.0" #TODO: get version from branch
- name: Sync non-GA API to Readme
uses: percona-platform/[email protected]
with:
rdme: openapi ./api/swagger/swagger-dev-only.json --id=6248ad743930240056ce27b6 --key=${{ secrets.README_TOKEN }}

- uses: percona-platform/setup-node@v2
- name: Upload markdown content
uses: percona-platform/[email protected]
with:
node-version: "14"
- run: npm install -g rdme
- run: rdme docs markdowns --version=v1.0.0 --key=${{ secrets.README_TOKEN }}
rdme: docs markdown --version=${{ github.event.inputs.version }} --key=${{ secrets.README_TOKEN }}
17 changes: 15 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ gen: clean ## Generate files.

bin/swagger-order --output=api/swagger/swagger.json api/swagger/swagger.json

# generate dev API spec with all PMM Server APIs (omit agentlocalpb)
# generate API spec with all PMM Server APIs (omit agentlocalpb)
bin/swagger mixin --output=api/swagger/swagger-dev.json \
api/swagger/header-dev.json \
api/serverpb/json/serverpb.json \
Expand All @@ -75,6 +75,19 @@ gen: clean ## Generate files.

bin/swagger-order --output=api/swagger/swagger-dev.json api/swagger/swagger-dev.json

# generate API spec with only dev PMM Server APIs specifically for readme.io (omit agentlocalpb)
bin/swagger mixin --output=api/swagger/swagger-dev-only.json \
api/swagger/header-dev.json \
api/managementpb/dbaas/json/dbaas.json \
api/managementpb/ia/json/ia.json \
api/managementpb/backup/json/backup.json \
api/managementpb/azure/json/azure.json \
api/qanpb/json/qanpb.json \
api/platformpb/json/platformpb.json
bin/swagger validate api/swagger/swagger-dev-only.json

bin/swagger-order --output=api/swagger/swagger-dev-only.json api/swagger/swagger-dev-only.json

make clean_swagger
go fmt ./...
bin/go-sumtype ./...
Expand All @@ -96,7 +109,7 @@ clean: clean_swagger ## Remove generated files.
for API in api/agentlocalpb api/serverpb api/inventorypb api/managementpb api/managementpb/dbaas api/managementpb/ia api/managementpb/backup api/qanpb api/platformpb ; do \
rm -fr $$API/json/client $$API/json/models $$API/json/$$(basename $$API).json ; \
done
rm -f api/swagger/swagger.json api/swagger/swagger-dev.json
rm -f api/swagger/swagger.json api/swagger/swagger-dev.json api/swagger/swagger-dev-only.json

test: ## Run tests
go test ./...
Expand Down
Loading

0 comments on commit 638c904

Please sign in to comment.