File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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} "
You can’t perform that action at this time.
0 commit comments