Skip to content

Commit

Permalink
Generate and deploy API documentation with UI (#357)
Browse files Browse the repository at this point in the history
* Add Redocly-CLI.

* Move spec.yaml into ui tree.

Generation of the API documentation has been moved to the UI build
process, so the spec file needs to be contained within the UI source
tree so the CI build can access it.

We add a symlink in the old location for convenience.

* Serve static API doc files.

* Add redocly-lint target.

* Clean generated API docs.

* Remove API docs generation.

This has been moved to the UI build process.

* Deploy api/index.html as api/.
  • Loading branch information
ZoogieZork authored Nov 14, 2024
1 parent 222c01b commit a2683ea
Show file tree
Hide file tree
Showing 10 changed files with 6,024 additions and 3,970 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,8 @@ engine/tests/data/auth.json
/ui/src/locale/_build/
/ui/src/locale/**/*.*js

# generated static files
/ui/public/api/

# linting
/ui/hadolint
16 changes: 1 addition & 15 deletions backend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ ifndef ANALYZER_DJANGO_SECRET_KEY
export ANALYZER_DB_PORT=5433
endif

SWAGGER_CODEGEN := swagger-codegen

# Lambdas
REPO_LAMBDA := ${PREFIX}-repo-handler
USERS_LAMBDA := ${PREFIX}-users-handler
Expand Down Expand Up @@ -336,17 +334,6 @@ artemis_scan:
$(CURDIR)/ci-tools/shell/artemis-scan.sh ${ARTEMIS_SCAN_ARGS} github ${REPO_NAME} ${BRANCH_NAME} ${SEVERITY_LEVELS}
.PHONY: artemis_scan

###############################################################################
# Documentation
###############################################################################

dist/api/index.html: lambdas/api/spec.yaml
@echo "${INFO}Building $@"
mkdir -p ${DIST_DIR}/api
mkdir -p ${BUILD_DIR}/api
${SWAGGER_CODEGEN} generate -i lambdas/api/spec.yaml -o ${DIST_DIR}/api -l html
@echo "${OK}"

###############################################################################
# Lambdas
###############################################################################
Expand Down Expand Up @@ -635,8 +622,7 @@ docker: dist/docker/engine \
build: ## Build all
build: lambdas \
docker \
dist/engine_scripts.zip \
dist/api/index.html
dist/engine_scripts.zip
.PHONY: build

###############################################################################
Expand Down
Loading

0 comments on commit a2683ea

Please sign in to comment.