Skip to content

Commit 18c7c82

Browse files
committed
feat(stacks): add mysqld_exporter postgres_exporter redis_exporter
1 parent 73ce99e commit 18c7c82

4 files changed

Lines changed: 72 additions & 0 deletions

File tree

scripts/checker.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,24 @@
77
github_headers = {'Authorization': 'token %s' % os.environ.get("GITHUB_TOKEN")}
88

99
repo_info_table = {
10+
"redis_exporter": {
11+
"name": "redis_exporter",
12+
"type": "github",
13+
"owner": "oliver006",
14+
"match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$",
15+
},
16+
"mysqld_exporter": {
17+
"name": "mysqld_exporter",
18+
"type": "github",
19+
"owner": "prometheus",
20+
"match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$",
21+
},
22+
"postgres_exporter": {
23+
"name": "postgres_exporter",
24+
"type": "github",
25+
"owner": "prometheus-community",
26+
"match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$",
27+
},
1028
"caddy": {
1129
"name": "caddy",
1230
"type": "github",

stacks/mysqld_exporter/build.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
# Load stack utils
4+
. /usr/bin/stack-utils
5+
6+
# Implement build function
7+
function build() {
8+
generate-stack-path
9+
BIN_DIR="${DATA_DIR}"/bin
10+
mkdir -p "${BIN_DIR}"
11+
curl -fsSL -o tmp.tar.gz https://github.com/prometheus/mysqld_exporter/releases/download/v${STACK_VERSION}/mysqld_exporter-${STACK_VERSION}.linux-${OS_ARCH}.tar.gz
12+
tar -xzf tmp.tar.gz
13+
mv mysqld_exporter-${STACK_VERSION}.linux-${OS_ARCH}/mysqld_exporter "${BIN_DIR}"
14+
rm -rf mysqld_exporter-${STACK_VERSION}.linux-${OS_ARCH} tmp.tar.gz
15+
}
16+
17+
# call build stack
18+
build-stack "${1}"

stacks/postgres_exporter/build.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
# Load stack utils
4+
. /usr/bin/stack-utils
5+
6+
# Implement build function
7+
function build() {
8+
generate-stack-path
9+
BIN_DIR="${DATA_DIR}"/bin
10+
mkdir -p "${BIN_DIR}"
11+
curl -fsSL -o tmp.tar.gz https://github.com/prometheus-community/postgres_exporter/releases/download/v${STACK_VERSION}/postgres_exporter-${STACK_VERSION}.linux-${OS_ARCH}.tar.gz
12+
tar -xzf tmp.tar.gz
13+
mv postgres_exporter-${STACK_VERSION}.linux-${OS_ARCH}/postgres_exporter "${BIN_DIR}"
14+
rm -rf postgres_exporter-${STACK_VERSION}.linux-${OS_ARCH} tmp.tar.gz
15+
}
16+
17+
# call build stack
18+
build-stack "${1}"

stacks/redis_exporter/build.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
# Load stack utils
4+
. /usr/bin/stack-utils
5+
6+
# Implement build function
7+
function build() {
8+
generate-stack-path
9+
BIN_DIR="${DATA_DIR}"/bin
10+
mkdir -p "${BIN_DIR}"
11+
curl -fsSL -o tmp.tar.gz https://github.com/oliver006/redis_exporter/releases/download/v${STACK_VERSION}/redis_exporter-v${STACK_VERSION}.linux-${OS_ARCH}.tar.gz
12+
tar -xzf tmp.tar.gz
13+
mv redis_exporter-v${STACK_VERSION}.linux-${OS_ARCH}/redis_exporter "${BIN_DIR}"
14+
rm -rf redis_exporter-v${STACK_VERSION}.linux-${OS_ARCH} tmp.tar.gz
15+
}
16+
17+
# call build stack
18+
build-stack "${1}"

0 commit comments

Comments
 (0)