Skip to content

Commit a2ed2de

Browse files
committed
chore(stacks): add mongodb_exporter
1 parent 0573ae8 commit a2ed2de

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

stacks/mongodb_exporter/build.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
if [[ ${OS_ARCH} =~ "x86" || ${OS_ARCH} =~ "amd" ]]; then
12+
OS_ARCH="amd64"
13+
curl -sSL https://github.com/percona/mongodb_exporter/releases/download/v${STACK_VERSION}/mongodb_exporter-${STACK_VERSION}.linux-${OS_ARCH}.tar.gz |tar -xz
14+
mv ./mongodb_exporter-${STACK_VERSION}.linux-${OS_ARCH}/mongodb_exporter "${BIN_DIR}/"
15+
rm -rf ./mongodb_exporter-${STACK_VERSION}.linux-${OS_ARCH}
16+
elif [[ ${OS_ARCH} =~ "arm" ]]; then
17+
OS_ARCH="arm64"
18+
curl -sSL https://github.com/percona/mongodb_exporter/releases/download/v${STACK_VERSION}/mongodb_exporter-${STACK_VERSION}.linux-${OS_ARCH}.tar.gz |tar -xz
19+
mv ./mongodb_exporter-${STACK_VERSION}.linux-${OS_ARCH}/mongodb_exporter "${BIN_DIR}/"
20+
rm -rf ./mongodb_exporter-${STACK_VERSION}.linux-${OS_ARCH}
21+
fi
22+
}
23+
# call build stack
24+
build-stack "${1}"

0 commit comments

Comments
 (0)