Commit 24e37778 by Torkel Ödegaard

docs: updated make file for docs to support specifying env and version

parent f5a6c306
.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 .
......@@ -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)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment