Преглед на файлове

增加配置文件设置

master
林万龙 преди 3 години
родител
ревизия
ef137d21d2
променени са 10 файла, в които са добавени 353 реда и са изтрити 8 реда
  1. +9
    -8
      Dockerfile
  2. +59
    -0
      guizhou_dianxin_202101_run.sh
  3. +27
    -0
      setup_dev.sh
  4. +20
    -0
      setup_pro1.sh
  5. +20
    -0
      setup_pro2.sh
  6. +20
    -0
      setup_pro3.sh
  7. +27
    -0
      setup_test.sh
  8. +57
    -0
      src/main/resources/application-pro1.properties
  9. +57
    -0
      src/main/resources/application-pro2.properties
  10. +57
    -0
      src/main/resources/application-pro3.properties

+ 9
- 8
Dockerfile Целия файл

@@ -1,10 +1,11 @@
FROM java:8

MAINTAINER telpo

VOLUME /tmp
ADD target/dianxin-guizhou-forward-telpo0.0.2.jar app.jar

MAINTAINER king <1609724385@qq.com>
EXPOSE 8102

ENTRYPOINT ["java","-jar", "/app.jar"]
VOLUME /tmp
COPY target/gd2021.jar gd2021.jar
COPY --from=hengyunabc/arthas:latest /opt/arthas /opt/arthas
ENV TimeZone=Asia/Shanghai
ENV active=dev
ENV JAVA_OPTS="-Xmx256M -Xms256M"
RUN ln -snf /usr/share/zoneinfo/$TimeZone /etc/localtime && echo $TimeZone > /etc/timezone
ENTRYPOINT java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /gd2021.jar --spring.profiles.active=$active

+ 59
- 0
guizhou_dianxin_202101_run.sh Целия файл

@@ -0,0 +1,59 @@
#!/bin/bash
environment=$1
version=$2
echo "环境变量为${environment},版本为$version!"
if [[ ${environment} == 'pro1' ]]; then
#echo "开始远程构建容器"
docker stop gd202101_service || true
docker rm gd202101_service || true
docker rmi -f $(docker images | grep 139.224.254.18:5000/gd202101_service | awk '{print $3}')
docker pull 139.224.254.18:5000/gd202101_service:$version
docker run -v /home/data/gd202101server/log:/var/log/gd202101server -e active=pro1 --restart=always -d --network host --name gd202101_service 139.224.254.18:5000/gd202101_service:$version
#删除产生的None镜像
docker rmi -f $(docker images | grep none | awk '{print $3}')
docker ps -a
fi
if [[ ${environment} == 'pro2' ]]; then
#echo "开始远程构建容器"
docker stop gd202101_service || true
docker rm gd202101_service || true
docker rmi -f $(docker images | grep 139.224.254.18:5000/gd202101_service | awk '{print $3}')
docker pull 139.224.254.18:5000/gd202101_service:$version
docker run -v /home/data/gd202101server/log:/var/log/gd202101server -e active=pro2 --restart=always -d --network host --name gd202101_service 139.224.254.18:5000/gd202101_service:$version
#删除产生的None镜像
docker rmi -f $(docker images | grep none | awk '{print $3}')
docker ps -a
fi
if [[ ${environment} == 'pro3' ]]; then
#echo "开始远程构建容器"
docker stop gd202101_service || true
docker rm gd202101_service || true
docker rmi -f $(docker images | grep 139.224.254.18:5000/gd202101_service | awk '{print $3}')
docker pull 139.224.254.18:5000/gd202101_service:$version
docker run -v /home/data/gd202101server/log:/var/log/gd202101server -e active=pro3 --restart=always -d --network host
--name gd202101_service 139.224.254.18:5000/gd202101_service:$version
#删除产生的None镜像
docker rmi -f $(docker images | grep none | awk '{print $3}')
docker ps -a
fi
if [[ ${environment} == 'test' ]]; then
#echo "开始远程构建容器"
docker stop gd202101_service || true
docker rm gd202101_service || true
docker rmi -f $(docker images | grep 139.224.254.18:5000/gd202101_service | awk '{print $3}')
docker pull 139.224.254.18:5000/gd202101_service:$version
docker run -v /home/data/gd202101server/log:/var/log/gd202101server -e active=test --restart=always -d --network host --name gd202101_service 139.224.254.18:5000/gd202101_service:$version
#删除产生的None镜像
docker rmi -f $(docker images | grep none | awk '{print $3}')
docker ps -a
fi
if [[ ${environment} == 'dev' ]]; then
docker stop gd202101_service || true
docker rm gd202101_service || true
docker rmi -f $(docker images | grep 139.224.254.18:5000/gd202101_service | awk '{print $3}')
docker pull 139.224.254.18:5000/gd202101_service:$version
docker run -v /home/data/gd202101server/log:/var/log/gd202101server -e active=dev --restart=always -d --network host --name gd202101_service telpo/gd202101_service:$version
#删除产生的None镜像
docker rmi -f $(docker images | grep none | awk '{print $3}')
docker ps -a
fi

+ 27
- 0
setup_dev.sh Целия файл

@@ -0,0 +1,27 @@
#!/bin/bash
mvn clean
mvn package -Dmaven.test.skip=true
#image_version=$(date +%Y%m%d%H%M)
image_version=$version
docker stop gd202101_service || true
docker rm gd202101_service || true
# 删除镜像
docker rmi -f $(
docker images | grep 139.224.254.18:5000/gd202101_service | awk '{print $3}'
)
docker build . -t telpo/gd202101_service:$image_version

#TODO:推送镜像到私有仓库
echo '=================开始推送镜像======================='
docker tag telpo/gd202101_service:$image_version 139.224.254.18:5000/gd202101_service:$image_version
docker push 139.224.254.18:5000/gd202101_service:$image_version
echo '=================推送镜像完成======================='

#删除产生的None镜像
docker rmi -f $(docker images | grep none | awk '{print $3}')
# 查看镜像列表
docker images
# 启动容器
docker run -v /home/data/gd202101server/log:/var/log/gd202101server -d -e active=dev --network host --restart=always --cap-add=SYS_PTRACE --name gd202101_service telpo/gd202101_service:$image_version
# 查看日志
# docker logs gd202101_service

+ 20
- 0
setup_pro1.sh Целия файл

@@ -0,0 +1,20 @@
#!/usr/bin/env bash
mvn clean
mvn package -Dmaven.test.skip=true
image_version=$version
# 删除镜像
docker rmi -f $(
docker images | grep registry.cn-shanghai.aliyuncs.com/telpo_platform/gd202101_service | awk '{print $3}'
)
# 构建telpo/mrp:$image_version镜像
docker build . -t telpo/gd202101_service:$image_version
#TODO:推送镜像到阿里仓库
echo '=================开始推送镜像======================='
docker login --username=rzl_wangjx@1111649216405698 --password=telpo.123 registry.cn-shanghai.aliyuncs.com
docker tag telpo/gd202101_service:$image_version registry.cn-shanghai.aliyuncs.com/telpo_platform/gd202101_service:$image_version
docker push registry.cn-shanghai.aliyuncs.com/telpo_platform/gd202101_service:$image_version
echo '=================推送镜像完成======================='
#删除产生的None镜像
docker rmi -f $(docker images | grep none | awk '{print $3}')
# 查看镜像列表
docker images

+ 20
- 0
setup_pro2.sh Целия файл

@@ -0,0 +1,20 @@
#!/usr/bin/env bash
mvn clean
mvn package -Dmaven.test.skip=true
image_version=$version
# 删除镜像
docker rmi -f $(
docker images | grep registry.cn-shanghai.aliyuncs.com/telpo_platform/gd202101_service | awk '{print $3}'
)
# 构建telpo/mrp:$image_version镜像
docker build . -t telpo/gd202101_service:$image_version
#TODO:推送镜像到阿里仓库
echo '=================开始推送镜像======================='
docker login --username=rzl_wangjx@1111649216405698 --password=telpo.123 registry.cn-shanghai.aliyuncs.com
docker tag telpo/gd202101_service:$image_version registry.cn-shanghai.aliyuncs.com/telpo_platform/gd202101_service:$image_version
docker push registry.cn-shanghai.aliyuncs.com/telpo_platform/gd202101_service:$image_version
echo '=================推送镜像完成======================='
#删除产生的None镜像
docker rmi -f $(docker images | grep none | awk '{print $3}')
# 查看镜像列表
docker images

+ 20
- 0
setup_pro3.sh Целия файл

@@ -0,0 +1,20 @@
#!/usr/bin/env bash
mvn clean
mvn package -Dmaven.test.skip=true
image_version=$version
# 删除镜像
docker rmi -f $(
docker images | grep registry.cn-shanghai.aliyuncs.com/telpo_platform/gd202101_service | awk '{print $3}'
)
# 构建telpo/mrp:$image_version镜像
docker build . -t telpo/gd202101_service:$image_version
#TODO:推送镜像到阿里仓库
echo '=================开始推送镜像======================='
docker login --username=rzl_wangjx@1111649216405698 --password=telpo.123 registry.cn-shanghai.aliyuncs.com
docker tag telpo/gd202101_service:$image_version registry.cn-shanghai.aliyuncs.com/telpo_platform/gd202101_service:$image_version
docker push registry.cn-shanghai.aliyuncs.com/telpo_platform/gd202101_service:$image_version
echo '=================推送镜像完成======================='
#删除产生的None镜像
docker rmi -f $(docker images | grep none | awk '{print $3}')
# 查看镜像列表
docker images

+ 27
- 0
setup_test.sh Целия файл

@@ -0,0 +1,27 @@
#!/bin/bash
mvn clean
mvn package -Dmaven.test.skip=true
#image_version=$(date +%Y%m%d%H%M)
image_version=$version
docker stop gd202101_service || true
docker rm gd202101_service || true
# 删除镜像
docker rmi -f $(
docker images | grep 139.224.254.18:5000/gd202101_service | awk '{print $3}'
)
docker build . -t telpo/gd202101_service:$image_version

#TODO:推送镜像到私有仓库
echo '=================开始推送镜像======================='
docker tag telpo/gd202101_service:$image_version 139.224.254.18:5000/gd202101_service:$image_version
docker push 139.224.254.18:5000/gd202101_service:$image_version
echo '=================推送镜像完成======================='

#删除产生的None镜像
docker rmi -f $(docker images | grep none | awk '{print $3}')
# 查看镜像列表
docker images
# 启动容器
docker run -v /home/data/gd202101server/log:/var/log/gd202101server -d -e active=test --network host --restart=always --name gd202101_service telpo/gd202101_service:$image_version
# 查看日志
# docker logs gd202101_service

+ 57
- 0
src/main/resources/application-pro1.properties Целия файл

@@ -0,0 +1,57 @@
server.port=8102
jdbc.type=mysql
spring.datasource.url=jdbc:mysql://183.238.195.77:23305/gps_card?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Hongkong&allowMultiQueries=true
## spring.datasource.url=jdbc:mysql://127.0.0.1:3306/lovicoco_school?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Hongkong&allowMultiQueries=true
spring.datasource.username=root
spring.datasource.password=telpo#1234
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
# mybatis
mybatis.type-aliases-package=com.ssjl.zhaobiao.guizhou.entity
mybatis.mapper-locations=classpath:mapper/*.xml
mybatis.configuration.map-underscore-to-camel-case=true
# JWT
jwt.header=Authorization
jwt.secret=mySecret
jwt.expiration=604800
jwt.tokenHead="Bearer "
jwt.route.authentication.path=auth
jwt.route.authentication.refresh=refresh
jwt.route.authentication.register="auth/register"
jwt.access_token.expiration=6400
jwt.refresh_token_expiration=600

logging.file.path=/home/data/zhaobiao/guizhou/logs

spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss

spring.http.encoding.force=true
spring.http.encoding.charset=UTF-8
spring.http.encoding.enabled=true
server.tomcat.uri-encoding=UTF-8

#Netty
netty.host=127.0.0.1
netty.port=8888

4g.api.apiUrl = http://47.116.142.20/webapi
4g.api.key = 7368616e78697869616f616e746f6e67
4g.api.token = 123Te1p0Te1p0321
# \u8D35\u5DDE\u7535\u4FE1\u53C2\u6570
guizhou.protocol=T01.4
guizhou.factory=telpo
guizhou.device.model=TPS401
guizhou.device.version=ACB_1001
#guizhou.factory=zhizhong
#guizhou.device.model=RZL600
#guizhou.device.version=RZL_2021
#guizhou.factory=zhanneng
#guizhou.device.model=TPE390
#guizhou.device.version=TPE_0056
guizhou.http.url=http://202.105.147.30:24183
guizhou.device.testList= [{ "imei": "862622050253671","phone": "18664272743" },{ "imei": "862622050253358","phone": "" },{ "imei": "800115470000678","phone": "13500259054" }]
guizhou.device.zhizhong=862622050654340,862622050317740
guizhou.device.zhanneng=862622050925104,862622050927027
guizhou.device.tianbo=862622050253671,862622050253358,800115470000678
guizhou.http.zhizhong=http://139.196.198.68:8102/iot
guizhou.http.zhanneng=http://139.196.106.140:8102/iot

+ 57
- 0
src/main/resources/application-pro2.properties Целия файл

@@ -0,0 +1,57 @@
server.port=8102
jdbc.type=mysql
spring.datasource.url=jdbc:mysql://183.238.195.77:23305/gps_card?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Hongkong&allowMultiQueries=true
## spring.datasource.url=jdbc:mysql://127.0.0.1:3306/lovicoco_school?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Hongkong&allowMultiQueries=true
spring.datasource.username=root
spring.datasource.password=telpo#1234
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
# mybatis
mybatis.type-aliases-package=com.ssjl.zhaobiao.guizhou.entity
mybatis.mapper-locations=classpath:mapper/*.xml
mybatis.configuration.map-underscore-to-camel-case=true
# JWT
jwt.header=Authorization
jwt.secret=mySecret
jwt.expiration=604800
jwt.tokenHead="Bearer "
jwt.route.authentication.path=auth
jwt.route.authentication.refresh=refresh
jwt.route.authentication.register="auth/register"
jwt.access_token.expiration=6400
jwt.refresh_token_expiration=600

logging.file.path=/home/data/zhaobiao/guizhou/logs

spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss

spring.http.encoding.force=true
spring.http.encoding.charset=UTF-8
spring.http.encoding.enabled=true
server.tomcat.uri-encoding=UTF-8

#Netty
netty.host=127.0.0.1
netty.port=8888

4g.api.apiUrl = http://47.116.142.140/webapi
4g.api.key = 7368616e78697869616f616e746f6e67
4g.api.token = 123Te1p0Te1p0321
# \u8D35\u5DDE\u7535\u4FE1\u53C2\u6570
guizhou.protocol=T01.4
#guizhou.factory=telpo
#guizhou.device.model=TPS401
#guizhou.device.version=ACB_1001
#guizhou.factory=zhizhong
#guizhou.device.model=RZL600
#guizhou.device.version=RZL_2021
guizhou.factory=zhanneng
guizhou.device.model=TPE390
guizhou.device.version=TPE_0056
guizhou.http.url=http://202.105.147.30:24183
guizhou.device.testList= [{ "imei": "862622050253671","phone": "18664272743" },{ "imei": "862622050253358","phone": "" },{ "imei": "800115470000678","phone": "13500259054" }]
guizhou.device.zhizhong=862622050654340,862622050317740
guizhou.device.zhanneng=862622050925104,862622050927027
guizhou.device.tianbo=862622050253671,862622050253358,800115470000678
guizhou.http.zhizhong=http://139.196.198.68:8102/iot
guizhou.http.zhanneng=http://139.196.106.140:8102/iot

+ 57
- 0
src/main/resources/application-pro3.properties Целия файл

@@ -0,0 +1,57 @@
server.port=8102
jdbc.type=mysql
spring.datasource.url=jdbc:mysql://183.238.195.77:23305/gps_card?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Hongkong&allowMultiQueries=true
## spring.datasource.url=jdbc:mysql://127.0.0.1:3306/lovicoco_school?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Hongkong&allowMultiQueries=true
spring.datasource.username=root
spring.datasource.password=telpo#1234
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
# mybatis
mybatis.type-aliases-package=com.ssjl.zhaobiao.guizhou.entity
mybatis.mapper-locations=classpath:mapper/*.xml
mybatis.configuration.map-underscore-to-camel-case=true
# JWT
jwt.header=Authorization
jwt.secret=mySecret
jwt.expiration=604800
jwt.tokenHead="Bearer "
jwt.route.authentication.path=auth
jwt.route.authentication.refresh=refresh
jwt.route.authentication.register="auth/register"
jwt.access_token.expiration=6400
jwt.refresh_token_expiration=600

logging.file.path=/home/data/zhaobiao/guizhou/logs

spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss

spring.http.encoding.force=true
spring.http.encoding.charset=UTF-8
spring.http.encoding.enabled=true
server.tomcat.uri-encoding=UTF-8

#Netty
netty.host=127.0.0.1
netty.port=8888

4g.api.apiUrl = http://47.116.142.68/webapi
4g.api.key = 7368616e78697869616f616e746f6e67
4g.api.token = 123Te1p0Te1p0321
# \u8D35\u5DDE\u7535\u4FE1\u53C2\u6570
guizhou.protocol=T01.4
#guizhou.factory=telpo
#guizhou.device.model=TPS401
#guizhou.device.version=ACB_1001
guizhou.factory=zhizhong
guizhou.device.model=RZL600
guizhou.device.version=RZL_2021
#guizhou.factory=zhanneng
#guizhou.device.model=TPE390
#guizhou.device.version=TPE_0056
guizhou.http.url=http://202.105.147.30:24183
guizhou.device.testList= [{ "imei": "862622050253671","phone": "18664272743" },{ "imei": "862622050253358","phone": "" },{ "imei": "800115470000678","phone": "13500259054" }]
guizhou.device.zhizhong=862622050654340,862622050317740
guizhou.device.zhanneng=862622050925104,862622050927027
guizhou.device.tianbo=862622050253671,862622050253358,800115470000678
guizhou.http.zhizhong=http://139.196.198.68:8102/iot
guizhou.http.zhanneng=http://139.196.106.140:8102/iot

Loading…
Отказ
Запис