mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Docs: add test for website build (#21364)
* add build-docs-website job to circleci * update commands * update readme command * remove container when test finishes * move build-docs-website to build-branches-and-prs * update readme
This commit is contained in:
parent
45dc4a834e
commit
a6fac58088
@ -437,6 +437,40 @@ jobs:
|
||||
command: './scripts/ci-job-succeeded.sh'
|
||||
when: on_success
|
||||
|
||||
build-docs-website:
|
||||
docker:
|
||||
- image: grafana/build-container:1.2.13
|
||||
working_directory: /docs
|
||||
steps:
|
||||
- checkout
|
||||
- setup_remote_docker
|
||||
- run:
|
||||
name: ci job started
|
||||
command: './scripts/ci-job-started.sh'
|
||||
- run:
|
||||
name: install docker
|
||||
command: |
|
||||
apt-get update
|
||||
apt-get install -y docker.io
|
||||
- run:
|
||||
name: build grafana docs website
|
||||
command: |
|
||||
# https://circleci.com/docs/2.0/building-docker-images/#mounting-folders
|
||||
# create a dummy container which will hold a volume with config
|
||||
docker create -v /hugo/content/docs/grafana --name docs-website alpine:3.4 /bin/true
|
||||
# copy a config file into this volume
|
||||
docker cp ${PWD}/docs/sources docs-website:/hugo/content/docs/grafana/latest
|
||||
# start an application container using this volume
|
||||
docker run --volumes-from docs-website --rm -it grafana/docs-base:latest /bin/bash -c 'npm i && make prod'
|
||||
- run:
|
||||
name: ci job failed
|
||||
command: 'docker stop docs-website && docker rm docs-website && ./scripts/ci-job-failed.sh'
|
||||
when: on_fail
|
||||
- run:
|
||||
name: ci job succeeded
|
||||
command: 'docker stop docs-website && docker rm docs-website && ./scripts/ci-job-succeeded.sh'
|
||||
when: on_success
|
||||
|
||||
build-fast-package:
|
||||
docker:
|
||||
- image: grafana/build-container:1.2.13
|
||||
@ -1321,6 +1355,8 @@ workflows:
|
||||
- postgres-integration-test
|
||||
- cache-server-test
|
||||
filters: *filter-not-release-or-master
|
||||
- build-docs-website:
|
||||
filters: *filter-not-release-or-master
|
||||
nightly:
|
||||
triggers:
|
||||
- schedule:
|
||||
|
@ -1,5 +1,9 @@
|
||||
.PHONY: docs
|
||||
.PHONY: docs docs-test
|
||||
|
||||
docs:
|
||||
docker pull grafana/docs-base:latest
|
||||
docker run -v $(PWD)/sources:/hugo/content/docs/grafana/latest -p 3002:3002 --rm -it grafana/docs-base:latest
|
||||
docker run -v $(PWD)/sources:/hugo/content/docs/grafana/latest -p 3002:3002 --rm -it grafana/docs-base:latest /bin/bash -c 'npm i && make webpack && hugo server -p 3002 -D --ignoreCache --baseUrl http://localhost:3002 --bind 0.0.0.0'
|
||||
|
||||
docs-test:
|
||||
docker pull grafana/docs-base:latest
|
||||
docker run -v $(PWD)/sources:/hugo/content/docs/grafana/latest --rm -it grafana/docs-base:latest /bin/bash -c 'npm i && make prod'
|
@ -23,7 +23,7 @@ Use the Hugo shortcode [relref](https://gohugo.io/content-management/cross-refer
|
||||
|
||||
### Edit the side menu
|
||||
|
||||
Edit [sources/menu.yaml](sources/menu.yaml) to make changes to the sidebar. Restart the `make run` command for changes to take effect.
|
||||
Edit [sources/menu.yaml](sources/menu.yaml) to make changes to the sidebar. Stop and rerun the `make docs` command for changes to take effect.
|
||||
|
||||
### Add images
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user