feat:添加jib插件构建镜像上传至阿里云镜像仓库

This commit is contained in:
hxrui 2021-02-19 20:16:05 +08:00
parent 7dedb5194d
commit 8810a0e441
3 changed files with 37 additions and 9 deletions

View File

@ -29,12 +29,13 @@
</parent> </parent>
<properties> <properties>
<youlai.version>1.0.0</youlai.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<lombok.version>1.18.18</lombok.version>
<spring-cloud.version>2020.0.1</spring-cloud.version> <spring-cloud.version>2020.0.1</spring-cloud.version>
<spring-cloud-alibaba.version>2.2.5.RELEASE</spring-cloud-alibaba.version> <spring-cloud-alibaba.version>2.2.5.RELEASE</spring-cloud-alibaba.version>
<lombok.version>1.18.18</lombok.version>
<hutool.version>5.5.8</hutool.version> <hutool.version>5.5.8</hutool.version>
<mysql.version>8.0.19</mysql.version> <mysql.version>8.0.19</mysql.version>
<druid.version>1.2.4</druid.version> <druid.version>1.2.4</druid.version>

View File

@ -3,9 +3,7 @@ package com.youlai.common.web.util;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.youlai.common.constant.AuthConstants; import com.youlai.common.constant.AuthConstants;
import com.youlai.common.result.ResultCode;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.http.server.reactive.ServerHttpResponse;
import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.context.request.ServletRequestAttributes;
@ -43,10 +41,4 @@ public class WebUtils extends org.springframework.web.util.WebUtils {
List<Long> authorities = list.stream().map(Long::valueOf).collect(Collectors.toList()); List<Long> authorities = list.stream().map(Long::valueOf).collect(Collectors.toList());
return authorities; return authorities;
} }
public static ServerHttpResponse getServerHttpResponse(ResultCode resultCode){
return null;
}
} }

View File

@ -81,6 +81,41 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
</plugin> </plugin>
<!-- Jib插件构建镜像上传至阿里云镜像仓库 -->
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>2.7.1</version>
<configuration>
<from>
<image>openjdk:8-jdk-alpine</image>
</from>
<to>
<!-- 阿里云镜像仓库公网地址-->
<image>registry.cn-shanghai.aliyuncs.com/youlai/youlai-gateway</image>
<!-- 镜像版本号 -->
<tags>
<tag>latest</tag>
</tags>
<auth>
<username>1490493387@qq.com</username>
<password>hxr1006111026</password>
</auth>
</to>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- docker-maven-plugin 构建镜像上传至云服务器 -->
<plugin> <plugin>
<groupId>com.spotify</groupId> <groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId> <artifactId>docker-maven-plugin</artifactId>