Browse Source

feat: 更新业务逻辑

master
xc-yjs 7 months ago
parent
commit
ddadd79aa4
  1. 43
      docker/push.sh
  2. 2
      nla-common/pom.xml
  3. 6
      nla-coupon-service/Dockerfile
  4. 34
      nla-coupon-service/pom.xml
  5. 6
      nla-gateway/Dockerfile
  6. 32
      nla-gateway/pom.xml
  7. 6
      nla-order-service/Dockerfile
  8. 32
      nla-order-service/pom.xml
  9. 6
      nla-product-service/Dockerfile
  10. 32
      nla-product-service/pom.xml
  11. 6
      nla-user-service/Dockerfile
  12. 32
      nla-user-service/pom.xml
  13. 2
      pom.xml

43
docker/push.sh

@ -0,0 +1,43 @@
#登录阿里云镜像仓
docker login --username=tb86538668 registry.cn-hangzhou.aliyuncs.com --password=
#构建整个项目,或者单独构建common项目,避免依赖未被构建上去
cd ../nla-common
mvn install
#构建网关
cd ../nla-gateway
mvn install -Dmaven.test.skip=true dockerfile:build
docker tag nla-cloud/nla-gateway:latest registry.cn-hangzhou.aliyuncs.com/nla-cloud/nla-gateway:v1.2
docker push registry.cn-hangzhou.aliyuncs.com/nla-cloud/nla-gateway:v1.2
echo "网关构建推送成功"
#用户服务
cd ../nla-user-service
mvn install -Dmaven.test.skip=true dockerfile:build
docker tag nla-cloud/nla-user-service:latest registry.cn-hangzhou.aliyuncs.com/nla-cloud/nla-user-service:v1.2
docker push registry.cn-hangzhou.aliyuncs.com/nla-cloud/nla-user-service:v1.2
echo "用户服务构建推送成功"
#商品服务
cd ../nla-product-service
mvn install -Dmaven.test.skip=true dockerfile:build
docker tag nla-cloud/nla-product-service:latest registry.cn-hangzhou.aliyuncs.com/nla-cloud/nla-product-service:v1.2
docker push registry.cn-hangzhou.aliyuncs.com/nla-cloud/nla-product-service:v1.2
echo "商品服务构建推送成功"
#订单服务
cd ../nla-order-service
mvn install -Dmaven.test.skip=true dockerfile:build
docker tag nla-cloud/nla-order-service:latest registry.cn-hangzhou.aliyuncs.com/nla-cloud/nla-order-service:v1.2
docker push registry.cn-hangzhou.aliyuncs.com/nla-cloud/nla-order-service:v1.2
echo "订单服务构建推送成功"
#优惠券服务
cd ../nla-coupon-service
mvn install -Dmaven.test.skip=true dockerfile:build
docker tag nla-cloud/nla-coupon-service:latest registry.cn-hangzhou.aliyuncs.com/nla-cloud/nla-coupon-service:v1.2
docker push registry.cn-hangzhou.aliyuncs.com/nla-cloud/nla-coupon-service:v1.2
echo "优惠券服务构建推送成功"
echo "=======构建脚本执行完毕====="

2
nla-common/pom.xml

@ -23,7 +23,7 @@
<!--项⽬中添加 spring-boot-starter-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
<!--如果spring-boot版本大于2.3.x,则需要手动引入依赖-->
<dependency>

6
nla-coupon-service/Dockerfile

@ -0,0 +1,6 @@
#FROM adoptopenjdk/openjdk11:ubi
FROM adoptopenjdk/openjdk11:jre11u-nightly
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.jar"]

34
nla-coupon-service/pom.xml

@ -29,4 +29,38 @@
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
</dependencies>
<build>
<finalName>alibaba-cloud-coupon</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!--需要加这个,不然打包镜像找不到启动文件-->
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
<configuration>
<fork>true</fork>
<addResources>true</addResources>
</configuration>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.4.10</version>
<configuration>
<repository>${docker.image.prefix}/${project.artifactId}</repository>
<buildArgs>
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
</configuration>
</plugin>
</plugins>
</build>
</project>

6
nla-gateway/Dockerfile

@ -0,0 +1,6 @@
#FROM adoptopenjdk/openjdk11:ubi
FROM adoptopenjdk/openjdk11:jre11u-nightly
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.jar"]

32
nla-gateway/pom.xml

@ -40,4 +40,36 @@
<artifactId>sentinel-datasource-nacos</artifactId>
</dependency>
</dependencies>
<build>
<finalName>alibaba-cloud-gateway</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!--需要加这个,不然打包镜像找不到启动文件-->
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
<configuration>
<fork>true</fork>
<addResources>true</addResources>
</configuration>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.4.10</version>
<configuration>
<repository>${docker.image.prefix}/${project.artifactId}</repository>
<buildArgs>
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
</configuration>
</plugin>
</plugins>
</build>
</project>

6
nla-order-service/Dockerfile

@ -0,0 +1,6 @@
#FROM adoptopenjdk/openjdk11:ubi
FROM adoptopenjdk/openjdk11:jre11u-nightly
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.jar"]

32
nla-order-service/pom.xml

@ -31,4 +31,36 @@
<version>4.10.218.ALL</version>
</dependency>
</dependencies>
<build>
<finalName>alibaba-cloud-order</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!--需要加这个,不然打包镜像找不到启动文件-->
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
<configuration>
<fork>true</fork>
<addResources>true</addResources>
</configuration>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.4.10</version>
<configuration>
<repository>${docker.image.prefix}/${project.artifactId}</repository>
<buildArgs>
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
</configuration>
</plugin>
</plugins>
</build>
</project>

6
nla-product-service/Dockerfile

@ -0,0 +1,6 @@
#FROM adoptopenjdk/openjdk11:ubi
FROM adoptopenjdk/openjdk11:jre11u-nightly
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.jar"]

32
nla-product-service/pom.xml

@ -29,4 +29,36 @@
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
</dependencies>
<build>
<finalName>alibaba-cloud-product</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!--需要加这个,不然打包镜像找不到启动文件-->
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
<configuration>
<fork>true</fork>
<addResources>true</addResources>
</configuration>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.4.10</version>
<configuration>
<repository>${docker.image.prefix}/${project.artifactId}</repository>
<buildArgs>
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
</configuration>
</plugin>
</plugins>
</build>
</project>

6
nla-user-service/Dockerfile

@ -0,0 +1,6 @@
#FROM adoptopenjdk/openjdk11:ubi
FROM adoptopenjdk/openjdk11:jre11u-nightly
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.jar"]

32
nla-user-service/pom.xml

@ -46,4 +46,36 @@
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
</dependencies>
<build>
<finalName>alibaba-cloud-user</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!--需要加这个,不然打包镜像找不到启动文件-->
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
<configuration>
<fork>true</fork>
<addResources>true</addResources>
</configuration>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.4.10</version>
<configuration>
<repository>${docker.image.prefix}/${project.artifactId}</repository>
<buildArgs>
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
</configuration>
</plugin>
</plugins>
</build>
</project>

2
pom.xml

@ -30,7 +30,7 @@
<commons.lang3.version>3.9</commons.lang3.version>
<commons.codec.version>1.15</commons.codec.version>
<springfox.boot.starter.version>3.0.0</springfox.boot.starter.version>
<docker.image.prefix>yuan-cloud</docker.image.prefix>
<docker.image.prefix>nla-cloud</docker.image.prefix>
<!--跳过单元测试-->
<skipTests>true</skipTests>
</properties>

Loading…
Cancel
Save