From 8f150c67aa5b53f836427b335f77bc909d93580c Mon Sep 17 00:00:00 2001 From: Leonard Gram Date: Tue, 2 Jul 2019 09:43:25 +0200 Subject: [PATCH] Docs upgrading deps (#17657) * Docs: correct link to the Grafana build-container. * Docs: documents usage on the gopath when upgrading deps. * Dev docs: info for upgrading deps only in one location. --- UPGRADING_DEPENDENCIES.md | 18 +++++++++++++++--- pkg/README.md | 30 +----------------------------- 2 files changed, 16 insertions(+), 32 deletions(-) diff --git a/UPGRADING_DEPENDENCIES.md b/UPGRADING_DEPENDENCIES.md index 16e6ce9ad44..17321043426 100644 --- a/UPGRADING_DEPENDENCIES.md +++ b/UPGRADING_DEPENDENCIES.md @@ -22,18 +22,30 @@ The Grafana project uses [Go modules](https://golang.org/cmd/go/#hdr-Modules__mo All dependencies are vendored in the `vendor/` directory. +_Note:_ Since most developers of Grafana still use the `GOPATH` we need to specify `GO111MODULE=on` to make `go mod` and `got get` work as intended. If you have setup Grafana outside of the `GOPATH` on your machine you can skip `GO111MODULE=on` when running the commands below. + To add or update a new dependency, use the `go get` command: ```bash +# The GO111MODULE variable can be omitted when the code isn't located in GOPATH. # Pick the latest tagged release. -go get example.com/some/module/pkg +GO111MODULE=on go get example.com/some/module/pkg # Pick a specific version. -go get example.com/some/module/pkg@vX.Y.Z +GO111MODULE=on go get example.com/some/module/pkg@vX.Y.Z ``` Tidy up the `go.mod` and `go.sum` files and copy the new/updated dependency to the `vendor/` directory: +```bash +# The GO111MODULE variable can be omitted when the code isn't located in GOPATH. +GO111MODULE=on go mod tidy + +GO111MODULE=on go mod vendor +``` + +You have to commit the changes to `go.mod`, `go.sum` and the `vendor/` directory before submitting the pull request. + ## Node.js Dependencies Updated using `yarn`. @@ -60,7 +72,7 @@ Our builds run on CircleCI through our build script. The main build step (in CircleCI) is built using a custom build container that comes pre-baked with some of the necessary dependencies. -Link: [grafana-build-container](https://github.com/grafana/grafana-build-container) +Link: [grafana/build-container](https://github.com/grafana/grafana/tree/master/scripts/build/ci-build) #### Dependencies diff --git a/pkg/README.md b/pkg/README.md index bcf14b420b7..3226cec0563 100644 --- a/pkg/README.md +++ b/pkg/README.md @@ -34,32 +34,4 @@ Newly introduced date columns in the database should be stored as epochs if date # Dependency management -The Grafana project uses [Go modules](https://golang.org/cmd/go/#hdr-Modules__module_versions__and_more) to manage dependencies on external packages. This requires a working Go environment with version 1.11 or greater installed. - -All dependencies are vendored in the `vendor/` directory. - -_Note:_ Since most developers of Grafana still use the `GOPATH` we need to specify `GO111MODULE=on` to make `go mod` and `got get` work as intended. If you have setup Grafana outside of the `GOPATH` on your machine you can skip `GO111MODULE=on` when running the commands below. - -To add or update a new dependency, use the `go get` command: - -```bash -# The GO111MODULE variable can be omitted when the code isn't located in GOPATH. -# Pick the latest tagged release. -GO111MODULE=on go get example.com/some/module/pkg - -# Pick a specific version. -GO111MODULE=on go get example.com/some/module/pkg@vX.Y.Z -``` - -Tidy up the `go.mod` and `go.sum` files and copy the new/updated dependency to the `vendor/` directory: - -```bash -# The GO111MODULE variable can be omitted when the code isn't located in GOPATH. -GO111MODULE=on go mod tidy - -GO111MODULE=on go mod vendor -``` - -You have to commit the changes to `go.mod`, `go.sum` and the `vendor/` directory before submitting the pull request. - - +Documented in [UPDRAGING_DEPENDENCIES.md](https://github.com/grafana/grafana/blob/master/UPGRADING_DEPENDENCIES.md).