move local developer resources to ./dev folder (#2479)

# What this PR does

As part of #1953, I wanted to be able to easily locally modify my
Grafana instance's access control provisioning configuration. In the
`grafana` container in `docker-compose-developer.yml`, we already have
this:
```yml
volumes:
  - ./provisioning:/etc/grafana/provisioning
```
The `dev` directory has a `.gitignore` setup which is better suited for
what I would like to do. By default, if I add
`./dev/grafana/provisioning/access-control/custom-roles.yml`, it will be
git-ignored. This would've not been the case with the `./provisioning`
directory

*Other stuff*
- create `./dev/grafana` folder. This folder contains resources that are
volume mounted into the `grafana` container in
`docker-compose-developer.yml`.
  - We already had a `./dev/grafana.dev.ini` file, relocated this here.
  - Relocated `./provisioning` to `./dev/grafana/provisioning`. 
- consolidate `./examples/terraform` into `./terraform` directory

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated (N/A)
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required) (N/A)
- [ ] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required) (N/A)
This commit is contained in:
Joey Orlando 2023-07-10 12:09:22 +02:00 committed by GitHub
parent 182f18de2c
commit 933e7256e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 16 additions and 3 deletions

7
dev/.gitignore vendored
View file

@ -11,3 +11,10 @@
!README.md
!scripts/
!scripts/*
# only source control grafana/provisioning/datasources/automatic.yml
# any other files under ./grafana will be ignored
!grafana/
!grafana/provisioning/
!grafana/provisioning/datasources/
!grafana/provisioning/datasources/automatic.yml

View file

@ -98,7 +98,7 @@ The following commands assume you run them from the root of the project:
```bash
touch ./dev/grafana.dev.ini
# make desired changes to ./dev/grafana.dev.ini then run
touch .env && ./dev/add_env_var.sh GRAFANA_DEV_PROVISIONING ./dev/grafana.dev.ini .env
touch .env && ./dev/add_env_var.sh GRAFANA_DEV_PROVISIONING ./dev/grafana/grafana.dev.ini .env
```
For example, if you would like to enable the `topnav` feature toggle, you can modify your `./dev/grafana.dev.ini` as
@ -109,9 +109,15 @@ such:
enable = top_nav
```
The next time you start the project via `docker-compose`, the `grafana` container will have `./dev/grafana.dev.ini`
The next time you start the project via `docker-compose`, the `grafana` container will have `./dev/grafana/grafana.dev.ini`
volume mounted inside the container.
#### Modifying Provisioning Configuration
Files under `./dev/grafana/provisioning` are volume mounted into your Grafana container and allow you to easily
modify the instance's provisioning configuration. See the Grafana docs [here](https://grafana.com/docs/grafana/latest/administration/provisioning/#:~:text=You%20can%20manage%20data%20sources,match%20the%20provisioned%20configuration%20file.)
for more information.
### Enabling RBAC for OnCall for local development
To run the project locally w/ RBAC for OnCall enabled, you will first need to run a `grafana-enterprise` container,

View file

@ -314,7 +314,7 @@ services:
volumes:
- grafanadata_dev:/var/lib/grafana
- ./grafana-plugin:/var/lib/grafana/plugins/grafana-plugin
- ./provisioning:/etc/grafana/provisioning
- ./dev/grafana/provisioning:/etc/grafana/provisioning
- ${GRAFANA_DEV_PROVISIONING:-/dev/null}:/etc/grafana/grafana.ini
depends_on:
postgres: