添加测试环境配置

This commit is contained in:
goder-zhang 2026-03-04 14:07:37 +00:00
parent 561b009072
commit 602fb295ff
4 changed files with 23 additions and 0 deletions

View File

@ -36,5 +36,7 @@ spec:
env: env:
- name: IS_TEST - name: IS_TEST
value: "true" value: "true"
- name: AICSS_ENV
value: "dev"
imagePullSecrets: imagePullSecrets:
- name: coding - name: coding

View File

@ -0,0 +1,21 @@
#!/bin/bash
RUN_NAME=aicss_service
DOCKER_TAG=test
set -e
go mod tidy
# 优化编译标志
BUILD_FLAGS=(
"-trimpath" # 移除文件系统路径,减少二进制大小
"-ldflags=-s -w" # 移除符号表和调试信息,减少内存使用
)
# 使用优化的编译标志
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build "${BUILD_FLAGS[@]}" -o output/bin/${RUN_NAME} gofly.go
echo 'build go success'
docker build -t 322814420330.dkr.ecr.ap-southeast-1.amazonaws.com/xpink/${RUN_NAME}:${DOCKER_TAG} -f Dockerfile .
docker push 322814420330.dkr.ecr.ap-southeast-1.amazonaws.com/xpink/${RUN_NAME}:${DOCKER_TAG}