mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Devenv: Add undev
command to the ./setup scrip of devenv (#76684)
* Add undev command to the ./setup scrip of devenv * Update devenv/setup.sh Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com> * include undev as usage --------- Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
This commit is contained in:
parent
1de65bb384
commit
a6d8cd87a7
@ -13,10 +13,16 @@ Grafana uses [Docker](https://docker.com) to make the task of setting up databas
|
||||
|
||||
## Developer dashboards and data sources
|
||||
|
||||
To setup developer dashboards and data sources
|
||||
```bash
|
||||
./setup.sh
|
||||
```
|
||||
|
||||
To remove the setup developer dashboards and data sources
|
||||
```bash
|
||||
./setup.sh undev
|
||||
```
|
||||
|
||||
After restarting the Grafana server, there should be a number of data sources named `gdev-<type>` provisioned as well as
|
||||
a dashboard folder named `gdev dashboards`. This folder contains dashboard and panel features tests dashboards.
|
||||
|
||||
|
@ -59,6 +59,31 @@ devDatasources() {
|
||||
ln -s -f ../../../devenv/datasources.yaml ../conf/provisioning/datasources/dev.yaml
|
||||
}
|
||||
|
||||
undev() {
|
||||
echo -e "\xE2\x9C\x94 Reverting all dev provisioning"
|
||||
|
||||
# Removing generated dashboard files from bulk-dashboards
|
||||
rm -f bulk-dashboards/dashboard*.json
|
||||
echo -e " \xE2\x9C\x94 Reverting bulk-dashboards provisioning"
|
||||
|
||||
# Removing generated folders from bulk-folders
|
||||
rm -rf bulk-folders/Bulk\ Folder*
|
||||
echo -e " \xE2\x9C\x94 Reverting bulk-folders provisioning"
|
||||
|
||||
|
||||
# Removing generated dashboard and datasource files from bulk-alerting-dashboards
|
||||
rm -f bulk_alerting_dashboards/alerting_dashboard*.json
|
||||
rm -f "bulk_alerting_dashboards/bulk_alerting_datasources.yaml"
|
||||
echo -e " \xE2\x9C\x94 Reverting bulk-alerting-dashboards provisioning"
|
||||
|
||||
# Removing the symlinks
|
||||
rm -f ../conf/provisioning/dashboards/custom.yaml
|
||||
rm -f ../conf/provisioning/dashboards/bulk-folders.yaml
|
||||
rm -f ../conf/provisioning/dashboards/dev.yaml
|
||||
rm -f ../conf/provisioning/datasources/custom.yaml
|
||||
rm -f ../conf/provisioning/datasources/dev.yaml
|
||||
}
|
||||
|
||||
usage() {
|
||||
echo -e "\n"
|
||||
echo "Usage:"
|
||||
@ -67,6 +92,7 @@ usage() {
|
||||
echo " bulk-folders [folders] [dashboards] - provision many folders with dashboards"
|
||||
echo " bulk-folders - provision 200 folders with 3 dashboards in each"
|
||||
echo " no args - provision core datasources and dev dashboards"
|
||||
echo " undev - removes any provisioning done by the setup.sh"
|
||||
}
|
||||
|
||||
main() {
|
||||
@ -84,6 +110,8 @@ main() {
|
||||
bulkDashboard
|
||||
elif [[ $cmd == "bulk-folders" ]]; then
|
||||
bulkFolders "$arg1"
|
||||
elif [[ $cmd == "undev" ]]; then
|
||||
undev
|
||||
else
|
||||
devDashboards
|
||||
devDatasources
|
||||
|
Loading…
Reference in New Issue
Block a user