@@ -4,7 +4,5 @@ RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositorie
RUN apk update && apk add tzdata
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo "Asia/Shanghai" > /etc/timezone
-RUN mkdir /conf
-COPY conf/* /conf/
COPY build/libs/app.jar /app.jar
@@ -0,0 +1,11 @@
+cd `dirname $0`
+git reset HEAD --hard
+git pull
+gradle build -x test -Dorg.gradle.java.home=/opt/jdk-17.0.4.1
+
+version=$(date +%s)
+docker build -t registry.cn-chengdu.aliyuncs.com/cxzx-spider/open:$version .
+docker push registry.cn-chengdu.aliyuncs.com/cxzx-spider/open:$version
+sed -i "s!{ { image } }!registry\.cn-chengdu\.aliyuncs\.com/cxzx-spider/open:$version!g" open.yml
+kubectl apply -f open.yml
@@ -0,0 +1,54 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: open
+spec:
+ minReadySeconds: 5
+ replicas: 1
+ selector:
+ matchLabels:
+ k8s-app: open
+ strategy:
+ type: RollingUpdate
+ rollingUpdate:
+ maxSurge: 1
+ template:
+ metadata:
+ labels:
+ spec:
+ containers:
+ - command:
+ - [ "java","-jar","/app.jar" ]
+ env:
+ - name: PATH
+ value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+ - name: TZ
+ value: Asia/Shanghai
+ image: { { image } }
+ imagePullPolicy: IfNotPresent
+ resources:
+ requests:
+ limits:
+ cpu: 100m
+ memory: 512Mi
+ memory: 256Mi
+ livenessProbe:
+ httpGet:
+ port: 80
+ path: /hello
+ initialDelaySeconds: 3
+ periodSeconds: 30
+ readinessProbe:
+ periodSeconds: 5
+ timeoutSeconds: 1
+ dnsPolicy: ClusterFirst
+ terminationGracePeriodSeconds: 30