添加测试环境配置
This commit is contained in:
parent
561b009072
commit
602fb295ff
@ -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
|
||||||
21
aicss_k8s/test/docker_build.sh
Normal file
21
aicss_k8s/test/docker_build.sh
Normal 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}
|
||||||
Loading…
Reference in New Issue
Block a user