mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
docs: updated make file for docs to support specifying env and version
This commit is contained in:
parent
f5a6c306a6
commit
24e3777894
@ -1,4 +1,4 @@
|
||||
.PHONY: all default docs docs-build docs-shell shell test
|
||||
.PHONY: all default docs docs-build docs-shell shell checkvars
|
||||
|
||||
# to allow `make DOCSPORT=9000 docs`
|
||||
DOCSPORT := 3004
|
||||
@ -11,26 +11,24 @@ DOCS_MOUNT := -v $(SOURCES_HOST_DIR):/site/content
|
||||
|
||||
DOCKER_RUN_DOCS := docker run --rm -it $(DOCS_MOUNT) -e NOCACHE -p 3004:3004 -p 3005:3005
|
||||
|
||||
VERSION = "root"
|
||||
|
||||
$(info publishing $(VERSION))
|
||||
VERSION := $(shell head -n 1 VERSION)
|
||||
|
||||
default: docs
|
||||
|
||||
checkvars:
|
||||
ifndef ENV
|
||||
$(error ENV is undefined set via ENV=staging or ENV=prod as argument to make)
|
||||
endif
|
||||
|
||||
docs: docs-build
|
||||
$(DOCKER_RUN_DOCS) $(DOCS_MOUNT) -e DOCKERHOST "$(DOCKER_DOCS_IMAGE)" /bin/bash -c "grunt --env=dev-docs && grunt connect --port=3004"
|
||||
|
||||
test: docs-build
|
||||
$(DOCKER_RUN_DOCS) $(DOCS_MOUNT) -e DOCKERHOST "$(DOCKER_DOCS_IMAGE)" /bin/bash -c "ls -la /site/content"
|
||||
|
||||
docs-watch: docs-build
|
||||
watch: docs-build
|
||||
$(DOCKER_RUN_DOCS) $(DOCS_MOUNT) -e DOCKERHOST "$(DOCKER_DOCS_IMAGE)" /bin/bash -c "grunt --env=dev-docs && grunt connect --port=3004 & grunt watch --port=3004 --env=dev-docs"
|
||||
|
||||
publish: docs-build
|
||||
$(DOCKER_RUN_DOCS) $(DOCS_MOUNT) -e DOCKERHOST "$(DOCKER_DOCS_IMAGE)" /bin/bash -c "./publish.sh staging-docs ${VERSION}"
|
||||
|
||||
publish-prod: docs-build
|
||||
$(DOCKER_RUN_DOCS) $(DOCS_MOUNT) -e DOCKERHOST "$(DOCKER_DOCS_IMAGE)" /bin/bash -c "./publish.sh prod-docs ${VERSION}"
|
||||
publish: checkvars docs-build
|
||||
$(info Publishing ENV=${ENV} and VERSION=${VERSION})
|
||||
$(DOCKER_RUN_DOCS) $(DOCS_MOUNT) -e DOCKERHOST "$(DOCKER_DOCS_IMAGE)" /bin/bash -c "./publish.sh ${ENV}-docs ${VERSION}"
|
||||
|
||||
docs-build:
|
||||
docker build -t "$(DOCKER_DOCS_IMAGE)" --no-cache .
|
||||
|
@ -1 +1 @@
|
||||
3.1.0
|
||||
v4.2
|
||||
|
@ -13,5 +13,6 @@ Here you can find links to older versions of the documentation that might be bet
|
||||
of Grafana.
|
||||
|
||||
- [Latest](http://docs.grafana.org)
|
||||
- [Version 4.2](http://docs.grafana.org/v4.2)
|
||||
- [Version 3.1](http://docs.grafana.org/v3.1)
|
||||
- [Version 3.0](http://docs.grafana.org/v3.0)
|
||||
|
Loading…
Reference in New Issue
Block a user