Skip to content

Commit 9720c04

Browse files
committed
feat(stacks): add erlang influxdb mc minio rabbitmq registry telegraf
1 parent 43182e7 commit 9720c04

9 files changed

Lines changed: 173 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
*/*.tar.gz
2+
_dist

stacks/erlang/build.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
# Load stack utils
4+
. /usr/bin/stack-utils
5+
6+
# Implement build function
7+
function build() {
8+
cat << EOF > "${TARNAME}"/meta/dependencies
9+
libssl1.1
10+
libodbc1
11+
libsctp1
12+
libwxgtk3.0
13+
EOF
14+
export PATH="/opt/drycc/erlang/bin:$PATH"
15+
export C_INCLUDE_PATH="/opt/drycc/erlang/include"
16+
export CPLUS_INCLUDE_PATH="/opt/drycc/erlang/include"
17+
export LIBRARY_PATH="/opt/drycc/erlang/lib"
18+
export LD_LIBRARY_PATH="/opt/drycc/erlang/lib"
19+
export PKG_CONFIG_PATH="/opt/drycc/erlang/lib/pkg-config"
20+
./make.sh
21+
cp -rf /opt/drycc/erlang /workspace/"${TARNAME}"/data
22+
}
23+
24+
# call build stack
25+
build-stack "${1}"

stacks/erlang/make.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
OTP_VERSION=${STACK_VERSION}
2+
REBAR3_VERSION=$(curl -Ls https://github.com/erlang/rebar3/releases|grep /erlang/rebar3/releases/tag/ | sed -E 's/.*\/erlang\/rebar3\/releases\/tag\/([0-9\.]{1,}(-rc.[0-9]{1,})?)".*/\1/g' | head -1)
3+
4+
set -xe \
5+
&& OTP_DOWNLOAD_URL="https://github.com/erlang/otp/archive/OTP-${OTP_VERSION}.tar.gz" \
6+
&& OTP_DOWNLOAD_SHA256="2854318d12d727fc508e8fd5fe6921c0cbc7727d1183ad8f6f808585496e42d6" \
7+
&& runtimeDeps='libodbc1 libsctp1 libwxgtk3.0' \
8+
&& buildDeps='unixodbc-dev libsctp-dev libwxgtk-webview3.0-gtk3-dev' \
9+
&& apt-get update \
10+
&& apt-get install -y --no-install-recommends $runtimeDeps \
11+
&& apt-get install -y --no-install-recommends $buildDeps \
12+
&& curl -fSL -o otp-src.tar.gz "$OTP_DOWNLOAD_URL" \
13+
&& echo "$OTP_DOWNLOAD_SHA256 otp-src.tar.gz" | sha256sum -c - \
14+
&& export ERL_TOP="/usr/src/otp_src_${OTP_VERSION%%@*}" \
15+
&& mkdir -vp $ERL_TOP \
16+
&& tar -xzf otp-src.tar.gz -C $ERL_TOP --strip-components=1 \
17+
&& rm otp-src.tar.gz \
18+
&& ( cd $ERL_TOP \
19+
&& ./otp_build autoconf \
20+
&& gnuArch="$(dpkg-architecture --query DEB_HOST_GNU_TYPE)" \
21+
&& ./configure --build="$gnuArch" --prefix=/opt/drycc/erlang \
22+
&& make -j$(nproc) \
23+
&& make -j$(nproc) docs DOC_TARGETS=chunks \
24+
&& make install install-docs DOC_TARGETS=chunks ) \
25+
&& find /opt/drycc/erlang -name examples | xargs rm -rf \
26+
&& apt-get purge -y --auto-remove $buildDeps \
27+
&& rm -rf $ERL_TOP /var/lib/apt/lists/*
28+
29+
set -xe \
30+
&& REBAR3_DOWNLOAD_URL="https://github.com/erlang/rebar3/archive/${REBAR3_VERSION}.tar.gz" \
31+
&& REBAR3_DOWNLOAD_SHA256="cce1925d33240d81d0e4d2de2eef3616d4c17b0532ed004274f875e6607d25d2" \
32+
&& mkdir -p /usr/src/rebar3-src \
33+
&& curl -fSL -o rebar3-src.tar.gz "$REBAR3_DOWNLOAD_URL" \
34+
&& echo "$REBAR3_DOWNLOAD_SHA256 rebar3-src.tar.gz" | sha256sum -c - \
35+
&& tar -xzf rebar3-src.tar.gz -C /usr/src/rebar3-src --strip-components=1 \
36+
&& rm rebar3-src.tar.gz \
37+
&& cd /usr/src/rebar3-src \
38+
&& HOME=$PWD ./bootstrap \
39+
&& install -v ./rebar3 /opt/drycc/erlang/bin/ \
40+
&& rm -rf /usr/src/rebar3-src

stacks/influxdb/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+
BIN_DIR="${TARNAME}/data/common/bin"
9+
mkdir -p "${BIN_DIR}"
10+
11+
curl -fsSL -o tmp.tar.gz https://dl.influxdata.com/influxdb/releases/influxdb2-${STACK_VERSION}-linux-${OS_ARCH}.tar.gz
12+
tar -xvzf tmp.tar.gz
13+
mv influxdb2-${STACK_VERSION}-linux-${OS_ARCH}/influxd "${BIN_DIR}"/influxd
14+
rm -rf tmp.tar.gz influxdb2-${STACK_VERSION}-linux-${OS_ARCH}
15+
}
16+
17+
# call build stack
18+
build-stack "${1}"

stacks/mc/build.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
# Load stack utils
4+
. /usr/bin/stack-utils
5+
6+
# Implement build function
7+
function build() {
8+
BIN_DIR="${TARNAME}/data/common/bin"
9+
mkdir -p "${BIN_DIR}"
10+
curl -fsSL -o "${BIN_DIR}"/"${STACK_NAME}" https://dl.min.io/client/mc/release/linux-${OS_ARCH}/mc.${STACK_VERSION}
11+
chmod +x "${BIN_DIR}"/"${STACK_NAME}"
12+
}
13+
14+
# call build stack
15+
build-stack "${1}"

stacks/minio/build.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
# Load stack utils
4+
. /usr/bin/stack-utils
5+
6+
# Implement build function
7+
function build() {
8+
BIN_DIR="${TARNAME}/data/common/bin"
9+
mkdir -p "${BIN_DIR}"
10+
curl -fsSL -o "${BIN_DIR}"/"${STACK_NAME}" https://dl.min.io/server/minio/release/linux-${OS_ARCH}/minio.${STACK_VERSION}
11+
chmod +x "${BIN_DIR}"/"${STACK_NAME}"
12+
}
13+
14+
# call build stack
15+
build-stack "${1}"

stacks/rabbitmq/build.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
# Load stack utils
4+
. /usr/bin/stack-utils
5+
6+
# Implement build function
7+
function build() {
8+
cat << EOF > "${TARNAME}"/meta/dependencies
9+
python3
10+
EOF
11+
12+
install-packages xz-utils
13+
curl -fsSL -o tmp.tar.xz https://github.com/rabbitmq/rabbitmq-server/releases/download/v${STACK_VERSION}/rabbitmq-server-generic-unix-${STACK_VERSION}.tar.xz
14+
xz -d tmp.tar.xz
15+
tar -xvf tmp.tar
16+
mv rabbitmq_server-3.9.13 "${TARNAME}"/data/rabbitmq
17+
cp "${TARNAME}"/data/rabbitmq/plugins/rabbitmq_management-*/priv/www/cli/rabbitmqadmin "${TARNAME}"/data/rabbitmq/sbin
18+
chmod +x "${TARNAME}"/data/rabbitmq/sbin/rabbitmqadmin
19+
rm -rf tmp.tar
20+
}
21+
22+
# call build stack
23+
build-stack "${1}"
24+
25+

stacks/registry/build.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
# Load stack utils
4+
. /usr/bin/stack-utils
5+
6+
# Implement build function
7+
function build() {
8+
BIN_DIR="${TARNAME}/data/common/bin"
9+
mkdir -p "${BIN_DIR}"
10+
curl -fsSL -o tmp.tar.gz https://github.com/distribution/distribution/releases/download/v${STACK_VERSION}/registry_${STACK_VERSION}_linux_${OS_ARCH}.tar.gz
11+
tar -xvzf tmp.tar.gz
12+
mv registry "${BIN_DIR}"
13+
rm LICENSE README.md tmp.tar.gz
14+
}
15+
16+
# call build stack
17+
build-stack "${1}"

stacks/telegraf/build.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
# Load stack utils
4+
. /usr/bin/stack-utils
5+
6+
# Implement build function
7+
function build() {
8+
BIN_DIR="${TARNAME}/data/common/bin"
9+
mkdir -p "${BIN_DIR}"
10+
curl -fsSL -o tmp.tar.gz https://dl.influxdata.com/telegraf/releases/telegraf-${STACK_VERSION}_linux_${OS_ARCH}.tar.gz
11+
tar -xvzf tmp.tar.gz
12+
mv telegraf-${STACK_VERSION}/usr/bin/telegraf ${BIN_DIR}
13+
rm -rf telegraf-${STACK_VERSION} tmp.tar.gz
14+
}
15+
16+
# call build stack
17+
build-stack "${1}"

0 commit comments

Comments
 (0)