diff --git a/contribute/README.md b/contribute/README.md index cc8ecf5b85e..1bf5d75f4fb 100644 --- a/contribute/README.md +++ b/contribute/README.md @@ -7,6 +7,7 @@ This directory contains guides for contributors to the Grafana project. - [Developer guide](developer-guide.md) - [Triage issues](triage-issues.md) - [Merge a pull request](merge-pull-request.md) +- [Making changes to the CI pipeline](drone-pipeline.md) The `style-guides` directory contains style guides for the Grafana software project and documentation. diff --git a/contribute/drone-pipeline.md b/contribute/drone-pipeline.md new file mode 100644 index 00000000000..2d0b74db046 --- /dev/null +++ b/contribute/drone-pipeline.md @@ -0,0 +1,17 @@ +# Making changes to the Drone pipeline + +_Only people in the Grafana organization can make changes to the Drone pipeline_ + +The Drone pipelines are built with [Starlark](https://github.com/bazelbuild/starlark), a language which is similar to Python. The Starlark files are located in [`scripts/drone`](https://github.com/grafana/grafana/tree/main/scripts/drone). + +## Setup + +- Set environment variables `DRONE_SERVER` and `DRONE_TOKEN`, which can be found on your [Drone account](https://drone.grafana.net/account). These are used to verify that only Grafana employees can make changes to the pipelines. +- Install [buildifier](https://github.com/bazelbuild/buildtools/blob/master/buildifier/README.md), and use it to format the Starlark files you edit. + +## Develop + +- Open a PR where you can do test runs for your changes. If you need to experiment with secrets, create a PR in the [grafana-ci-sandbox repo](https://github.com/grafana/grafana-ci-sandbox), before opening a PR in the main repo. +- Run `make drone` after making changes to the Starlark files. This builds the `.drone.yml` file. + +For further questions, reach out to the grafana-delivery squad.