diff --git a/Makefile b/Makefile index 5a9da72..1bb667b 100644 --- a/Makefile +++ b/Makefile @@ -15,20 +15,21 @@ BASE_REGISTRY ?= docker.io/library GO_MODULES := admin-svr/server app/server bot onelink-mock openapi sms upstream-chan upstream-proxy worker-svr -# 目录|镜像名|构建上下文|Dockerfile +# 目录|镜像名|构建上下文|Dockerfile|固定版本(留空=跟随 VERSION) +# 小程序线 app 固定 v1.0.2:版本号与功能一一对应,平台发新 tag 时不跟着动。 IMAGE_MAP := \ - admin-svr|iotlcm-admin-svr|admin-svr/server|build/Dockerfile \ - admin-ui|iotlcm-admin-ui|admin-ui|vue/build/Dockerfile \ - openapi|iotlcm-openapi|openapi|build/Dockerfile \ - worker-svr|iotlcm-worker-svr|worker-svr|build/Dockerfile \ - upstream-chan|iotlcm-upstream-chan|upstream-chan|build/Dockerfile \ - upstream-proxy|iotlcm-upstream-proxy|upstream-proxy|build/Dockerfile \ - app|iotlcm-app-server|app/server|Dockerfile \ - app|iotlcm-app-web|app/app|Dockerfile \ - sms|iotlcm-sms|sms|build/Dockerfile \ - bot|iotlcm-bot|bot|Dockerfile \ - docs|iotlcm-docs|docs|Dockerfile \ - onelink-mock|iotlcm-onelink-mock|onelink-mock|Dockerfile + admin-svr|iotlcm-admin-svr|admin-svr/server|build/Dockerfile| \ + admin-ui|iotlcm-admin-ui|admin-ui|vue/build/Dockerfile| \ + openapi|iotlcm-openapi|openapi|build/Dockerfile| \ + worker-svr|iotlcm-worker-svr|worker-svr|build/Dockerfile| \ + upstream-chan|iotlcm-upstream-chan|upstream-chan|build/Dockerfile| \ + upstream-proxy|iotlcm-upstream-proxy|upstream-proxy|build/Dockerfile| \ + app|iotlcm-app-server|app/server|Dockerfile|v1.0.2 \ + app|iotlcm-app-web|app/app|Dockerfile|v1.0.2 \ + sms|iotlcm-sms|sms|build/Dockerfile| \ + bot|iotlcm-bot|bot|Dockerfile| \ + docs|iotlcm-docs|docs|Dockerfile| \ + onelink-mock|iotlcm-onelink-mock|onelink-mock|Dockerfile| .PHONY: help build test images docs clean @@ -50,15 +51,16 @@ test: images: @set -e; echo "镜像前缀: $(REGISTRY) 版本: $(VERSION)"; \ - echo "$(IMAGE_MAP)" | tr ' ' '\n' | while IFS='|' read -r dir img ctx df; do \ + echo "$(IMAGE_MAP)" | tr ' ' '\n' | while IFS='|' read -r dir img ctx df pin; do \ [ -z "$$dir" ] && continue; \ - echo ""; echo "==> $$img:$$VERSION (context=$$ctx dockerfile=$$df)"; \ + v="$${pin:-$(VERSION)}"; \ + echo ""; echo "==> $$img:$$v (context=$$ctx dockerfile=$$df$${pin:+ [固定版本]})"; \ docker build -f "$$ctx/$$df" \ --build-arg BASE_REGISTRY="$(BASE_REGISTRY)" \ - --build-arg BuildVersion="$(VERSION)" \ + --build-arg BuildVersion="$$v" \ --build-arg CommitID="$$(git rev-parse --short=7 HEAD)" \ --build-arg BuildTime="$$(date -u +%FT%TZ)" \ - -t "$(REGISTRY):$$img-$(VERSION)" "$$ctx"; \ + -t "$(REGISTRY):$$img-$$v" "$$ctx"; \ done docs: diff --git a/README.md b/README.md index 4260295..b0a179a 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,17 @@ make images # 本地构建全部镜像 └─ 仓库 ┘ └─ 服务名 ─┘└版本┘ ``` -打 `v*` tag 会经由内网 CI 构建全部镜像并推送,见 `.gitea/workflows/`。 +打 `v*` tag 会经由内网 CI 构建镜像并推送,见 `.gitea/workflows/`。 + +**小程序线(`app/`)是独立版本线**,不跟随平台 tag: + +| 服务 | 当前版本 | 说明 | +| --- | --- | --- | +| 其余业务服务 | `v1.0.4` | 跟随平台 tag | +| `iotlcm-app-server` / `iotlcm-app-web` | **`v1.0.2`** | 直连版本号与功能一一对应,功能未变就不动版本 | + +CI 里用一张 `PIN` 表维护这条规则(`app|v1.0.2`):平台发新 tag 时自动跳过 app,需要重建小程序线时单独触发 +`SERVICES=app VERSION=v1.0.2`。 ## 许可 diff --git a/app/README.md b/app/README.md index 5b604d0..681443a 100644 --- a/app/README.md +++ b/app/README.md @@ -2,6 +2,9 @@ iotLCM 物联网卡全生命周期管理平台的**小程序端 + 用户端服务**。 +> **版本线独立**:本目录对应小程序线的 **v1.0.2**,不跟随平台 tag(平台当前为 v1.0.4)。 +> 功能变更时才提升本线版本,镜像 tag 仍为 `iotlcm-app-server-<版本>` / `iotlcm-app-web-<版本>`。 + - `app/` —— uni-app 小程序前端(基于 [unibest](https://github.com/unibest-tech/unibest),MIT) - `server/` —— 用户端 GoFrame 服务(基于 XiuAdmin 框架,Apache-2.0) diff --git a/deploy/README.md b/deploy/README.md index ae1cbb3..69a5170 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -49,12 +49,19 @@ docker compose --profile with-nginx up -d # 自带反向代理 crpi-.../iotlcm/iotlcm:mysql-8.0 crpi-.../iotlcm/iotlcm:redis-7.2 crpi-.../iotlcm/iotlcm:iotlcm-admin-svr-v1.0.4 -crpi-.../iotlcm/iotlcm:iotlcm-app-server-v1.0.4 +crpi-.../iotlcm/iotlcm:iotlcm-app-server-v1.0.2 ``` tag 格式统一为 **`<服务名>-<版本>`**。 -当前业务版本:全部服务为 `v1.0.4`(单仓统一版本号 —— 平台 v1.0.4 发布包含全部服务)。 +当前业务版本: + +| 服务 | 版本 | +| --- | --- | +| 除 app 线外的全部业务服务 | `v1.0.4` | +| `iotlcm-app-server` / `iotlcm-app-web` | **`v1.0.2`**(小程序线独立版本,不跟随平台 tag) | + +> 版本号与功能一一对应:小程序线的功能停在 v1.0.2,因此镜像 tag 也停在 v1.0.2;平台后续发 v1.0.5 时它依然不动。 升级时在 `docker-compose.yml` 中同步更新 tag 的版本部分,不要改用 `latest`。 diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml index 15c5df5..9d8d6cb 100644 --- a/deploy/docker-compose.yml +++ b/deploy/docker-compose.yml @@ -285,7 +285,7 @@ services: condition: service_healthy app-server: - image: 'crpi-qflrqrxoohlkkvgc.cn-chengdu.personal.cr.aliyuncs.com/iotlcm/iotlcm:iotlcm-app-server-v1.0.4' + image: 'crpi-qflrqrxoohlkkvgc.cn-chengdu.personal.cr.aliyuncs.com/iotlcm/iotlcm:iotlcm-app-server-v1.0.2' container_name: iotlcm-app-server restart: always ports: @@ -306,7 +306,7 @@ services: condition: service_healthy app-web: - image: 'crpi-qflrqrxoohlkkvgc.cn-chengdu.personal.cr.aliyuncs.com/iotlcm/iotlcm:iotlcm-app-web-v1.0.4' + image: 'crpi-qflrqrxoohlkkvgc.cn-chengdu.personal.cr.aliyuncs.com/iotlcm/iotlcm:iotlcm-app-web-v1.0.2' container_name: iotlcm-app-web restart: always ports: diff --git a/docs/docs/deploy/build-image.md b/docs/docs/deploy/build-image.md index ba6bc46..9b09f4c 100644 --- a/docs/docs/deploy/build-image.md +++ b/docs/docs/deploy/build-image.md @@ -139,8 +139,8 @@ docker build --build-arg GOPROXY=https://goproxy.cn,direct -t ... . | admin-svr | `iotlcm-admin-svr-` | `.../iotlcm/iotlcm:iotlcm-admin-svr-v1.0.4` | | admin-ui | `iotlcm-admin-ui-` | `.../iotlcm/iotlcm:iotlcm-admin-ui-v1.0.4` | | openapi | `iotlcm-openapi-` | `.../iotlcm/iotlcm:iotlcm-openapi-v1.0.4` | -| app-server | `iotlcm-app-server-` | `.../iotlcm/iotlcm:iotlcm-app-server-v1.0.4` | -| app-web | `iotlcm-app-web-` | `.../iotlcm/iotlcm:iotlcm-app-web-v1.0.4` | +| app-server | `iotlcm-app-server-` | `.../iotlcm/iotlcm:iotlcm-app-server-v1.0.2` | +| app-web | `iotlcm-app-web-` | `.../iotlcm/iotlcm:iotlcm-app-web-v1.0.2` | | upstream-chan | `iotlcm-upstream-chan-` | `.../iotlcm/iotlcm:iotlcm-upstream-chan-v1.0.4` | | upstream-proxy | `iotlcm-upstream-proxy-` | `.../iotlcm/iotlcm:iotlcm-upstream-proxy-v1.0.4` | | worker-svr | `iotlcm-worker-svr-` | `.../iotlcm/iotlcm:iotlcm-worker-svr-v1.0.4` | @@ -151,6 +151,11 @@ docker build --build-arg GOPROXY=https://goproxy.cn,direct -t ... . 基础组件(`mysql`、`redis`、`rabbitmq`、`consul`、`nginx`)不需要构建,从上游同步到同一仓库即可,tag 为 `<组件>-<版本>`,见下节。 +::: tip app 线是独立版本 +`iotlcm-app-server` 与 `iotlcm-app-web` 属于**小程序线**,版本号与平台 tag 解耦:平台发 v1.0.4 时它们仍是 `v1.0.2`。 +自建镜像时按 `iotlcm-app--v1.0.2` 命名,不要跟着平台版本走。 +::: + ::: warning tag 必须带上服务名 同一个仓库里 tag 不能重复。只用版本号(如 `v1.0.4`)会让 12 个服务互相覆盖,因此 tag 固定为 `<服务名>-<版本>`。 ::: diff --git a/docs/docs/deploy/configuration.md b/docs/docs/deploy/configuration.md index c9df7cd..82db5cb 100644 --- a/docs/docs/deploy/configuration.md +++ b/docs/docs/deploy/configuration.md @@ -35,7 +35,7 @@ image: 'crpi-.../iotlcm/iotlcm:iotlcm-admin-svr-v1.0.4' | tag 形式 | 示例 | | --- | --- | | 基础组件:`<组件>-<版本>` | `mysql-8.0`、`redis-7.2`、`nginx-1.30` | -| 业务服务:`<服务>-<版本>` | `iotlcm-admin-svr-v1.0.4`、`iotlcm-app-server-v1.0.4` | +| 业务服务:`<服务>-<版本>` | `iotlcm-admin-svr-v1.0.4`、`iotlcm-app-server-v1.0.2` | 改用自有仓库时,全局替换 Registry 前缀即可。 diff --git a/docs/docs/deploy/offline.md b/docs/docs/deploy/offline.md index 6254312..82a384a 100644 --- a/docs/docs/deploy/offline.md +++ b/docs/docs/deploy/offline.md @@ -25,7 +25,7 @@ docker compose config --images | sort -u ```text registry.example.com/iotlcm/iotlcm:iotlcm-admin-svr-v1.0.4 registry.example.com/iotlcm/iotlcm:iotlcm-admin-ui-v1.0.4 -registry.example.com/iotlcm/iotlcm:iotlcm-app-server-v1.0.4 +registry.example.com/iotlcm/iotlcm:iotlcm-app-server-v1.0.2 ... registry.example.com/iotlcm/iotlcm:mysql-8.0 registry.example.com/iotlcm/iotlcm:redis-7.2 diff --git a/docs/docs/deploy/prerequisites.md b/docs/docs/deploy/prerequisites.md index 67e3a6c..890e4ae 100644 --- a/docs/docs/deploy/prerequisites.md +++ b/docs/docs/deploy/prerequisites.md @@ -71,7 +71,7 @@ crpi-.../iotlcm/iotlcm:mysql-8.0 crpi-.../iotlcm/iotlcm:redis-7.2 crpi-.../iotlcm/iotlcm:iotlcm-admin-svr-v1.0.4 crpi-.../iotlcm/iotlcm:iotlcm-openapi-v1.0.4 -crpi-.../iotlcm/iotlcm:iotlcm-app-server-v1.0.4 +crpi-.../iotlcm/iotlcm:iotlcm-app-server-v1.0.2 ``` tag 格式统一为 **`<服务名>-<版本>`**。