Skip to content

Commit 504b5b9

Browse files
committed
feat(stacks): add kafka kafka_exporter
1 parent cdf3fe9 commit 504b5b9

3 files changed

Lines changed: 51 additions & 0 deletions

File tree

scripts/checker.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,18 @@
349349
"owner": "prometheus",
350350
"match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$",
351351
},
352+
"kafka_exporter": {
353+
"name": "kafka_exporter",
354+
"type": "github",
355+
"owner": "danielqsj",
356+
"match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$",
357+
},
358+
"kafka": {
359+
"name": "kafka",
360+
"type": "github",
361+
"owner": "apache",
362+
"match": "^[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$",
363+
},
352364
}
353365

354366

stacks/kafka/build.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
curl -fsSL -o tmp.tar.gz https://dlcdn.apache.org/kafka/${STACK_VERSION}/kafka_2.13-${STACK_VERSION}.tgz
10+
tar -xzf tmp.tar.gz
11+
mv kafka_2.13-"${STACK_VERSION}"/* "${DATA_DIR}"
12+
rm -rf kafka_2.13-${STACK_VERSION} tmp.tar.gz
13+
cat << EOF > ${PROFILE_DIR}/${STACK_NAME}.sh
14+
export PATH="/opt/drycc/kafka/bin:\$PATH"
15+
EOF
16+
}
17+
18+
# call build stack
19+
build-stack "${1}"
20+

stacks/kafka_exporter/build.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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/danielqsj/kafka_exporter/releases/download/v${STACK_VERSION}/kafka_exporter-${STACK_VERSION}.linux-${OS_ARCH}.tar.gz
12+
tar -xzf tmp.tar.gz
13+
mv kafka_exporter-${STACK_VERSION}.linux-${OS_ARCH}/kafka_exporter "${BIN_DIR}"
14+
rm -rf kafka_exporter-${STACK_VERSION}.linux-${OS_ARCH} tmp.tar.gz
15+
}
16+
17+
# call build stack
18+
build-stack "${1}"
19+

0 commit comments

Comments
 (0)