Skip to content

Commit e81d85e

Browse files
zhangeamonzhangeamon
authored andcommitted
2 parents 4b44054 + 6a8d01b commit e81d85e

14 files changed

Lines changed: 365 additions & 47 deletions

File tree

.woodpecker/build.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,17 @@ steps:
1212
image: bash
1313
commands:
1414
- ./build.sh all $CI_COMMIT_TAG
15-
secrets:
16-
- codename
17-
- oss_endpoint
18-
- oss_access_key_id
19-
- oss_access_key_secret
20-
- container_pull_secrets
15+
environment:
16+
CODENAME:
17+
from_secret: codename
18+
OSS_ENDPOINT:
19+
from_secret: oss_endpoint
20+
OSS_ACCESS_KEY_ID:
21+
from_secret: oss_access_key_id
22+
OSS_ACCESS_KEY_SECRET:
23+
from_secret: oss_access_key_secret
24+
CONTAINER_PULL_SECRETS:
25+
from_secret: container_pull_secrets
2126
when:
2227
event:
2328
- tag

.woodpecker/check.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@ steps:
1414
-w "$(pwd)"
1515
registry.drycc.cc/drycc/python-dev
1616
python scripts/checker.py
17-
secrets:
18-
- github_token
19-
- dev_registry
20-
- drycc_registry
17+
environment:
18+
GITHUB_TOKEN:
19+
from_secret: github_token
20+
DEV_REGISTRY:
21+
from_secret: dev_registry
22+
DRYCC_REGISTRY:
23+
from_secret: drycc_registry
2124
when:
2225
event:
2326
- cron

scripts/checker.py

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,30 @@
22
import re
33
import json
44
import requests
5-
from datetime import datetime
5+
from datetime import datetime, timezone
6+
67

78
github_headers = {'Authorization': 'token %s' % os.environ.get("GITHUB_TOKEN")}
89

910
repo_info_table = {
11+
"apollo-adminservice": {
12+
"name": "apollo",
13+
"type": "github",
14+
"owner": "apolloconfig",
15+
"match": "^v[1-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$",
16+
},
17+
"apollo-configservice": {
18+
"name": "apollo",
19+
"type": "github",
20+
"owner": "apolloconfig",
21+
"match": "^v[1-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$",
22+
},
23+
"apollo-portal": {
24+
"name": "apollo",
25+
"type": "github",
26+
"owner": "apolloconfig",
27+
"match": "^v[1-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$",
28+
},
1029
"alertmanager": {
1130
"name": "alertmanager",
1231
"type": "github",
@@ -67,6 +86,12 @@
6786
"owner": "erlang",
6887
"match": "^OTP-[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$",
6988
},
89+
"etcd": {
90+
"name": "etcd",
91+
"type": "github",
92+
"owner": "etcd-io",
93+
"match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$",
94+
},
7095
"fluentd": {
7196
"name": "fluentd",
7297
"type": "github",
@@ -127,6 +152,18 @@
127152
"owner": "stedolan",
128153
"match": "^jq-[0-9]{1,}\.[0-9]{1,}\.?[0-9]{0}$",
129154
},
155+
"kvrocks": {
156+
"name": "kvrocks",
157+
"type": "github",
158+
"owner": "apache",
159+
"match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$",
160+
},
161+
"kvrocks_exporter": {
162+
"name": "kvrocks_exporter",
163+
"type": "github",
164+
"owner": "RocksLabs",
165+
"match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$",
166+
},
130167
"kubectl": {
131168
"name": "kubectl",
132169
"type": "github",
@@ -211,8 +248,14 @@
211248
"owner": "redis",
212249
"match": "^[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$",
213250
},
214-
"redis-cluster-proxy": {
215-
"name": "redis-cluster-proxy",
251+
"valkey": {
252+
"name": "valkey",
253+
"type": "github",
254+
"owner": "valkey-io",
255+
"match": "^[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$",
256+
},
257+
"valkey-sentinel-proxy": {
258+
"name": "valkey-sentinel-proxy",
216259
"type": "github",
217260
"owner": "drycc-addons",
218261
"match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$",
@@ -484,7 +527,8 @@ def check_github_version(stack):
484527
for tag in response.json()["data"]["repository"]["refs"]["edges"]:
485528
if "tagger" in tag["node"]["target"]:
486529
date = datetime.strptime(
487-
tag["node"]["target"]["tagger"]["date"][:19], "%Y-%m-%dT%H:%M:%S")
530+
tag["node"]["target"]["tagger"]["date"][:19], "%Y-%m-%dT%H:%M:%S"
531+
).astimezone(timezone.utc)
488532
else:
489533
date = datetime.strptime(
490534
requests.get(
@@ -493,9 +537,9 @@ def check_github_version(stack):
493537
), headers=github_headers
494538
).json()["commit"]["author"]["date"][:19],
495539
"%Y-%m-%dT%H:%M:%S"
496-
)
540+
).astimezone(timezone.utc)
497541
if re.match(info["match"], tag["node"]["name"]):
498-
if (datetime.utcnow() - date).days <= 7:
542+
if (datetime.now(timezone.utc) - date).days <= 7:
499543
create_github_issue(stack, tag["node"]["name"])
500544
else:
501545
break
@@ -528,3 +572,4 @@ def main():
528572

529573
if __name__ == "__main__":
530574
main()
575+

scripts/stack-utils

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ shopt -s expand_aliases
55
alias gzip="gzip -n -9"
66

77
. /etc/os-release
8-
export GO_VERSION=1.22
8+
export GO_VERSION=1.23
99
export RUBY_VERSION=3.3
10+
export RUST_VERSION=1
1011
export STACK_NAME="${STACK_NAME:?name is required}"
1112
export STACK_VERSION="${STACK_VERSION:?version is required}"
1213
export OS_NAME="${OS_NAME:-linux}"

scripts/storage.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
)
1515

1616
symlink_table = {
17-
"go": ["1.16", "1.17", "1.18", "1.19", "1.20", "1.21", "1.22"],
18-
"java": ["8", "11", "17", "18", "19", "20", "21", "22"],
19-
"node": ["12", "14", "16", "17", "18", "19", "20", "21"],
20-
"php": ["7.3", "7.4", "8.0", "8.1", "8.2", "8.3"],
21-
"python": ["2.7", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"],
22-
"ruby": ["2.6", "3.7", "3.0", "3.1", "3.2", "3.3"],
17+
"go": ["1.16", "1.17", "1.18", "1.19", "1.20", "1.21", "1.22", "1.23"],
18+
"java": ["8", "11", "17", "18", "19", "20", "21", "22", "23", "24"],
19+
"node": ["12", "14", "16", "17", "18", "19", "20", "21", "22", "23"],
20+
"php": ["7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4"],
21+
"python": ["2.7", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"],
22+
"ruby": ["2.6", "3.7", "3.0", "3.1", "3.2", "3.3", "3.4"],
2323
"rust": ["1"],
2424
}
2525

@@ -44,6 +44,12 @@ def upload_list(stack_name, dist_dir):
4444
symlink(stack_name, symlink_version)
4545

4646

47+
def repair_symlink():
48+
for stack_name, versions in symlink_table.items():
49+
for version in versions:
50+
symlink(stack_name, version)
51+
52+
4753
def symlink(stack_name, version):
4854
symlink_list = []
4955
object_list = [
@@ -63,6 +69,8 @@ def symlink(stack_name, version):
6369
action = sys.argv[1]
6470
if action == "upload":
6571
upload_list(sys.argv[2], sys.argv[3])
72+
elif action == "repair":
73+
repair_symlink()
6674
elif action == "symlink":
6775
symlink(sys.argv[2], sys.argv[3])
6876
else:
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
10+
curl -fsSL -o tmp.zip https://github.com/apolloconfig/apollo/releases/download/v${STACK_VERSION}/apollo-adminservice-${STACK_VERSION}-github.zip
11+
unzip tmp.zip -d "${DATA_DIR}"
12+
rm tmp.zip -rf
13+
}
14+
15+
# call build stack
16+
build-stack "${1}"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
10+
curl -fsSL -o tmp.zip https://github.com/apolloconfig/apollo/releases/download/v${STACK_VERSION}/apollo-configservice-${STACK_VERSION}-github.zip
11+
unzip tmp.zip -d "${DATA_DIR}"
12+
rm tmp.zip -rf
13+
}
14+
15+
# call build stack
16+
build-stack "${1}"

stacks/apollo-portal/build.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
10+
curl -fsSL -o tmp.zip https://github.com/apolloconfig/apollo/releases/download/v${STACK_VERSION}/apollo-portal-${STACK_VERSION}-github.zip
11+
unzip tmp.zip -d "${DATA_DIR}"
12+
rm tmp.zip -rf
13+
}
14+
15+
# call build stack
16+
build-stack "${1}"

stacks/etcd/build.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
architecture=$(dpkg --print-architecture)
10+
package="etcd-v${STACK_VERSION}-linux-${architecture}"
11+
12+
BIN_DIR="${DATA_DIR}"/bin
13+
mkdir -p "${BIN_DIR}"
14+
15+
curl -sSL https://github.com/etcd-io/etcd/releases/download/v${STACK_VERSION}/${package}.tar.gz | tar xvz
16+
cp ${package}/etcd ${package}/etcdctl $BIN_DIR
17+
rm -rf ${package}
18+
chmod +x "${BIN_DIR}"/*
19+
}
20+
21+
# call build stack
22+
build-stack "${1}"

stacks/kvrocks/build.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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+
architecture=$(dpkg --print-architecture)
10+
package="etcd-v${STACK_VERSION}-linux-${architecture}"
11+
12+
BIN_DIR="${DATA_DIR}"/bin
13+
ETC_DIR="${DATA_DIR}"/etc
14+
DEFAULT_ETC_DIR="${DATA_DIR}"/etc.default
15+
mkdir -p "${BIN_DIR}" "${ETC_DIR}" "${DEFAULT_ETC_DIR}"
16+
# build kvrocks
17+
curl -sSL https://github.com/apache/kvrocks/archive/refs/tags/v${STACK_VERSION}.tar.gz | tar xvz
18+
cd kvrocks-${STACK_VERSION}
19+
apt install -y git build-essential cmake libtool python3 libssl-dev
20+
./x.py build -DENABLE_OPENSSL=ON -DPORTABLE=1 -DCMAKE_BUILD_TYPE=Release; cd ..
21+
# build kvrocks controller
22+
install-stack go "${GO_VERSION}" && . init-stack
23+
KVROCKS_CONTROLLER_GIT_URL=https://github.com/apache/kvrocks-controller
24+
# KVROCKS_CONTROLLER_VERSION=$(curl -Ls $KVROCKS_CONTROLLER_GIT_URL/tags|grep apache/kvrocks-controller/releases/tag/ | sed -E 's/.*\/apache\/kvrocks-controller\/releases\/tag\/v([0-9\.]{1,}(-rc.[0-9]{1,})?)".*/\1/g' | head -1)
25+
KVROCKS_CONTROLLER_VERSION=unstable
26+
git clone --dept 1 -b ${KVROCKS_CONTROLLER_VERSION} https://github.com/apache/kvrocks-controller
27+
cd kvrocks-controller
28+
make; cd ..
29+
30+
# cp kvrocks
31+
cp kvrocks-${STACK_VERSION}/build/{kvrocks,kvrocks2redis} $BIN_DIR
32+
cp kvrocks-${STACK_VERSION}/kvrocks.conf "${DEFAULT_ETC_DIR}"
33+
# cp kvrocks controller
34+
cp kvrocks-controller/_build/* $BIN_DIR
35+
cp kvrocks-controller/config/config.yaml "${DEFAULT_ETC_DIR}"/kvrocks-controller.yaml
36+
37+
# clean
38+
rm -rf kvrocks-controller kvrocks-${STACK_VERSION}
39+
40+
chmod +x "${BIN_DIR}"/*
41+
42+
# upx
43+
upx --lzma --best "${BIN_DIR}"/*
44+
}
45+
46+
# call build stack
47+
build-stack "${1}"

0 commit comments

Comments
 (0)