提交 43551d68 编写于 作者: ibizdev's avatar ibizdev

zhouweidong 部署微服务接口 [ibz-disk,microservice]

上级 fc79f7c3
......@@ -37,6 +37,12 @@
git clone -b master $para2 ibzdisk/
export NODE_OPTIONS=--max-old-space-size=4096
cd ibzdisk/
mvn clean package -Papi
mvn install -Papi
cd ibzdisk-provider/ibzdisk-provider-api
mvn -Papi docker:build
mvn -Papi docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/ibzdisk-provider-api.yaml ibzlab-rt --with-registry-auth
</command>
</hudson.tasks.Shell>
</builders>
......
......@@ -12,6 +12,7 @@
<artifactId>ibzdisk-app-web</artifactId>
<name>Ibzdisk Gateway web</name>
<description>Ibzdisk web</description>
<packaging>${project.packaging}</packaging>
<dependencies>
<dependency>
......@@ -22,6 +23,7 @@
</dependencies>
<properties>
<project.packaging>jar</project.packaging>
<docker.image.prefix>registry.cn-shanghai.aliyuncs.com/ibizsys</docker.image.prefix>
</properties>
......@@ -144,6 +146,125 @@
</plugins>
</build>
</profile>
<profile>
<id>web-war</id>
<properties>
<project.packaging>war</project.packaging>
</properties>
<build>
<resources>
<resource>
<directory>${basedir}/src/main/webapp</directory>
<!--注意此次必须要放在此目录下才能被访问到 -->
<targetPath>META-INF/resources</targetPath>
<includes>
<include>**/**</include>
</includes>
</resource>
<resource>
<directory>${basedir}/src/main/resources</directory>
<includes>
<include>**/**</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>exec-yarn-run-install</id>
<phase>prepare-package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>yarn</executable>
<workingDirectory>../../app_web</workingDirectory>
</configuration>
</execution>
<execution>
<id>exec-yarn-run-build</id>
<phase>prepare-package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>yarn</executable>
<arguments>
<argument>build</argument>
</arguments>
<workingDirectory>../../app_web</workingDirectory>
</configuration>
</execution>
<execution>
<id>prepare</id>
<configuration>
<executable>cp</executable>
<arguments>
<argument>../../${project.artifactId}.war</argument>
<argument>${project.basedir}/src/main/dockerwar/</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>buildpush</id>
<configuration>
<executable>docker</executable>
<arguments>
<argument>buildx</argument>
<argument>build</argument>
<argument>--platform</argument>
<argument>linux/arm64</argument>
<argument>-t</argument>
<argument>${docker.image.prefix}/${project.artifactId}:latest</argument>
<argument>${project.basedir}/src/main/dockerwar</argument>
<argument>--push</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<finalName>ibzdisk-app-web</finalName>
<jvmArguments>-Dfile.encoding=UTF-8</jvmArguments>
<mainClass>cn.ibizlab.web.webApplication</mainClass>
<outputDirectory>../../</outputDirectory>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.4.13</version>
<configuration>
<serverId>ibiz-dev</serverId>
<imageName>${docker.image.prefix}/${project.artifactId}:latest</imageName>
<dockerDirectory>${project.basedir}/src/main/dockerwar</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>../../</directory>
<include>${project.artifactId}.war</include>
</resource>
</resources>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
......
FROM adoptopenjdk/openjdk8:jdk8u242-b08-centos
FROM image.ibizlab.cn/library/openjdk:8-jre-alpine
ENV TZ=Asia/Shanghai \
SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
......
FROM registry.cn-shanghai.aliyuncs.com/ibizops/tongweb:arm-7.0
ENV TZ Asia/Shanghai
ENV LANG C.UTF-8
WORKDIR /opt/tongtech
ADD ibzdisk-app-web.war .
RUN echo -e 'export LANG="zh_CN.UTF-8"\nexport LC_ALL="zh_CN.UTF-8"' > /etc/locale.conf
RUN unzip -oq ibzdisk-app-web.war -d ./TongWeb7.0/deployment/jcyweb
ENTRYPOINT /opt/tongtech/TongWeb7.0/bin/startserver.sh
{
"systemid":"ibzdisk",
"systemname":"ibzdisk",
"unires":[
],
"entities":[
......
......@@ -83,9 +83,13 @@
<!-- 阿里seata分布式事务 -->
<alibaba-seata.version>1.3.0</alibaba-seata.version>
<log4j2.version>2.16.0</log4j2.version>
<oracle.version>19.8.0.0</oracle.version>
<postgresql.version>42.2.6</postgresql.version>
<flowable-modeler.version>6.4.2</flowable-modeler.version>
<alibaba-fastjson.version>1.2.57_noneautotype</alibaba-fastjson.version>
</properties>
<dependencyManagement>
......@@ -108,6 +112,12 @@
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${alibaba-fastjson.version}</version>
</dependency>
<!-- Alibaba Druid -->
<dependency>
<groupId>com.alibaba</groupId>
......
......@@ -12,6 +12,7 @@
<artifactId>ibzdisk-provider-api</artifactId>
<name>Ibzdisk Microservice api</name>
<description> microservice</description>
<packaging>${project.packaging}</packaging>
<dependencies>
<dependency>
......@@ -21,10 +22,13 @@
</dependency>
</dependencies>
<properties>
<project.packaging>jar</project.packaging>
<docker.image.prefix>registry.cn-shanghai.aliyuncs.com/ibizsys</docker.image.prefix>
</properties>
<profiles>
<profile>
<id>api</id>
......@@ -111,6 +115,95 @@
</plugins>
</build>
</profile>
<profile>
<id>api-war</id>
<properties>
<project.packaging>war</project.packaging>
</properties>
<build>
<resources>
<resource>
<directory>${basedir}/src/main/resources</directory>
<includes>
<include>**/**</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<finalName>ibzdisk-provider-api</finalName>
<jvmArguments>-Dfile.encoding=UTF-8</jvmArguments>
<mainClass>cn.ibizlab.api.ibzdiskapiApplication</mainClass>
<outputDirectory>../../</outputDirectory>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.4.13</version>
<configuration>
<serverId>ibiz-dev</serverId>
<imageName>${docker.image.prefix}/${project.artifactId}:latest</imageName>
<dockerDirectory>${project.basedir}/src/main/dockerwar</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>../../</directory>
<include>${project.artifactId}.war</include>
</resource>
</resources>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>prepare</id>
<configuration>
<executable>cp</executable>
<arguments>
<argument>../../${project.artifactId}.war</argument>
<argument>${project.basedir}/src/main/dockerwar/</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>buildpush</id>
<configuration>
<executable>docker</executable>
<arguments>
<argument>buildx</argument>
<argument>build</argument>
<argument>--platform</argument>
<argument>linux/arm64</argument>
<argument>-t</argument>
<argument>${docker.image.prefix}/${project.artifactId}:latest</argument>
<argument>${project.basedir}/src/main/dockerwar</argument>
<argument>--push</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
FROM adoptopenjdk/openjdk8:jdk8u242-b08-centos
FROM image.ibizlab.cn/library/openjdk:8-jre-alpine
ENV TZ=Asia/Shanghai \
SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
......@@ -10,6 +10,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Duser.timezone=$TZ -Djava.security.egd=file:/dev/./urandom -jar /ibzdisk-provider-api.jar
EXPOSE 8081
EXPOSE 40006
ADD ibzdisk-provider-api.jar /ibzdisk-provider-api.jar
......@@ -22,7 +22,34 @@ spec:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/ibzdisk-provider-api:latest
imagePullPolicy: Always
ports:
- containerPort: 8081
- containerPort: 40006
env:
- name: SPRING_CLOUD_NACOS_DISCOVERY_IP
value: "172.16.180.237"
- name: SERVER_PORT
value: "40006"
- name: SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR
value: "172.16.100.243:8848"
- name: SPRING_REDIS_HOST
value: "172.16.100.243"
- name: SPRING_REDIS_PORT
value: "6379"
- name: SPRING_REDIS_DATABASE
value: "0"
- name: SPRING_DATASOURCE_USERNAME
value: "a_A_5d9d78509"
- name: SPRING_DATASOURCE_PASSWORD
value: "@6dEfb3@"
- name: SPRING_DATASOURCE_URL
value: "jdbc:mysql://172.16.180.232:3306/a_A_5d9d78509?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true&serverTimezone=GMT%2B8"
- name: SPRING_DATASOURCE_DRIVER-CLASS-NAME
value: "com.mysql.jdbc.Driver"
- name: SPRING_DATASOURCE_DEFAULTSCHEMA
value: "a_A_5d9d78509"
- name: NACOS
value: "172.16.100.243:8848"
- name: SPRING_CLOUD_NACOS_DISCOVERY_GROUP
value: "ibizdev"
volumeMounts:
- name: data
mountPath: /app/file
......@@ -42,9 +69,9 @@ spec:
type: NodePort
ports:
- name: http
port: 8081
targetPort: 8081
nodePort: 8081
port: 40006
targetPort: 40006
nodePort: 40006
protocol: TCP
selector:
app: ibzdisk-provider-api
......
......@@ -3,9 +3,29 @@ services:
ibzdisk-provider-api:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/ibzdisk-provider-api:latest
ports:
- "8081:8081"
- "40006:40006"
networks:
- agent_network
#logging:
# driver: loki
# options:
# loki-url: "http://172.16.240.111:3100/loki/api/v1/push"
# max-size: "50m"
# max-file: "10"
environment:
- SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.180.237
- SERVER_PORT=40006
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.100.243:8848
- SPRING_REDIS_HOST=172.16.100.243
- SPRING_REDIS_PORT=6379
- SPRING_REDIS_DATABASE=0
- SPRING_DATASOURCE_USERNAME=a_A_5d9d78509
- SPRING_DATASOURCE_PASSWORD=@6dEfb3@
- SPRING_DATASOURCE_URL=jdbc:mysql://172.16.180.232:3306/a_A_5d9d78509?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true&serverTimezone=GMT%2B8
- SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
- SPRING_DATASOURCE_DEFAULTSCHEMA=a_A_5d9d78509
- NACOS=172.16.100.243:8848
- SPRING_CLOUD_NACOS_DISCOVERY_GROUP=ibizdev
deploy:
resources:
limits:
......
FROM registry.cn-shanghai.aliyuncs.com/ibizops/tongweb:arm-7.0-withSSL
ENV TZ Asia/Shanghai
ENV LANG C.UTF-8
WORKDIR /opt/tongtech
ADD ibzdisk-provider-api.war .
RUN echo -e 'export LANG="zh_CN.UTF-8"\nexport LC_ALL="zh_CN.UTF-8"' > /etc/locale.conf
RUN unzip -oq ibzdisk-provider-api.war -d ./TongWeb7.0/deployment/jcyweb
ENTRYPOINT /opt/tongtech/TongWeb7.0/bin/startserver.sh
......@@ -20,18 +20,17 @@
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<FileNamePattern>${LOG_PATH}/ibzdisk-api.%d{yyyy-MM-dd}.log</FileNamePattern>
<FileNamePattern>${LOG_PATH}/ibzdisk-api.%d{yyyy-MM-dd}.%i.log</FileNamePattern>
<!--日志文件最大的大小-->
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<MaxHistory>30</MaxHistory>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${LOG_PATTERN}</pattern>
</encoder>
<!--日志文件最大的大小-->
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>100MB</MaxFileSize>
</triggeringPolicy>
</appender>
<!-- 日志输出级别 -->
<root level="INFO">
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册