Compare commits

3 Commits

2 changed files with 3 additions and 13 deletions

View File

@@ -1,17 +1,12 @@
FROM alpine:3.23.2 FROM alpine:3.23.2
ENV ARMS_ENABLE=true
ENV ARMS_APP_NAME=gateway
ENV ARMS_REGION_ID=cn-chengdu
ENV ARMS_LICENSE_KEY=gys9jv7jqe@144a6fd684976b3
RUN apk add --no-cache tzdata && \ RUN apk add --no-cache tzdata && \
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo "Asia/Shanghai" > /etc/timezone echo "Asia/Shanghai" > /etc/timezone
COPY service-gateway /app/service-gateway COPY service-gateway /app/service-gateway
COPY config /app/config COPY config /app/config
RUN chmod 777 /app/service-gateway RUN chmod +x /app/service-gateway
WORKDIR /app WORKDIR /app
CMD ["./service-gateway"] CMD ["./service-gateway"]

9
deploy/Jenkinsfile vendored
View File

@@ -19,7 +19,6 @@ pipeline {
APP_NAME = 'service-gateway' APP_NAME = 'service-gateway'
GO_MOD_CACHE_DIR = '/home/pi/Desktop/docker/jenkins/caches/go-mod' GO_MOD_CACHE_DIR = '/home/pi/Desktop/docker/jenkins/caches/go-mod'
GO_BUILD_CACHE_DIR = '/home/pi/Desktop/docker/jenkins/caches/go-build' GO_BUILD_CACHE_DIR = '/home/pi/Desktop/docker/jenkins/caches/go-build'
INSTGO_CACHE_DIR = '/home/pi/Desktop/docker/jenkins/caches/instgo'
} }
options { options {
@@ -54,7 +53,7 @@ pipeline {
docker { docker {
image 'golang:1.24.0-alpine' image 'golang:1.24.0-alpine'
reuseNode true reuseNode true
args '-u root:root -v $GO_MOD_CACHE_DIR:/go/pkg/mod -v $GO_BUILD_CACHE_DIR:/root/.cache/go-build -v $INSTGO_CACHE_DIR:/root/instgo-caches' args '-u root:root -v $GO_MOD_CACHE_DIR:/go/pkg/mod -v $GO_BUILD_CACHE_DIR:/root/.cache/go-build'
} }
} }
steps { steps {
@@ -63,12 +62,8 @@ pipeline {
export CGO_ENABLED=0 export CGO_ENABLED=0
export GOOS=linux export GOOS=linux
export GOARCH=amd64 export GOARCH=amd64
export INSTGO_CACHE_DIR=/root/instgo-caches
wget "http://arms-apm-cn-chengdu.oss-cn-chengdu.aliyuncs.com/instgo/instgo-linux-arm64" -O instgo go build -o ${env.APP_NAME} .
chmod +x instgo
./instgo set --licenseKey=gys9jv7jqe@144a6fd684976b3
./instgo go build -o ${env.APP_NAME} .
""" """
} }
} }