Skip to content

Commit 2c34b82

Browse files
Merge pull request #2 from TranscodeGroup/pr/v2-single
MERGE: 整理examples、添加action、teamcity下载脚本等
2 parents 571a0b2 + adcab9b commit 2c34b82

File tree

11 files changed

+135
-26
lines changed

11 files changed

+135
-26
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Add Issues and PR to project
2+
3+
on:
4+
issues:
5+
types:
6+
- opened
7+
pull_request:
8+
types:
9+
- opened
10+
11+
jobs:
12+
add-to-project:
13+
name: Add issue to project
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/[email protected]
17+
with:
18+
project-url: https://github.com/orgs/TranscodeGroup/projects/20
19+
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Auto Author Assign
2+
3+
on:
4+
pull_request_target:
5+
types: [opened]
6+
7+
permissions:
8+
pull-requests: write
9+
10+
jobs:
11+
assign-author:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: toshimaru/[email protected]
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#!/bin/bash
2+
3+
# 默认使用名为artifacts的token, 权限较小(被设置为: `<Root project>: View build runtime parameters and data`)
4+
# @see http://th-ci.transcodegroup.cn:9080/profile.html?item=accessTokens
5+
TOKEN="${TEAMCITY_TOKEN:-eyJ0eXAiOiAiVENWMiJ9.bnBsa01KRlZPMlQ3WHZpM2hDZnJVN3p3dFAw.NzNjYTA4NTctMWE5Ny00MWRkLTg2ZDktOWI2NDYxMGZiZjll}"
6+
HOST="http://th-ci.transcodegroup.cn:9080"
7+
8+
print_help() {
9+
bin_name=$(basename "$0")
10+
echo "下载 TeamCity 构建存档"
11+
echo
12+
echo "Usage: $bin_name --build=<build> [--tag=<tag>]"
13+
echo
14+
echo "--build: 构建的名称, 例如: MaintainVbenAdmin_Release, 必填"
15+
echo "--tag: 标签名, 若不填, 则下载最后一次的构建"
16+
echo
17+
echo "示例:"
18+
echo
19+
echo "1. 下载maintain-vben-admin/Release中v1.14.0版本的存档"
20+
echo "$bin_name --build=MaintainVbenAdmin_Release --tag=v1.14.0"
21+
}
22+
23+
while [ $# -gt 0 ]; do
24+
case "$1" in
25+
--tag=*)
26+
TAG="${1#*=}"
27+
;;
28+
--build=*)
29+
BUILD="${1#*=}"
30+
;;
31+
*)
32+
print_help
33+
exit 1
34+
;;
35+
esac
36+
shift
37+
done
38+
39+
if [ -z "$BUILD" ]; then
40+
print_help
41+
exit 1
42+
fi
43+
44+
if [ -n "$TAG" ]; then
45+
# locator的value包含`/`时, 需要进行base64编码
46+
# @see https://www.jetbrains.com/help/teamcity/rest/locators.html#e20589c5
47+
encoded_tag="$(printf '%s' "tags/$TAG" | base64)"
48+
branch_locator="branch:(\$base64:$encoded_tag)"
49+
else
50+
branch_locator="branch:(policy:ALL_BRANCHES)"
51+
fi
52+
build_locator="buildType:$BUILD,status:SUCCESS,state:finished,$branch_locator"
53+
54+
# @see https://www.jetbrains.com/help/teamcity/rest/manage-finished-builds.html#Get+Build+Artifacts
55+
download_artifacts() {
56+
_output="${BUILD}-${TAG:-latest}.zip"
57+
if ! curl \
58+
--fail \
59+
--header "Authorization: Bearer $TOKEN" \
60+
--output "$_output" \
61+
"${HOST}/app/rest/builds/${build_locator}/artifacts/archived/"; then
62+
echo "下载存档失败!"
63+
exit 1
64+
fi
65+
}
66+
67+
# @see https://www.jetbrains.com/help/teamcity/rest/get-build-details.html
68+
print_build_info() {
69+
curl \
70+
--header "Authorization: Bearer $TOKEN" \
71+
"${HOST}/app/rest/builds/${build_locator}"
72+
}
73+
74+
# print_build_info
75+
download_artifacts

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ git clone https://github.com/TranscodeGroup/docker.git /home/docker
1616

1717
创建`/home/docker-compose/compose.yaml`文件, 参考如下示例:
1818

19-
- [video.storage.stack.yaml](./video.storage.stack.yaml): RTP存储
20-
- [video.stream.stack.yaml](./video.stream.stack.yaml): RTP视频
21-
- [single.stack.yaml](./single.stack.yaml): V2单机部署
19+
- [video-storage](./examples/video-storage/compose.yaml): RTP存储
20+
- [video-stream](./examples/video-stream/compose.yaml): RTP视频
21+
- [track](./examples/track/compose.yaml): Tracker V2单机部署
2222

2323
### 3. 配置`.env`
2424

examples/docker

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../

examples/track/compose.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
## V2单机部署方案
2+
# 1. 修改.env文件. 初始化各种密码
3+
# 2. docker compose up -d启动服务
4+
# 3. 配置/home/token秘钥
5+
# 4. 初始化数据库脚本和默认数据 user_info|organize_role|system_config|system_alarm_platform|system_dictionary
6+
include:
7+
- ../docker/mysql8/compose.yml
8+
- ../docker/redis/compose.yml
9+
- ../docker/mongodb/compose.yml
10+
- ../docker/rabbitmq/compose.yml
11+
- ../docker/minio/compose.yml
12+
- ../docker/maintain/compose.yml
13+
- ../docker/jtt808/compose.yml
14+
- path:
15+
- ../docker/nginx/compose.yml
16+
- ../docker/nginx/compose.track.yml
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
# 默认开放端口: 直播9000,录像9001,对接9002, 监听9003,广播9004,RTMP9005:1935(srs)
55
# Nginx代理9085-9089: http-flv(srs:8080端口), wss(rtp:9006端口), 拦截mdvr和ws关键字
66
include:
7-
- minio/compose.yml
7+
- ../docker/minio/compose.yml
88
- path:
9-
- video/compose.yml
10-
- video/compose.storage.yaml
9+
- ../docker/video/compose.yml
10+
- ../docker/video/compose.storage.yaml
1111
- path:
12-
- video-nginx/compose.yml
13-
- video-nginx/compose.minio.yml
12+
- ../docker/video-nginx/compose.yml
13+
- ../docker/video-nginx/compose.minio.yml
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
# 默认开放端口: 直播9000,录像9001,对接9002, 监听9003,广播9004,RTMP9005:1935(srs)
55
# Nginx代理9085-9089: http-flv(srs:8080端口), wss(rtp:9006端口), 拦截mdvr和ws关键字
66
include:
7-
- video-nginx/compose.yml
7+
- ../docker/video-nginx/compose.yml
88
- path:
9-
- video/compose.yml
9+
- ../docker/video/compose.yml

0 commit comments

Comments
 (0)