1
0
mirror of https://github.com/prometheus-community/postgres_exporter.git synced 2025-08-08 04:42:07 +03:00

Add metric change tracking scripts.

This commit is contained in:
Will Rouesnel
2018-11-11 16:56:36 +11:00
parent a2a2a1df2d
commit df0bb41a13
6 changed files with 67 additions and 29 deletions

29
gh-metrics-push.sh Executable file
View File

@@ -0,0 +1,29 @@
#!/bin/bash
# Script to copy and push new metric versions to the assets branch.
[ ! -z "$GIT_ASSETS_BRANCH" ] || exit 1
[ ! -z "$GIT_API_KEY" ] || exit 1
version=$(git describe HEAD) || exit 1
# Constants
ASSETS_DIR=".assets-branch"
METRICS_DIR="$ASSETS_DIR/metriclists"
# Ensure metrics dir exists
mkdir -p "$METRICS_DIR/"
# Remove old files so we spot deletions
rm -f "$METRICS_DIR/*.unique"
# Copy new files
cp -f -t "$METRICS_DIR/" ./*.unique || exit 1
# Enter the assets dir and push.
cd "$ASSETS_DIR" || exit 1
git add "$METRICS_DIR" || exit 1
git commit -m "Added unique metrics for build from $version" || exit 1
git push origin "$GIT_ASSETS_BRANCH" || exit 1
exit 0