docs: 定稿 Q4 Docker 与 Q5 运维文档
This commit is contained in:
+40
-1
@@ -1,5 +1,10 @@
|
||||
version: "3"
|
||||
|
||||
vars:
|
||||
IMAGE: git.asio.asia/nixevol/nixmsg
|
||||
IMAGE_TAG: "0.1.0"
|
||||
BIN_DIR: bin
|
||||
|
||||
tasks:
|
||||
q:accept:
|
||||
desc: 跑 Q2 验收集成测试并写入 F01–F23 对照表
|
||||
@@ -41,4 +46,38 @@ tasks:
|
||||
q:docker-build:
|
||||
desc: 构建当前架构镜像(不推送)
|
||||
cmds:
|
||||
- docker build -t git.asio.asia/nixevol/nixmsg:0.1.0 -f deploy/Dockerfile .
|
||||
- docker build -t {{.IMAGE}}:{{.IMAGE_TAG}} -t {{.IMAGE}}:latest -f deploy/Dockerfile .
|
||||
|
||||
q:docker-push:
|
||||
desc: 构建并推送当前架构镜像到 git.asio.asia/nixevol/nixmsg(正式推送在 Z3)
|
||||
cmds:
|
||||
- task: q:docker-build
|
||||
- docker push {{.IMAGE}}:{{.IMAGE_TAG}}
|
||||
- docker push {{.IMAGE}}:latest
|
||||
|
||||
q:docker-buildx:
|
||||
desc: 多架构 buildx 构建并推送 linux/amd64+arm64(需 QEMU;正式推送在 Z3)
|
||||
cmds:
|
||||
- docker buildx build --platform linux/amd64,linux/arm64 -t {{.IMAGE}}:{{.IMAGE_TAG}} -t {{.IMAGE}}:latest -f deploy/Dockerfile --push .
|
||||
|
||||
q:release-bins:
|
||||
desc: 交叉编译三平台二进制到 bin/(CGO_ENABLED=0,不提交)
|
||||
deps: [web:build]
|
||||
cmds:
|
||||
- |
|
||||
{{if eq OS "windows"}}powershell -NoProfile -Command "New-Item -ItemType Directory -Force -Path '{{.BIN_DIR}}' | Out-Null"{{else}}mkdir -p {{.BIN_DIR}}{{end}}
|
||||
- cmd: go build -tags embeddist -o {{.BIN_DIR}}/nixmsg-linux-amd64 ./cmd/nixmsg
|
||||
env:
|
||||
CGO_ENABLED: "0"
|
||||
GOOS: linux
|
||||
GOARCH: amd64
|
||||
- cmd: go build -tags embeddist -o {{.BIN_DIR}}/nixmsg-linux-arm64 ./cmd/nixmsg
|
||||
env:
|
||||
CGO_ENABLED: "0"
|
||||
GOOS: linux
|
||||
GOARCH: arm64
|
||||
- cmd: go build -tags embeddist -o {{.BIN_DIR}}/nixmsg-windows-amd64.exe ./cmd/nixmsg
|
||||
env:
|
||||
CGO_ENABLED: "0"
|
||||
GOOS: windows
|
||||
GOARCH: amd64
|
||||
|
||||
Reference in New Issue
Block a user