Skip to content

Commit 7588540

Browse files
committed
chore(stacks): add clickhouse
1 parent 7d56058 commit 7588540

2 files changed

Lines changed: 62 additions & 0 deletions

File tree

scripts/checker.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,12 @@
379379
"owner": "mongodb-js",
380380
"match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$",
381381
},
382+
"clickhouse": {
383+
"name": "ClickHouse",
384+
"type": "github",
385+
"owner": "ClickHouse",
386+
"match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}.[0-9]{1,}-lts$",
387+
},
382388
}
383389

384390

stacks/clickhouse/build.sh

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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+
ETC_DIR="${DATA_DIR}"/etc
11+
mkdir -p "${BIN_DIR}"
12+
mkdir -p "${ETC_DIR}"
13+
export LATEST_VERSION=${STACK_VERSION}
14+
15+
case $(uname -m) in
16+
x86_64) ARCH=amd64 ;;
17+
aarch64) ARCH=arm64 ;;
18+
*) echo "Unknown architecture $(uname -m)"; exit 1 ;;
19+
esac
20+
21+
for PKG in clickhouse-common-static clickhouse-server clickhouse-client clickhouse-keeper
22+
do
23+
curl -fO "https://packages.clickhouse.com/tgz/stable/$PKG-$LATEST_VERSION-${ARCH}.tgz" \
24+
|| curl -fO "https://packages.clickhouse.com/tgz/stable/$PKG-$LATEST_VERSION.tgz"
25+
done
26+
27+
tar -xzvf "clickhouse-common-static-$LATEST_VERSION-${ARCH}.tgz" \
28+
|| tar -xzvf "clickhouse-common-static-$LATEST_VERSION.tgz"
29+
30+
mv clickhouse-common-static-$LATEST_VERSION/usr/bin/* ${BIN_DIR}/
31+
ls -l ${BIN_DIR}/
32+
33+
tar -xzvf "clickhouse-server-$LATEST_VERSION-${ARCH}.tgz" \
34+
|| tar -xzvf "clickhouse-server-$LATEST_VERSION.tgz"
35+
36+
mv clickhouse-server-$LATEST_VERSION/usr/bin/* ${BIN_DIR}/
37+
mv clickhouse-server-$LATEST_VERSION/etc/clickhouse-server/* ${ETC_DIR}/
38+
39+
tar -xzvf "clickhouse-client-$LATEST_VERSION-${ARCH}.tgz" \
40+
|| tar -xzvf "clickhouse-client-$LATEST_VERSION.tgz"
41+
42+
mv clickhouse-client-$LATEST_VERSION/usr/bin/* ${BIN_DIR}/
43+
tar -xzvf "clickhouse-keeper-$LATEST_VERSION-${ARCH}.tgz" \
44+
|| tar -xzvf "clickhouse-keeper-$LATEST_VERSION.tgz"
45+
mv clickhouse-keeper-$LATEST_VERSION/usr/bin/* ${BIN_DIR}/
46+
47+
ls -l ${BIN_DIR}/
48+
ls -l /workspace/clickhouse-24.3.2.23-linux-amd64-debian-12/
49+
50+
rm clickhouse-server* -rf
51+
rm clickhouse-common-static* -rf
52+
rm clickhouse-client* -rf
53+
rm clickhouse-keeper* -rf
54+
}
55+
# call build stack
56+
build-stack "${1}"

0 commit comments

Comments
 (0)