forked from Thirdparty/wvp
1
0
Fork 0

add: road

yunnan-road
axzsd 2023-10-20 10:58:33 +08:00
parent 956fd47ed6
commit c2d22a196e
6 changed files with 198 additions and 2 deletions

19
builds/Dockerfile-roadbed Normal file
View File

@ -0,0 +1,19 @@
FROM openjdk:8u342-slim
LABEL Author="axzsd" \
Email="atva725@qq.com" \
Description="智慧涉路作业平台视频WVP"
WORKDIR /opt
COPY target/*.jar app.jar
ENV SPRING_PROFILES_ACTIVE="dev"
ENV JAVA_OPTIONS "-Xms512m -Xmx1024m \
-Dfile.encoding=UTF-8 \
-Djava.awt.headless=true \
-Dsun.net.client.defaultConnectTimeout=10000 \
-Dsun.net.client.defaultReadTimeout=30000"
EXPOSE 80
ENTRYPOINT ["sh","-c","java -jar $JAVA_OPTIONS -Dspring.profiles.active=${SPRING_PROFILES_ACTIVE} app.jar"]

View File

@ -0,0 +1,44 @@
pipeline {
agent any
environment {
REGISTRY='registry.cn-chengdu.aliyuncs.com'
INTERIOR_REGISTRY='registry-vpc.cn-chengdu.aliyuncs.com'
IMAGE_NAMESPACE='chkj'
IMAGE_NAME='roadbed-iot-vmp-vmanager'
DOCKER_FILE="builds/Dockerfile-roadbed"
K8S_FILE="builds/deploy-roadbed.yml"
}
stages {
stage('compile & buildImage->push') {
steps {
withMaven(maven: 'M3', jdk: '8') {
sh 'mvn clean package -pl platform -am -Dmaven.test.skip=true'
}
withDockerServer([credentialsId: 'chkj-docker-client-cert', uri: 'tcp://8.137.98.119']) {
withCredentials([usernamePassword(credentialsId: 'ch-aliyun-registry', passwordVariable: 'DOCKER_PASSWORD', usernameVariable: 'DOCKER_USERNAME')]) {
sh 'echo "$DOCKER_PASSWORD" | docker login $INTERIOR_REGISTRY -u "$DOCKER_USERNAME" --password-stdin'
sh 'docker build -f $DOCKER_FILE -t $INTERIOR_REGISTRY/$IMAGE_NAMESPACE/$IMAGE_NAME:$BUILD_ID .'
sh 'echo "push start..."'
sh 'docker push $INTERIOR_REGISTRY/$IMAGE_NAMESPACE/$IMAGE_NAME:$BUILD_ID'
}
}
}
}
stage('ack deploy') {
agent none
steps {
configFileProvider([configFile(fileId: '87b5c827-bd51-40af-99f4-31a800614e92', targetLocation: 'K8S-CONFIG', variable: 'KUBECONFIG')]) {
sh 'export tag=$BUILD_ID && envsubst < $K8S_FILE | kubectl apply -f -'
}
}
}
}
}

84
builds/deploy-roadbed.yml Normal file
View File

@ -0,0 +1,84 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: roadbed-iot-vmp-vmanager-api
namespace: kube-qa
labels:
app: roadbed-iot-vmp-vmanager-api
spec:
replicas: 1
selector:
matchLabels:
app: roadbed-iot-vmp-vmanager-api
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
labels:
app: roadbed-iot-vmp-vmanager-api
spec:
containers:
- name: roadbed-iot-vmp-vmanager-api
image: ${REGISTRY}/${IMAGE_NAMESPACE}/${IMAGE_NAME}:${tag}
imagePullPolicy: Always
ports:
- name: web
containerPort: 80
protocol: TCP
- name: sip
containerPort: 5060
env:
- name: TZ
value: Asia/Shanghai
- name: SPRING_PROFILES_ACTIVE
value: road
readinessProbe:
initialDelaySeconds: 20
periodSeconds: 10
timeoutSeconds: 10
httpGet:
scheme: HTTP
port: 80
path: /actuator/health
resources:
limits:
cpu: 2000m
memory: 1024Gi
requests:
cpu: 100m
memory: 512Mi
volumes:
- name: data-volume
persistentVolumeClaim:
claimName: zhslzy-pvc-nfs
dnsPolicy: ClusterFirst
imagePullSecrets:
- name: ch-aliyun-registry
restartPolicy: Always
securityContext: { }
terminationGracePeriodSeconds: 30
---
apiVersion: v1
kind: Service
metadata:
name: roadbed-iot-vmp-vmanager-api
namespace: kube-qa
labels:
name: roadbed-iot-vmp-vmanager-api
spec:
selector:
app: roadbed-iot-vmp-vmanager-api
type: NodePort
ports:
- name: web
port: 80
targetPort: web
protocol: TCP
- name: sip
port: 5060
targetPort: sip
protocol: TCP
nodePort: 5060

View File

@ -143,7 +143,10 @@
<artifactId>jedis</artifactId>
<version>2.9.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
</dependencies>
<build>

View File

@ -11,7 +11,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
//@EnableTransactionManagement
//@EnableFeignClients(basePackages = { "com.genersoft.iot.vmp", "org.integrain" })
//@ServletComponentScan("com.genersoft.iot.vmp")
@EnableAutoConfiguration
public class VManageBootstrap extends LogManager {
public static void main(String[] args) {
SpringApplication.run(VManageBootstrap.class, args);

View File

@ -0,0 +1,47 @@
spring:
application:
name: iot-vmp-vmanager
# 影子数据存储方式支持redis、jdbc
database: redis
# 通信方式支持kafka、http
communicate: http
redis:
# Redis服务器IP
#host: 10.24.20.63
host: redis.kube-qa.svc.cluster.local
#端口号
port: 6379
database: 1
#访问密码,若你的redis服务器没有设置密码就不需要用密码去连接
password: 20221122@dev
#超时时间
timeout: 10000
datasource:
name: eiot
url: jdbc:mysql://mysql.kube-qa.svc.cluster.local:3306/eiot_road?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true
username: root
password: axzsd110
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.jdbc.Driver
server:
port: 80
sip:
# ip: 10.200.64.63
ip: 113.141.178.17
port: 5060
# 根据国标6.1.2中规定domain宜采用ID统一编码的前十位编码。国标附录D中定义前8位为中心编码由省级、市级、区级、基层编号组成参照GB/T 2260-2007
# 后两位为行业编码定义参照附录D.3
# 3701020049标识山东济南历下区 信息行业接入
domain: 3701020049
id: 37010200492000000001
# 默认设备认证密码,后续扩展使用设备单独密码
password: admin123
media:
# ip: 10.200.64.88
ip: zlmediakit-0.zlmediakit.kube-qa.svc.cluster.local
port: 10000
endpoints:
actuator:
enabled: false
health:
enabled: true