Created
July 30, 2019 02:15
-
-
Save rfvgyhn/009f17ac5ea29d2403ed8788a69b7639 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker cp provisioning/dashboards/teslamate.yml teslamate-grafana:/etc/grafana/provisioning/dashboards |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
├── config | |
├── docker-compose.yml | |
├── provisioning | |
│ └── dashboards | |
│ └── teslamate.yml | |
├── teslamate-src | |
└── update-dashboards.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
teslamate: | |
... | |
grafana: | |
container_name: teslamate-grafana | |
... | |
volumes: | |
- grafana-data:/var/lib/grafana | |
- grafana-provision:/etc/grafana/provisioning | |
mosquitto: | |
... | |
volumes: | |
teslamate-db: | |
grafana-data: | |
grafana-provision: | |
mosquitto-conf: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: 1 | |
providers: | |
- name: 'teslamate' | |
orgId: 1 | |
folder: 'Teslamate' | |
folderUid: 'Nr4ofiDZk' | |
type: file | |
disableDeletion: false | |
editable: true | |
updateIntervalSeconds: 10 | |
options: | |
path: /var/lib/grafana/dashboards |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
lang=en | |
src_dir=teslamate-src | |
container_name=teslamate-grafana | |
pushd "$src_dir" > /dev/null || (echo "Couldn't change to $src_dir" && exit 1) | |
up_to_date=$(git pull | grep "Already up-to-date") | |
if [[ -z $up_to_date ]]; then | |
echo "Pulled updates to:" | |
git reflog | grep -A1 pull | head -2 | awk '!(NR%2){system("git log --name-status " $1 ".." p);}{p=$1}' | grep "${lang}_" | cut -f2 | sort -u | |
fi | |
find dashboards -type f -name "${lang}_*" -print0 | tar -czf - --null -T - | docker cp - "$container_name":/var/lib/grafana | |
popd > /dev/null | |
echo "Done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment