Docs: updated cmd to build docs locally to generate docs prior to building site. (#28371)

* added instructions so we generate docs prior to building them.

* replaced ci script.

* improved according to feedback.
This commit is contained in:
Marcus Andersson 2020-10-22 09:57:56 +02:00 committed by GitHub
parent 2aafa39879
commit 0bb33839f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 6 deletions

3
.gitignore vendored
View File

@ -118,3 +118,6 @@ compilation-stats.json
# report dumping the whole system env
/report.*.json
# auto generated front end docs
/docs/sources/packages_api/*

View File

@ -1,14 +1,23 @@
.PHONY: docs docs-test
.PHONY: docs docs-test docs-no-pull docs-generate-frontend docs-no-generate-frontend
IMAGE = grafana/docs-base:latest
docs:
docker pull ${IMAGE}
docs-generate-frontend:
yarn install --pure-lockfile
yarn run packages:build
yarn run packages:docsExtract
yarn run packages:docsToMarkdown
yarn run packages:clean
docs-no-generate-frontend:
docker run -v $(shell pwd)/sources:/hugo/content/docs/grafana/latest -p 3002:3002 --rm -it $(IMAGE) /bin/bash -c 'make server'
docs-no-pull:
docs: docs-generate-frontend
docker pull $(IMAGE)
docker run -v $(shell pwd)/sources:/hugo/content/docs/grafana/latest -p 3002:3002 --rm -it $(IMAGE) /bin/bash -c 'make server'
docs-test:
docker pull ${IMAGE}
docs-no-pull: docs-generate-frontend docs-no-generate-frontend
docs-test: docs-generate-frontend
docker pull $(IMAGE)
docker run -v $(shell pwd)/sources:/hugo/content/docs/grafana/latest --rm -it $(IMAGE) /bin/bash -c 'make prod'

View File

@ -5,6 +5,7 @@ When you contribute to documentation, it is a good practice to build the docs on
## Requirements
Docker >= 2.1.0.3
Yarn >= 1.22.4
## Build the doc site