Skip to content

Commit 5e3cd91

Browse files
committed
Merge branch 'develop'
2 parents d2c5650 + f8e0163 commit 5e3cd91

File tree

5 files changed

+97
-13
lines changed

5 files changed

+97
-13
lines changed

.github/workflows/docker-publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
context: ./
4545
# Note: tags has to be all lower-case
4646
tags: |
47-
ca17/teamsacs:latest
47+
ca17/teamsacs:latest-amd64
4848
ghcr.io/ca17/teamsacs/teamsacs:latest
4949
# build on feature branches, push only on main branch
5050
push: ${{ github.ref == 'refs/heads/main' }}

Makefile

+18-2
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,30 @@ fastpubm1:
3030
make buildpre
3131
make build
3232
docker buildx build --platform=linux/amd64 --build-arg BTIME="$(shell date "+%F %T")" -t teamsacs . -f Dockerfile.local
33-
docker tag teamsacs ${BUILD_ORG}/teamsacs:latest
34-
docker push ${BUILD_ORG}/teamsacs:latest
33+
docker tag teamsacs ${BUILD_ORG}/teamsacs:latest-amd64
34+
docker push ${BUILD_ORG}/teamsacs:latest-amd64
35+
make buildarm64
36+
docker buildx build --platform=linux/arm64 --build-arg BTIME="$(shell date "+%F %T")" -t teamsacs . -f Dockerfile.local
37+
docker tag teamsacs ${BUILD_ORG}/teamsacs:latest-arm64
38+
docker push ${BUILD_ORG}/teamsacs:latest-arm64
39+
docker manifest create ${BUILD_ORG}/teamsacs:latest ${BUILD_ORG}/teamsacs:latest-arm64 ${BUILD_ORG}/teamsacs:latest-amd64
40+
# 标注不同架构镜像
41+
docker manifest annotate ${BUILD_ORG}/teamsacs:latest ${BUILD_ORG}/teamsacs:latest-amd64 --os linux --arch amd64
42+
docker manifest annotate ${BUILD_ORG}/teamsacs:latest ${BUILD_ORG}/teamsacs:latest-arm64 --os linux --arch arm64
43+
# 推送镜像
44+
docker manifest push ${BUILD_ORG}/teamsacs:latest
45+
3546

3647
build:
3748
test -d ./release || mkdir -p ./release
3849
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -ldflags '-s -w -extldflags "-static"' -o ./release/teamsacs main.go
3950
upx ./release/teamsacs
4051

52+
buildarm64:
53+
test -d ./release || mkdir -p ./release
54+
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -a -ldflags '-s -w -extldflags "-static"' -o ./release/teamsacs main.go
55+
upx ./release/teamsacs
56+
4157
syncdev:
4258
make buildpre
4359
@read -p "提示:同步操作尽量在完成一个完整功能特性后进行,请输入提交描述 (develop): " cimsg; \

README.md

+28-5
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ and supports backup restoration via TR069.
3333
- Provide basic equipment information and status data query API, and data maintenance API.
3434
- Provide various policy management APIs, such as firewall rules, routing tables, etc.
3535

36-
# Install and config
36+
# Quick Start
3737

3838
TeamsACS uses PostgreSQL as its primary database and uses the Timescaledb extension
3939

@@ -45,22 +45,40 @@ TeamsACS uses PostgreSQL as its primary database and uses the Timescaledb extens
4545

4646
GRANT ALL PRIVILEGES ON DATABASE teamsacs TO teamsacs;
4747

48+
49+
- Install TeamsACS
50+
51+
The following installation method will download and build the latest teamsacs version
52+
53+
```
54+
go install github.com/ca17/teamsacs@latest
55+
56+
teamsacs -install
57+
58+
```
59+
60+
> If you want to download the compiled binaries directly, you can visit [Github Release](https://github.com/CA17/TeamsACS/releases)
61+
62+
- Config TeamsACS
63+
64+
Modifying configuration file [/etc/teamsacs.yml](Configuration)
65+
4866
# Docker Deploy
4967

5068
```yml
51-
version: "2"
69+
version: "3"
5270
services:
5371
pgdb:
5472
image: timescale/timescaledb:latest-pg14
5573
container_name: "pgdb"
5674
ports:
57-
- "127.0.0.1:5432:5432"
75+
- "127.0.0.1:15432:5432"
5876
environment:
5977
POSTGRES_DB: teamsacs
6078
POSTGRES_USER: teamsacs
6179
POSTGRES_PASSWORD: teamsacs
6280
volumes:
63-
- /data/pgdata:/var/lib/postgresql/data
81+
- pgdb-volume:/var/lib/postgresql/data
6482
networks:
6583
teamsacs_network:
6684

@@ -75,11 +93,12 @@ services:
7593
- "2989:2989"
7694
- "2999:2999"
7795
volumes:
78-
- /data/teamsacs:/var/teamsacs
96+
- teamsacs-volume:/var/teamsacs
7997
environment:
8098
- GODEBUG=x509ignoreCN=0
8199
- TEAMSACS_DB_HOST=pgdb
82100
- TEAMSACS_DB_PORT=5432
101+
- TEAMSACS_DB_NAME=teamsacs
83102
- TEAMSACS_DB_USER=teamsacs
84103
- TEAMSACS_DB_PWD=teamsacs
85104
- TEAMSACS_WEB_DEBUG=1
@@ -89,6 +108,10 @@ services:
89108
networks:
90109
teamsacs_network:
91110

111+
volumes:
112+
pgdb-volume:
113+
teamsacs-volume:
114+
92115
```
93116

94117
## Links

assets/buildinfo.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
BuildVersion=latest v1.0.1 2023-02-13 01:16:53
1+
BuildVersion=latest v1.0.1 2023-02-13 02:30:39
22
ReleaseVersion=v1.0.1
3-
BuildTime=2023-02-13 01:16:53
3+
BuildTime=2023-02-13 02:30:39
44
BuildName=teamsacs
5-
CommitID=bfe97f08e2b1906a53ab144abde554b4bdfb6c5f
6-
CommitDate=Mon, 13 Feb 2023 00:32:44 +0800
5+
CommitID=85825bd37d3b937a287c508cbc74d17234f7246c
6+
CommitDate=Mon, 13 Feb 2023 01:17:04 +0800
77
8-
CommitSubject= : log err fix
8+
CommitSubject= : ci config

docker-compose.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
version: "3"
2+
services:
3+
pgdb:
4+
image: timescale/timescaledb:latest-pg14
5+
container_name: "pgdb"
6+
ports:
7+
- "127.0.0.1:15432:5432"
8+
environment:
9+
POSTGRES_DB: teamsacs
10+
POSTGRES_USER: teamsacs
11+
POSTGRES_PASSWORD: teamsacs
12+
volumes:
13+
- pgdb-volume:/var/lib/postgresql/data
14+
networks:
15+
teamsacs_network:
16+
17+
teamsacs:
18+
depends_on:
19+
- 'pgdb'
20+
image: ca17/teamsacs:latest
21+
container_name: "teamsacs"
22+
restart: always
23+
ports:
24+
- "2979:2979"
25+
- "2989:2989"
26+
- "2999:2999"
27+
volumes:
28+
- teamsacs-volume:/var/teamsacs
29+
environment:
30+
- GODEBUG=x509ignoreCN=0
31+
- TEAMSACS_DB_HOST=pgdb
32+
- TEAMSACS_DB_PORT=5432
33+
- TEAMSACS_DB_NAME=teamsacs
34+
- TEAMSACS_DB_USER=teamsacs
35+
- TEAMSACS_DB_PWD=teamsacs
36+
- TEAMSACS_WEB_DEBUG=1
37+
networks:
38+
teamsacs_network:
39+
40+
networks:
41+
teamsacs_network:
42+
43+
volumes:
44+
pgdb-volume:
45+
teamsacs-volume:

0 commit comments

Comments
 (0)