Skip to content

Commit 3acec53

Browse files
committed
Add gh-assets-clone.sh script.
1 parent fec1a17 commit 3acec53

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@
1414
/release
1515
/*.prom
1616
/.metrics.*.*.prom
17+
/.metrics.*.*.prom.unique

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ before_install:
1212
&& sudo chmod +x /usr/local/bin/docker-compose
1313
- sudo apt-get update && sudo apt-get install postgresql-client-common
1414
script:
15+
- ./gh-assets-clone.sh
1516
- go run mage.go -v all
1617
- "$HOME/gopath/bin/goveralls -coverprofile=cover.out -service=travis-ci"
1718
- go run mage.go docker

gh-assets-clone.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
# Script to setup the assets clone of the repository using GIT_ASSETS_BRANCH and
3+
# GIT_API_KEY.
4+
5+
[ -z "$GIT_ASSETS_BRANCH" ] || exit 1
6+
[ -z "$GIT_API_KEY" ] || exit 1
7+
8+
setup_git() {
9+
git config --global user.email "[email protected]" || exit 1
10+
git config --global user.name "Travis CI" || exit 1
11+
}
12+
13+
# Constants
14+
ASSETS_DIR=".assets-branch"
15+
16+
# Clone the assets branch with the correct credentials
17+
git clone --single-branch -b "$GIT_ASSETS_BRANCH" \
18+
"https://${GIT_API_KEY}@github.com/${TRAVIS_REPO_SLUG}.git" "$ASSETS_DIR" || exit 1
19+

postgres_metrics_added_and_removed

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
# Script to determine added and removed metrics.
33
# Not currently used in CI but useful for inspecting complicated changes.
44

5+
# valid types: single or replicated
56
type="$1"
6-
version="$2"
7+
pg_version="$2"
78
old_version="$3"
89
new_version="$4"
910

10-
comm -23 "$old_version" "$new_version" > ".metrics.${type}.${version}.removed"
11-
comm -13 "$old_version" "$new_version" > ".metrics.${type}.${version}.added"
11+
comm -23 "$old_version" "$new_version" > ".metrics.${type}.${pg_version}.removed"
12+
comm -13 "$old_version" "$new_version" > ".metrics.${type}.${pg_version}.added"

0 commit comments

Comments
 (0)