生产部署整改阶段检查点

This commit is contained in:
xuans committed 2026-08-31 23:33:56 +08:00
1 parent f3348cf95d
commit 92d4b3d398
56 files changed
+4178 -240

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
package main
import (
"flag"
"fmt"
"os"
"strings"
"git.pcux.cn/xuans/Scert/backend/internal/releasearchive"
)
type stringList []string
func (items *stringList) String() string {
return strings.Join(*items, ",")
}
func (items *stringList) Set(value string) error {
*items = append(*items, value)
return nil
}
func main() {
var executables stringList
source := flag.String("source", "", "发布源目录")
output := flag.String("output", "", "发布归档路径")
format := flag.String("format", "", "归档格式:tar.gz 或 zip")
flag.Var(&executables, "executable", "需要写入 0755 权限的相对路径,可重复指定")
flag.Parse()
if err := releasearchive.Create(releasearchive.Options{
Source: *source, Destination: *output, Format: releasearchive.Format(*format), Executables: executables,
}); err != nil {
fmt.Fprintln(os.Stderr, "创建发布归档失败:"+err.Error())
os.Exit(1)
}
}