diff --git a/docs/Dockerfile b/docs/Dockerfile index 7652cbd3e3f..7aa9ff1ad6e 100644 --- a/docs/Dockerfile +++ b/docs/Dockerfile @@ -3,9 +3,9 @@ FROM grafana/docs-base:latest # to get the git info for this repo # COPY config.toml /site -RUN rm -rf /site/content/* +# RUN rm -rf /site/content/* -COPY ./sources /site/content/ +# COPY ./sources /site/content/docs/ COPY awsconfig /site diff --git a/docs/Makefile b/docs/Makefile index 718c4b52be7..d3268fc6873 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,50 +1,33 @@ .PHONY: all default docs docs-build docs-shell shell test -# to allow `make DOCSDIR=1 docs-shell` (to create a bind mount in docs) -DOCS_MOUNT := $(if $(DOCSDIR),-v $(CURDIR):/docs/content/grafana/) # to allow `make DOCSPORT=9000 docs` DOCSPORT := 3004 -# Get the IP ADDRESS -DOCKER_IP=$(shell python -c "import urlparse ; print urlparse.urlparse('$(DOCKER_HOST)').hostname or ''") -HUGO_BASE_URL=$(shell test -z "$(DOCKER_IP)" && echo localhost || echo "$(DOCKER_IP)") -HUGO_BIND_IP=0.0.0.0 - -GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null) -GIT_BRANCH_CLEAN := $(shell echo $(GIT_BRANCH) | sed -e "s/[^[:alnum:]]/-/g") DOCKER_DOCS_IMAGE := grafana/grafana-docs -DOCKER_RUN_DOCS := docker run --rm -it $(DOCS_MOUNT) -e AWS_S3_BUCKET -e NOCACHE SOURCES_HOST_DIR := "$(shell pwd)/sources" -# for some docs workarounds (see below in "docs-build" target) -GITCOMMIT := $(shell git rev-parse --short HEAD 2>/dev/null) +DOCS_MOUNT := -v $(SOURCES_HOST_DIR):/site/content/docs + +DOCKER_RUN_DOCS := docker run --rm -it $(DOCS_MOUNT) -e NOCACHE -p 3004:3004 -p 3005:3005 + default: docs docs: docs-build - $(DOCKER_RUN_DOCS) -p 3004:3004 -p 3005:3005 -e DOCKERHOST "$(DOCKER_DOCS_IMAGE)" /bin/bash -c "grunt && grunt connect --port=3004" - -docs-watch: docs-build - $(DOCKER_RUN_DOCS) -p 3004:3004 -p 3005:3005 -v $(SOURCES_HOST_DIR):/site/content -e DOCKERHOST "$(DOCKER_DOCS_IMAGE)" /bin/bash -c "grunt --env=dev-docs && grunt connect --port=3004 & grunt watch --port=3004 --env=dev-docs" - -docs-watch-mac: docs-build - $(DOCKER_RUN_DOCS) -p 3004:3004 -p 3005:3005 -v $(SOURCES_HOST_DIR):/site/content -e DOCKERHOST "$(DOCKER_DOCS_IMAGE)" /bin/bash -c "grunt --env=dev-docs-mac && grunt connect --port=3004 & grunt watch --port=3004 --env=dev-docs-mac" - -publish: docs-build - $(DOCKER_RUN_DOCS) "$(DOCKER_DOCS_IMAGE)" /bin/bash -c "./publish.sh staging-docs v3.1" - -publish-prod: docs-build - $(DOCKER_RUN_DOCS) "$(DOCKER_DOCS_IMAGE)" /bin/bash -c "./publish.sh prod-docs root" - -docs-draft: docs-build - $(DOCKER_RUN_DOCS) -p $(if $(DOCSPORT),$(DOCSPORT):)8000 -e DOCKERHOST "$(DOCKER_DOCS_IMAGE)" hugo server --buildDrafts="true" --port=$(DOCSPORT) --baseUrl=$(HUGO_BASE_URL) --bind=$(HUGO_BIND_IP) - -docs-shell: docs-build - $(DOCKER_RUN_DOCS) -p $(if $(DOCSPORT),$(DOCSPORT):)8000 "$(DOCKER_DOCS_IMAGE)" bash + $(DOCKER_RUN_DOCS) $(DOCS_MOUNT) -e DOCKERHOST "$(DOCKER_DOCS_IMAGE)" /bin/bash -c "grunt && grunt connect --port=3004" test: docs-build - $(DOCKER_RUN_DOCS) -p $(if $(DOCSPORT),$(DOCSPORT):)8000 "$(DOCKER_DOCS_IMAGE)" + $(DOCKER_RUN_DOCS) $(DOCS_MOUNT) -e DOCKERHOST "$(DOCKER_DOCS_IMAGE)" /bin/bash -c "ls -la /site/content/docs" + +docs-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 v3.1" + +publish-prod: docs-build + $(DOCKER_RUN_DOCS) $(DOCS_MOUNT) -e DOCKERHOST "$(DOCKER_DOCS_IMAGE)" /bin/bash -c "./publish.sh prod-docs root" docs-build: - docker build -t "$(DOCKER_DOCS_IMAGE)" . + docker build -t "$(DOCKER_DOCS_IMAGE)" --no-cache . diff --git a/docs/config.toml b/docs/config.toml deleted file mode 100644 index c8d093a81d7..00000000000 --- a/docs/config.toml +++ /dev/null @@ -1,70 +0,0 @@ -baseurl = "http://localhost:3002/" -languageCode = "en-us" -title = "Grafana Docs" -canonifyurls = false -relativeURLs = false -verbose = true -enableRobotsTXT = true -disableSitemap = false -disableRSS = true - -[[menu.top]] - name = "Docs" - url = "" - weight = 1 - -[[menu.top]] - name = "Community" - url = "/community" - weight = 2 - -[[menu.top]] - name = "Support" - url = "/support" - weight = 3 - -[[menu.top]] - name = "Plugins" - url = "https://grafana.net/plugins" - weight = 4 - -[[menu.top]] - name = "Dashboards" - url = "https://grafana.net/dashboards" - weight = 5 - -[[menu.top]] - name = "Hosting" - url = "/hosting" - weight = 6 - -[[menu.top]] - name = "Github" - url = "https://github.com/grafana/grafana" - weight = 7 - -## Main -[[menu.main]] - name = "Feature Gallery" - url = "/features" - weight = 1 - -[[menu.main]] - name = "Live Demo" - url = "http://play.grafana.org" - weight = 2 - -[[menu.main]] - name = "Download" - url = "/download" - weight = 3 - -[[menu.main]] - name = "Blog" - url = "/blog" - weight = 4 - - - - - diff --git a/docs/sources/administration/cli.md b/docs/sources/administration/cli.md index ebe910503aa..4f2bbde3606 100644 --- a/docs/sources/administration/cli.md +++ b/docs/sources/administration/cli.md @@ -17,7 +17,7 @@ executed on the same machine as grafana runs. The CLI helps you install, upgrade and manage your plugins on the same machine it CLI is running. You can find more information about how to install and manage your plugins at the -[plugin page]({{< relref "plugins/installation.md" >}}). +[plugin page]({{< relref "docs/plugins/installation.md" >}}). ## Admin diff --git a/docs/sources/alerting/rules.md b/docs/sources/alerting/rules.md index a2688de3100..aa38367b4aa 100644 --- a/docs/sources/alerting/rules.md +++ b/docs/sources/alerting/rules.md @@ -33,7 +33,7 @@ of core Grafana. Only some data soures are supported right now. They include `Gr ### Clustering We have not implemented clustering yet. So if you run multiple instances of grafana-server -you have to make sure [execute_alerts]({{< relref "installation/configuration.md#alerting" >}}) +you have to make sure [execute_alerts]({{< relref "docs/installation/configuration.md#alerting" >}}) is true on only one instance or otherwise you will get duplicated notifications.
diff --git a/docs/sources/guides/basic_concepts.md b/docs/sources/guides/basic_concepts.md index 112b004ec92..0411db6caf2 100644 --- a/docs/sources/guides/basic_concepts.md +++ b/docs/sources/guides/basic_concepts.md @@ -16,7 +16,7 @@ This document is a “bottom up” introduction to basic concepts in Grafana, an ### Data Source Grafana supports many different storage backends for your time series data (Data Source). Each Data Source has a specific Query Editor that is customized for the features and capabilities that the particular Data Source exposes. -The following datasources are officially supported: [Graphite]({{< relref "features/datasources/graphite.md" >}}), [InfluxDB]({{< relref "features/datasources/influxdb.md" >}}), [OpenTSDB]({{< relref "features/datasources/opentsdb.md" >}}), [Prometheus]({{< relref "features/datasources/prometheus.md" >}}), [Elasticsearch]({{< relref "features/datasources/elasticsearch.md" >}}), [CloudWatch]({{< relref "features/datasources/cloudwatch.md" >}}). +The following datasources are officially supported: [Graphite]({{< relref "docs/features/datasources/graphite.md" >}}), [InfluxDB]({{< relref "docs/features/datasources/influxdb.md" >}}), [OpenTSDB]({{< relref "docs/features/datasources/opentsdb.md" >}}), [Prometheus]({{< relref "docs/features/datasources/prometheus.md" >}}), [Elasticsearch]({{< relref "docs/features/datasources/elasticsearch.md" >}}), [CloudWatch]({{< relref "docs/features/datasources/cloudwatch.md" >}}). The query language and capabilities of each Data Source are obviously very different. You can combine data from multiple Data Sources onto a single Dashboard, but each Panel is tied to a specific Data Source that belongs to a particular Organization. diff --git a/docs/sources/index.md b/docs/sources/index.md index daf1bd34c36..ab2e0f882b8 100644 --- a/docs/sources/index.md +++ b/docs/sources/index.md @@ -24,27 +24,27 @@ other domains including industrial sensors, home automation, weather, and proces - [Installing using Provisioning (Chef, Puppet, Salt, Ansible, etc)](installation/provisioning) - [Nightly Builds](http://grafana.org/builds) -For other platforms Read the [build from source]({{< relref "project/building_from_source.md" >}}) +For other platforms Read the [build from source]({{< relref "docs/project/building_from_source.md" >}}) instructions for more information. ## Configuring Grafana The back-end web server has a number of configuration options. Go the -[Configuration](/installation/configuration) page for details on all +[Configuration]({{< relref "docs/installation/configuration.md" >}}) page for details on all those options. ## Getting started -- [Getting Started](guides/getting_started) -- [Basic Concepts](guides/basic_concepts) -- [Screencasts](tutorials/screencasts) +- [Getting Started]({{< relref "docs/guides/getting_started.md" >}}) +- [Basic Concepts]({{< relref "docs/guides/basic_concepts.md" >}}) +- [Screencasts]({{< relref "docs/tutorials/screencasts.md" >}}) ## Data sources guides -- [Graphite]({{< relref "features/datasources/graphite.md" >}}) -- [Elasticsearch]({{< relref "features/datasources/elasticsearch.md" >}}) -- [InfluxDB]({{< relref "features/datasources/influxdb.md" >}}) -- [OpenTSDB]({{< relref "features/datasources/opentsdb.md" >}}) +- [Graphite]({{< relref "docs/features/datasources/graphite.md" >}}) +- [Elasticsearch]({{< relref "docs/features/datasources/elasticsearch.md" >}}) +- [InfluxDB]({{< relref "docs/features/datasources/influxdb.md" >}}) +- [OpenTSDB]({{< relref "docs/features/datasources/opentsdb.md" >}}) diff --git a/docs/sources/installation/debian.md b/docs/sources/installation/debian.md index 9c6140c0c6d..7dd97e69810 100644 --- a/docs/sources/installation/debian.md +++ b/docs/sources/installation/debian.md @@ -114,10 +114,10 @@ those options. ### Adding data sources -- [Graphite]({{< relref "features/datasources/graphite.md" >}}) -- [InfluxDB]({{< relref "features/datasources/influxdb.md" >}}) -- [OpenTSDB]({{< relref "features/datasources/opentsdb.md" >}}) -- [Prometheus]({{< relref "features/datasources/prometheus.md" >}}) +- [Graphite]({{< relref "docs/features/datasources/graphite.md" >}}) +- [InfluxDB]({{< relref "docs/features/datasources/influxdb.md" >}}) +- [OpenTSDB]({{< relref "docs/features/datasources/opentsdb.md" >}}) +- [Prometheus]({{< relref "docs/features/datasources/prometheus.md" >}}) ## Installing from binary tar file diff --git a/docs/sources/installation/rpm.md b/docs/sources/installation/rpm.md index 63181fc535d..561cff69b46 100644 --- a/docs/sources/installation/rpm.md +++ b/docs/sources/installation/rpm.md @@ -121,10 +121,10 @@ those options. ### Adding data sources -- [Graphite]({{< relref "features/datasources/graphite.md" >}}) -- [InfluxDB]({{< relref "features/datasources/influxdb.md" >}}) -- [OpenTSDB]({{< relref "features/datasources/opentsdb.md" >}}) -- [Prometheus]({{< relref "features/datasources/prometheus.md" >}}) +- [Graphite]({{< relref "docs/features/datasources/graphite.md" >}}) +- [InfluxDB]({{< relref "docs/features/datasources/influxdb.md" >}}) +- [OpenTSDB]({{< relref "docs/features/datasources/opentsdb.md" >}}) +- [Prometheus]({{< relref "docs/features/datasources/prometheus.md" >}}) ### Server side image rendering diff --git a/docs/sources/plugins/development.md b/docs/sources/plugins/development.md index 9b2a3fb8668..edb959e97bc 100644 --- a/docs/sources/plugins/development.md +++ b/docs/sources/plugins/development.md @@ -40,7 +40,7 @@ and [apps](./apps.md) plugins in the documentation. There are three ways that you can start developing a Grafana plugin. 1. Setup a Grafana development environment. [(described here)](http://docs.grafana.org/project/building_from_source/) and place your plugin in the ```data/plugins``` folder. -2. Install Grafana and place your plugin in the plugins directory which is set in your [config file](../installation/configuration.md). By default this is `/var/lib/grafana/plugins` on Linux systems. +2. Install Grafana and place your plugin in the plugins directory which is set in your [config file]({{< relref "docs/installation/configuration.md" >}}). By default this is `/var/lib/grafana/plugins` on Linux systems. 3. Place your plugin directory anywhere you like and specify it grafana.ini. We encourage people to setup the full Grafana environment so that you can get inspiration from the rest of grafana code base.