Skip to content

Commit c2e65db

Browse files
committed
feat(stacks): add seaweedfs and netcat checker
1 parent dd36ef4 commit c2e65db

2 files changed

Lines changed: 47 additions & 0 deletions

File tree

scripts/checker.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@
109109
"search": r"https://aka.ms/download-jdk/microsoft-jdk-[0-9]{1,}.[0-9]{1,}.[0-9]{1,}-linux-x64.tar.gz",
110110
"version": r"[0-9]{1,}.[0-9]{1,}.[0-9]{1,}",
111111
},
112+
"netcat": {
113+
"url": "https://sourceforge.net/projects/netcat/files/netcat",
114+
"type": "url",
115+
"search": r"netcat-[0-9]{1,}.[0-9]{1,}.[0-9]{1,}.tar.bz2",
116+
"version": r"[0-9]{1,}.[0-9]{1,}.[0-9]{1,}",
117+
},
112118
"jq": {
113119
"name": "jq",
114120
"type": "github",
@@ -319,6 +325,12 @@
319325
"owner": "opensearch-project",
320326
"match": "^[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$",
321327
},
328+
"seaweedfs": {
329+
"name": "seaweedfs",
330+
"type": "github",
331+
"owner": "seaweedfs",
332+
"match": "^[0-9]{1,}\.[0-9]{1,}$",
333+
},
322334
}
323335

324336

stacks/seaweedfs/build.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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-stack go "${GO_VERSION}" && . init-stack
10+
11+
BIN_DIR="${DATA_DIR}"/bin
12+
mkdir -p "${BIN_DIR}"
13+
14+
# build weed
15+
curl -sSL "https://github.com/seaweedfs/seaweedfs/archive/refs/tags/${STACK_VERSION}.tar.gz" | tar -xz \
16+
&& mv seaweedfs-${STACK_VERSION} $GOPATH/src/seaweedfs/ \
17+
&& cd $GOPATH/src/seaweedfs/weed \
18+
&& go install -tags "tikv"
19+
mv $GOPATH/bin/weed "${BIN_DIR}"
20+
cd -
21+
22+
23+
# seaweedfs-csi-driver
24+
WEED_CSI_VERSION=$(curl -Ls https://github.com/seaweedfs/seaweedfs-csi-driver/releases|grep /seaweedfs/seaweedfs-csi-driver/releases/tag/ | sed -E 's/.*\/seaweedfs\/seaweedfs-csi-driver\/releases\/tag\/v([0-9\.]{1,}(-rc.[0-9]{1,})?)".*/\1/g' | head -1)
25+
curl -sSL "https://github.com/seaweedfs/seaweedfs-csi-driver/archive/refs/tags/v${WEED_CSI_VERSION}.tar.gz" | tar -xz \
26+
&& mv seaweedfs-csi-driver-${WEED_CSI_VERSION} $GOPATH/src/seaweedfs-csi-driver/ \
27+
&& cd $GOPATH/src/seaweedfs-csi-driver \
28+
&& go build -o "${BIN_DIR}"/weed-csi ./cmd/seaweedfs-csi-driver/main.go
29+
30+
# upx
31+
upx --lzma --best "${BIN_DIR}"/*
32+
}
33+
34+
# call build stack
35+
build-stack "${1}"

0 commit comments

Comments
 (0)