Skip to content

Commit c165fb4

Browse files
committed
feat(stacks): add csi-s3 stack
1 parent b461bde commit c165fb4

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

scripts/checker.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,12 @@
259259
"owner": "sclevine",
260260
"match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$",
261261
},
262+
"csi-s3": {
263+
"name": "k8s-csi-s3",
264+
"type": "github",
265+
"owner": "yandex-cloud",
266+
"match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$",
267+
},
262268
"tikv": {
263269
"name": "tikv",
264270
"type": "github",

stacks/csi-s3/build.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
#install-packages fuse
10+
install-stack go 1.18.4 && . init-stack
11+
BIN_DIR="${DATA_DIR}"/bin
12+
mkdir -p "${BIN_DIR}"
13+
# k8s-csi-s3
14+
curl -sSL "https://github.com/yandex-cloud/k8s-csi-s3/archive/refs/tags/v${STACK_VERSION}.tar.gz" | tar -xz \
15+
&& mv k8s-csi-s3-${STACK_VERSION} $GOPATH/src/k8s-csi-s3/ \
16+
&& cd $GOPATH/src/k8s-csi-s3 \
17+
&& export GO111MODULE=on \
18+
&& CGO_ENABLED=0 go build \
19+
-a -ldflags '-extldflags "-static"' -o /bin/s3driver ./cmd/s3driver
20+
mv /bin/s3driver "${BIN_DIR}"
21+
22+
# geesefs
23+
GEESEFS_VERSION=$(curl -Ls https://github.com/yandex-cloud/geesefs/releases|grep /yandex-cloud/geesefs/releases/tag/ | sed -E 's/.*\/yandex-cloud\/geesefs\/releases\/tag\/v([0-9\.]{1,}(-rc.[0-9]{1,})?)".*/\1/g' | head -1)
24+
curl -sSL "https://github.com/yandex-cloud/geesefs/archive/refs/tags/v${GEESEFS_VERSION}.tar.gz" | tar -xz \
25+
&& mv geesefs-${GEESEFS_VERSION} $GOPATH/src/geesefs/ \
26+
&& cd $GOPATH/src/geesefs \
27+
&& export GO111MODULE=on \
28+
&& CGO_ENABLED=0 go build \
29+
-a -ldflags '-extldflags "-static"' -o /bin/geesefs .
30+
mv /bin/geesefs "${BIN_DIR}"
31+
32+
# upx
33+
upx --lzma --best "${BIN_DIR}"/*
34+
}
35+
36+
# call build stack
37+
build-stack "${1}"
38+

0 commit comments

Comments
 (0)