From ddadd79aa4b14d2d98d7ef04e607e32a0abb5bcd Mon Sep 17 00:00:00 2001 From: xc-yjs Date: Thu, 19 Sep 2024 16:18:22 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=20=E6=9B=B4=E6=96=B0=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/push.sh | 43 ++++++++++++++++++++++++++++++++++ nla-common/pom.xml | 2 +- nla-coupon-service/Dockerfile | 6 +++++ nla-coupon-service/pom.xml | 34 +++++++++++++++++++++++++++ nla-gateway/Dockerfile | 6 +++++ nla-gateway/pom.xml | 32 +++++++++++++++++++++++++ nla-order-service/Dockerfile | 6 +++++ nla-order-service/pom.xml | 32 +++++++++++++++++++++++++ nla-product-service/Dockerfile | 6 +++++ nla-product-service/pom.xml | 32 +++++++++++++++++++++++++ nla-user-service/Dockerfile | 6 +++++ nla-user-service/pom.xml | 32 +++++++++++++++++++++++++ pom.xml | 2 +- 13 files changed, 237 insertions(+), 2 deletions(-) create mode 100644 docker/push.sh create mode 100644 nla-coupon-service/Dockerfile create mode 100644 nla-gateway/Dockerfile create mode 100644 nla-order-service/Dockerfile create mode 100644 nla-product-service/Dockerfile create mode 100644 nla-user-service/Dockerfile diff --git a/docker/push.sh b/docker/push.sh new file mode 100644 index 0000000..c1e1e0f --- /dev/null +++ b/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 "=======构建脚本执行完毕=====" diff --git a/nla-common/pom.xml b/nla-common/pom.xml index 15cdd8c..39a0bc2 100644 --- a/nla-common/pom.xml +++ b/nla-common/pom.xml @@ -23,7 +23,7 @@ org.springframework.boot - spring-boot-starter-web + spring-boot-devtools diff --git a/nla-coupon-service/Dockerfile b/nla-coupon-service/Dockerfile new file mode 100644 index 0000000..0ad2ed8 --- /dev/null +++ b/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"] diff --git a/nla-coupon-service/pom.xml b/nla-coupon-service/pom.xml index 6aa1713..c6ede8a 100644 --- a/nla-coupon-service/pom.xml +++ b/nla-coupon-service/pom.xml @@ -29,4 +29,38 @@ spring-boot-starter-test + + + alibaba-cloud-coupon + + + org.springframework.boot + spring-boot-maven-plugin + + + + + repackage + + + + + true + true + + + + com.spotify + dockerfile-maven-plugin + 1.4.10 + + ${docker.image.prefix}/${project.artifactId} + + target/${project.build.finalName}.jar + + + + + + diff --git a/nla-gateway/Dockerfile b/nla-gateway/Dockerfile new file mode 100644 index 0000000..0ad2ed8 --- /dev/null +++ b/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"] diff --git a/nla-gateway/pom.xml b/nla-gateway/pom.xml index 5e0d86b..17666a9 100644 --- a/nla-gateway/pom.xml +++ b/nla-gateway/pom.xml @@ -40,4 +40,36 @@ sentinel-datasource-nacos + + alibaba-cloud-gateway + + + org.springframework.boot + spring-boot-maven-plugin + + + + + repackage + + + + + true + true + + + + com.spotify + dockerfile-maven-plugin + 1.4.10 + + ${docker.image.prefix}/${project.artifactId} + + target/${project.build.finalName}.jar + + + + + diff --git a/nla-order-service/Dockerfile b/nla-order-service/Dockerfile new file mode 100644 index 0000000..0ad2ed8 --- /dev/null +++ b/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"] diff --git a/nla-order-service/pom.xml b/nla-order-service/pom.xml index af7b3d0..cf00200 100644 --- a/nla-order-service/pom.xml +++ b/nla-order-service/pom.xml @@ -31,4 +31,36 @@ 4.10.218.ALL + + alibaba-cloud-order + + + org.springframework.boot + spring-boot-maven-plugin + + + + + repackage + + + + + true + true + + + + com.spotify + dockerfile-maven-plugin + 1.4.10 + + ${docker.image.prefix}/${project.artifactId} + + target/${project.build.finalName}.jar + + + + + diff --git a/nla-product-service/Dockerfile b/nla-product-service/Dockerfile new file mode 100644 index 0000000..0ad2ed8 --- /dev/null +++ b/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"] diff --git a/nla-product-service/pom.xml b/nla-product-service/pom.xml index d2d4835..711f7b1 100644 --- a/nla-product-service/pom.xml +++ b/nla-product-service/pom.xml @@ -29,4 +29,36 @@ spring-boot-starter-test + + alibaba-cloud-product + + + org.springframework.boot + spring-boot-maven-plugin + + + + + repackage + + + + + true + true + + + + com.spotify + dockerfile-maven-plugin + 1.4.10 + + ${docker.image.prefix}/${project.artifactId} + + target/${project.build.finalName}.jar + + + + + diff --git a/nla-user-service/Dockerfile b/nla-user-service/Dockerfile new file mode 100644 index 0000000..0ad2ed8 --- /dev/null +++ b/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"] diff --git a/nla-user-service/pom.xml b/nla-user-service/pom.xml index 11424a8..b7be47b 100644 --- a/nla-user-service/pom.xml +++ b/nla-user-service/pom.xml @@ -46,4 +46,36 @@ spring-boot-starter-test + + alibaba-cloud-user + + + org.springframework.boot + spring-boot-maven-plugin + + + + + repackage + + + + + true + true + + + + com.spotify + dockerfile-maven-plugin + 1.4.10 + + ${docker.image.prefix}/${project.artifactId} + + target/${project.build.finalName}.jar + + + + + diff --git a/pom.xml b/pom.xml index 7a144fd..544c7ae 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,7 @@ 3.9 1.15 3.0.0 - yuan-cloud + nla-cloud true