You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
546 lines
26 KiB
546 lines
26 KiB
|
4 weeks ago
|
<?xml version="1.0"?>
|
||
|
|
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||
|
|
<modelVersion>4.0.0</modelVersion>
|
||
|
|
<parent>
|
||
|
|
<groupId>com.techsor</groupId>
|
||
|
|
<artifactId>dongjian-center-admin</artifactId>
|
||
|
|
<version>0.0.1-SNAPSHOT</version>
|
||
|
|
</parent>
|
||
|
|
<artifactId>dongjian-center-admin-controller</artifactId>
|
||
|
|
<name>dongjian-center-admin-controller</name>
|
||
|
|
<url>http://maven.apache.org</url>
|
||
|
|
<properties>
|
||
|
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||
|
|
|
||
|
|
<aws.ecr.repository>tokyo-build-admin</aws.ecr.repository>
|
||
|
|
<aws.ecr.tag>latest</aws.ecr.tag>
|
||
|
|
<aws.ecr.region>ap-northeast-1</aws.ecr.region>
|
||
|
|
|
||
|
|
<aws.ecr.registry.test>923770123186.dkr.ecr.ap-northeast-1.amazonaws.com</aws.ecr.registry.test>
|
||
|
|
<aws.access.key.test>AKIA5OFH5OOZHM3U3KX4</aws.access.key.test>
|
||
|
|
<aws.secret.access.key.test>Plkid7RDnHc1gGbp2yAv/Scc+ukI0q8vzBuyEBN2</aws.secret.access.key.test>
|
||
|
|
|
||
|
|
<aws.ecr.registry.production>381659385655.dkr.ecr.ap-northeast-1.amazonaws.com</aws.ecr.registry.production>
|
||
|
|
<aws.access.key.production>AKIAVRXFMB43XVQ3GXAL</aws.access.key.production>
|
||
|
|
<aws.secret.access.key.production>G0FaGcizm8FlgLxZsL+8xBwfPSzQF71294nrtE2y</aws.secret.access.key.production>
|
||
|
|
|
||
|
|
</properties>
|
||
|
|
|
||
|
|
<dependencies>
|
||
|
|
|
||
|
|
<dependency>
|
||
|
|
<groupId>com.techsor</groupId>
|
||
|
|
<artifactId>dongjian-center-admin-service</artifactId>
|
||
|
|
<version>0.0.1-SNAPSHOT</version>
|
||
|
|
</dependency>
|
||
|
|
|
||
|
|
<dependency>
|
||
|
|
<groupId>com.techsor</groupId>
|
||
|
|
<artifactId>dongjian-center-admin-common</artifactId>
|
||
|
|
<version>0.0.1-SNAPSHOT</version>
|
||
|
|
</dependency>
|
||
|
|
<dependency>
|
||
|
|
<groupId>junit</groupId>
|
||
|
|
<artifactId>junit</artifactId>
|
||
|
|
<scope>test</scope>
|
||
|
|
</dependency>
|
||
|
|
|
||
|
|
</dependencies>
|
||
|
|
|
||
|
|
<profiles>
|
||
|
|
<profile>
|
||
|
|
<id>only-package</id>
|
||
|
|
<activation>
|
||
|
|
<activeByDefault>true</activeByDefault>
|
||
|
|
</activation>
|
||
|
|
<build>
|
||
|
|
<!-- 项目的打包配置 -->
|
||
|
|
<plugins>
|
||
|
|
<!-- 自定义打zip包 -->
|
||
|
|
<plugin>
|
||
|
|
<groupId>org.apache.maven.plugins</groupId>
|
||
|
|
<artifactId>maven-assembly-plugin</artifactId>
|
||
|
|
<configuration>
|
||
|
|
<finalName>dongjian-center-admin</finalName>
|
||
|
|
<descriptors>
|
||
|
|
<descriptor>src/main/resources/assembly.xml</descriptor>
|
||
|
|
</descriptors>
|
||
|
|
<appendAssemblyId>false</appendAssemblyId>
|
||
|
|
</configuration>
|
||
|
|
<executions>
|
||
|
|
<execution>
|
||
|
|
<id>make-assembly</id>
|
||
|
|
<phase>package</phase>
|
||
|
|
<goals>
|
||
|
|
<goal>single</goal>
|
||
|
|
</goals>
|
||
|
|
</execution>
|
||
|
|
</executions>
|
||
|
|
</plugin>
|
||
|
|
</plugins>
|
||
|
|
</build>
|
||
|
|
</profile>
|
||
|
|
<profile>
|
||
|
|
<id>docker-package</id>
|
||
|
|
<build>
|
||
|
|
<!-- 先用dockerfile-maven-plugin构建镜像,然后maven-antrun-plugin执行推送aws ecr的命令 -->
|
||
|
|
<plugins>
|
||
|
|
<plugin>
|
||
|
|
<groupId>com.google.cloud.tools</groupId>
|
||
|
|
<artifactId>jib-maven-plugin</artifactId>
|
||
|
|
<version>3.4.5</version>
|
||
|
|
<configuration>
|
||
|
|
<from>
|
||
|
|
<![CDATA[
|
||
|
|
<!--
|
||
|
|
这里先登录【docker login --username=409950420@qq.com registry.ap-northeast-1.aliyuncs.com】,
|
||
|
|
然后【docker pull registry.ap-northeast-1.aliyuncs.com/southwave/jdk17-template:latest】到本地,
|
||
|
|
再docker://使用本地镜像
|
||
|
|
-->
|
||
|
|
]]>
|
||
|
|
<image>docker://registry.ap-northeast-1.aliyuncs.com/southwave/jdk17-template:latest</image>
|
||
|
|
</from>
|
||
|
|
<to>
|
||
|
|
<image>registry.cn-shanghai.aliyuncs.com/clouddog/datacenter-admin:${aws.ecr.tag}</image>
|
||
|
|
</to>
|
||
|
|
<container>
|
||
|
|
<workingDirectory>/home/dongjian-center-admin</workingDirectory>
|
||
|
|
<environment>
|
||
|
|
<TZ>Asia/Tokyo</TZ>
|
||
|
|
</environment>
|
||
|
|
<entrypoint>
|
||
|
|
<entrypoint>java</entrypoint>
|
||
|
|
<entrypoint>-jar</entrypoint>
|
||
|
|
<entrypoint>${project.build.finalName}.jar</entrypoint>
|
||
|
|
</entrypoint>
|
||
|
|
</container>
|
||
|
|
<extraDirectories>
|
||
|
|
<paths>
|
||
|
|
<path>
|
||
|
|
<from>${project.build.directory}</from>
|
||
|
|
<includes>${project.build.finalName}.jar</includes>
|
||
|
|
<into>/home/dongjian-center-admin/</into>
|
||
|
|
</path>
|
||
|
|
<path>
|
||
|
|
<from>${project.build.directory}</from>
|
||
|
|
<includes>lib/**</includes>
|
||
|
|
<into>/home/dongjian-center-admin/</into>
|
||
|
|
</path>
|
||
|
|
<path>
|
||
|
|
<from>${project.build.directory}</from>
|
||
|
|
<includes>config/**</includes>
|
||
|
|
<into>/home/dongjian-center-admin/</into>
|
||
|
|
</path>
|
||
|
|
<path>
|
||
|
|
<from>${project.build.directory}</from>
|
||
|
|
<includes>aurora_terraform/**</includes>
|
||
|
|
<into>/home/dongjian-center-admin/</into>
|
||
|
|
</path>
|
||
|
|
</paths>
|
||
|
|
<permissions>
|
||
|
|
<permission>
|
||
|
|
<file>/home/dongjian-center-admin/lib</file>
|
||
|
|
<mode>755</mode>
|
||
|
|
</permission>
|
||
|
|
<permission>
|
||
|
|
<file>/home/dongjian-center-admin/config</file>
|
||
|
|
<mode>755</mode>
|
||
|
|
</permission>
|
||
|
|
<permission>
|
||
|
|
<file>/home/dongjian-center-admin/aurora_terraform</file>
|
||
|
|
<mode>755</mode>
|
||
|
|
</permission>
|
||
|
|
</permissions>
|
||
|
|
</extraDirectories>
|
||
|
|
</configuration>
|
||
|
|
<executions>
|
||
|
|
<execution>
|
||
|
|
<phase>package</phase>
|
||
|
|
<goals>
|
||
|
|
<!-- 本地,使用dockerBuild目标而不是build -->
|
||
|
|
<goal>dockerBuild</goal>
|
||
|
|
</goals>
|
||
|
|
</execution>
|
||
|
|
</executions>
|
||
|
|
</plugin>
|
||
|
|
</plugins>
|
||
|
|
</build>
|
||
|
|
</profile>
|
||
|
|
<profile>
|
||
|
|
<id>docker-aliyun</id>
|
||
|
|
<build>
|
||
|
|
<!-- 先用dockerfile-maven-plugin构建镜像,然后maven-antrun-plugin执行推送aws ecr的命令 -->
|
||
|
|
<plugins>
|
||
|
|
<plugin>
|
||
|
|
<groupId>com.google.cloud.tools</groupId>
|
||
|
|
<artifactId>jib-maven-plugin</artifactId>
|
||
|
|
<version>3.4.5</version>
|
||
|
|
<configuration>
|
||
|
|
<from>
|
||
|
|
<![CDATA[
|
||
|
|
<!--
|
||
|
|
这里先登录【docker login --username=409950420@qq.com registry.ap-northeast-1.aliyuncs.com】,
|
||
|
|
然后【docker pull registry.ap-northeast-1.aliyuncs.com/southwave/jdk17-template:latest】到本地,
|
||
|
|
再docker://使用本地镜像
|
||
|
|
-->
|
||
|
|
]]>
|
||
|
|
<image>docker://registry.ap-northeast-1.aliyuncs.com/southwave/jdk17-template:latest</image>
|
||
|
|
</from>
|
||
|
|
<to>
|
||
|
|
<image>${aws.ecr.registry.test}/${aws.ecr.repository}:${aws.ecr.tag}</image>
|
||
|
|
</to>
|
||
|
|
<container>
|
||
|
|
<workingDirectory>/home/dongjian-center-admin</workingDirectory>
|
||
|
|
<environment>
|
||
|
|
<TZ>Asia/Tokyo</TZ>
|
||
|
|
</environment>
|
||
|
|
<entrypoint>
|
||
|
|
<entrypoint>java</entrypoint>
|
||
|
|
<entrypoint>-jar</entrypoint>
|
||
|
|
<entrypoint>${project.build.finalName}.jar</entrypoint>
|
||
|
|
</entrypoint>
|
||
|
|
</container>
|
||
|
|
<extraDirectories>
|
||
|
|
<paths>
|
||
|
|
<path>
|
||
|
|
<from>${project.build.directory}</from>
|
||
|
|
<includes>${project.build.finalName}.jar</includes>
|
||
|
|
<into>/home/dongjian-center-admin/</into>
|
||
|
|
</path>
|
||
|
|
<path>
|
||
|
|
<from>${project.build.directory}</from>
|
||
|
|
<includes>lib/**</includes>
|
||
|
|
<into>/home/dongjian-center-admin/</into>
|
||
|
|
</path>
|
||
|
|
<path>
|
||
|
|
<from>${project.build.directory}</from>
|
||
|
|
<includes>config/**</includes>
|
||
|
|
<into>/home/dongjian-center-admin/</into>
|
||
|
|
</path>
|
||
|
|
<path>
|
||
|
|
<from>${project.build.directory}</from>
|
||
|
|
<includes>aurora_terraform/**</includes>
|
||
|
|
<into>/home/dongjian-center-admin/</into>
|
||
|
|
</path>
|
||
|
|
</paths>
|
||
|
|
<permissions>
|
||
|
|
<permission>
|
||
|
|
<file>/home/dongjian-center-admin/lib</file>
|
||
|
|
<mode>755</mode>
|
||
|
|
</permission>
|
||
|
|
<permission>
|
||
|
|
<file>/home/dongjian-center-admin/config</file>
|
||
|
|
<mode>755</mode>
|
||
|
|
</permission>
|
||
|
|
<permission>
|
||
|
|
<file>/home/dongjian-center-admin/aurora_terraform</file>
|
||
|
|
<mode>755</mode>
|
||
|
|
</permission>
|
||
|
|
</permissions>
|
||
|
|
</extraDirectories>
|
||
|
|
</configuration>
|
||
|
|
<executions>
|
||
|
|
<execution>
|
||
|
|
<phase>package</phase>
|
||
|
|
<goals>
|
||
|
|
<!-- 本地,使用dockerBuild目标而不是build -->
|
||
|
|
<goal>dockerBuild</goal>
|
||
|
|
</goals>
|
||
|
|
</execution>
|
||
|
|
</executions>
|
||
|
|
</plugin>
|
||
|
|
<!-- maven-antrun-plugin执行推送aws ecr的命令 -->
|
||
|
|
<plugin>
|
||
|
|
<groupId>org.apache.maven.plugins</groupId>
|
||
|
|
<artifactId>maven-antrun-plugin</artifactId>
|
||
|
|
<version>3.0.0</version>
|
||
|
|
<executions>
|
||
|
|
<execution>
|
||
|
|
<!--放在package阶段后面执行-->
|
||
|
|
<phase>package</phase>
|
||
|
|
<goals>
|
||
|
|
<goal>run</goal>
|
||
|
|
</goals>
|
||
|
|
<configuration>
|
||
|
|
<target>
|
||
|
|
<!-- Run AWS ECR login command using Ant tasks -->
|
||
|
|
<exec executable="cmd" osfamily="windows">
|
||
|
|
<arg value="/c" />
|
||
|
|
<arg value="docker login --username=409950420@qq.com registry.cn-shanghai.aliyuncs.com --password=Youqu48bnb1." />
|
||
|
|
</exec>
|
||
|
|
<exec executable="cmd" osfamily="windows">
|
||
|
|
<arg value="/c" />
|
||
|
|
<arg value="docker push registry.cn-shanghai.aliyuncs.com/clouddog/datacenter-admin:${aws.ecr.tag}" />
|
||
|
|
</exec>
|
||
|
|
</target>
|
||
|
|
</configuration>
|
||
|
|
</execution>
|
||
|
|
</executions>
|
||
|
|
</plugin>
|
||
|
|
</plugins>
|
||
|
|
</build>
|
||
|
|
</profile>
|
||
|
|
<profile>
|
||
|
|
<id>docker-test</id>
|
||
|
|
<build>
|
||
|
|
<!-- 先用dockerfile-maven-plugin构建镜像,然后maven-antrun-plugin执行推送aws ecr的命令 -->
|
||
|
|
<plugins>
|
||
|
|
<plugin>
|
||
|
|
<groupId>com.google.cloud.tools</groupId>
|
||
|
|
<artifactId>jib-maven-plugin</artifactId>
|
||
|
|
<version>3.4.5</version>
|
||
|
|
<configuration>
|
||
|
|
<from>
|
||
|
|
<![CDATA[
|
||
|
|
<!--
|
||
|
|
这里先登录【docker login --username=409950420@qq.com registry.ap-northeast-1.aliyuncs.com】,
|
||
|
|
然后【docker pull registry.ap-northeast-1.aliyuncs.com/southwave/jdk17-template:latest】到本地,
|
||
|
|
再docker://使用本地镜像
|
||
|
|
-->
|
||
|
|
]]>
|
||
|
|
<image>docker://registry.ap-northeast-1.aliyuncs.com/southwave/jdk17-template:latest</image>
|
||
|
|
</from>
|
||
|
|
<to>
|
||
|
|
<image>${aws.ecr.registry.test}/${aws.ecr.repository}:${aws.ecr.tag}</image>
|
||
|
|
</to>
|
||
|
|
<container>
|
||
|
|
<workingDirectory>/home/dongjian-center-admin</workingDirectory>
|
||
|
|
<environment>
|
||
|
|
<TZ>Asia/Tokyo</TZ>
|
||
|
|
</environment>
|
||
|
|
<entrypoint>
|
||
|
|
<entrypoint>java</entrypoint>
|
||
|
|
<entrypoint>-jar</entrypoint>
|
||
|
|
<entrypoint>${project.build.finalName}.jar</entrypoint>
|
||
|
|
</entrypoint>
|
||
|
|
</container>
|
||
|
|
<extraDirectories>
|
||
|
|
<paths>
|
||
|
|
<path>
|
||
|
|
<from>${project.build.directory}</from>
|
||
|
|
<includes>${project.build.finalName}.jar</includes>
|
||
|
|
<into>/home/dongjian-center-admin/</into>
|
||
|
|
</path>
|
||
|
|
<path>
|
||
|
|
<from>${project.build.directory}</from>
|
||
|
|
<includes>lib/**</includes>
|
||
|
|
<into>/home/dongjian-center-admin/</into>
|
||
|
|
</path>
|
||
|
|
<path>
|
||
|
|
<from>${project.build.directory}</from>
|
||
|
|
<includes>config/**</includes>
|
||
|
|
<into>/home/dongjian-center-admin/</into>
|
||
|
|
</path>
|
||
|
|
<path>
|
||
|
|
<from>${project.build.directory}</from>
|
||
|
|
<includes>aurora_terraform/**</includes>
|
||
|
|
<into>/home/dongjian-center-admin/</into>
|
||
|
|
</path>
|
||
|
|
</paths>
|
||
|
|
<permissions>
|
||
|
|
<permission>
|
||
|
|
<file>/home/dongjian-center-admin/lib</file>
|
||
|
|
<mode>755</mode>
|
||
|
|
</permission>
|
||
|
|
<permission>
|
||
|
|
<file>/home/dongjian-center-admin/config</file>
|
||
|
|
<mode>755</mode>
|
||
|
|
</permission>
|
||
|
|
<permission>
|
||
|
|
<file>/home/dongjian-center-admin/aurora_terraform</file>
|
||
|
|
<mode>755</mode>
|
||
|
|
</permission>
|
||
|
|
</permissions>
|
||
|
|
</extraDirectories>
|
||
|
|
</configuration>
|
||
|
|
<executions>
|
||
|
|
<execution>
|
||
|
|
<phase>package</phase>
|
||
|
|
<goals>
|
||
|
|
<!-- 本地,使用dockerBuild目标而不是build -->
|
||
|
|
<goal>dockerBuild</goal>
|
||
|
|
</goals>
|
||
|
|
</execution>
|
||
|
|
</executions>
|
||
|
|
</plugin>
|
||
|
|
<!-- maven-antrun-plugin执行推送aws ecr的命令 -->
|
||
|
|
<plugin>
|
||
|
|
<groupId>org.apache.maven.plugins</groupId>
|
||
|
|
<artifactId>maven-antrun-plugin</artifactId>
|
||
|
|
<version>3.0.0</version>
|
||
|
|
<executions>
|
||
|
|
<execution>
|
||
|
|
<!--放在package阶段后面执行-->
|
||
|
|
<phase>package</phase>
|
||
|
|
<goals>
|
||
|
|
<goal>run</goal>
|
||
|
|
</goals>
|
||
|
|
<configuration>
|
||
|
|
<target>
|
||
|
|
<!-- Run AWS ECR login command using Ant tasks -->
|
||
|
|
<exec executable="cmd" osfamily="windows">
|
||
|
|
<arg value="/c" />
|
||
|
|
<arg value="aws configure set aws_access_key_id ${aws.access.key.test}" />
|
||
|
|
</exec>
|
||
|
|
<exec executable="cmd" osfamily="windows">
|
||
|
|
<arg value="/c" />
|
||
|
|
<arg value="aws configure set aws_secret_access_key ${aws.secret.access.key.test}" />
|
||
|
|
</exec>
|
||
|
|
<exec executable="cmd" osfamily="windows">
|
||
|
|
<arg value="/c" />
|
||
|
|
<arg value="aws configure set default.region ${aws.ecr.region}" />
|
||
|
|
</exec>
|
||
|
|
<exec executable="cmd" osfamily="windows">
|
||
|
|
<arg value="/c" />
|
||
|
|
<arg value="aws configure set default.output text" />
|
||
|
|
</exec>
|
||
|
|
<exec executable="cmd" osfamily="windows">
|
||
|
|
<arg value="/c" />
|
||
|
|
<arg value="aws ecr get-login-password --region ${aws.ecr.region} | docker login --username AWS --password-stdin ${aws.ecr.registry.test}" />
|
||
|
|
</exec>
|
||
|
|
<exec executable="cmd" osfamily="windows">
|
||
|
|
<arg value="/c" />
|
||
|
|
<arg value="docker push ${aws.ecr.registry.test}/${aws.ecr.repository}:${aws.ecr.tag}" />
|
||
|
|
</exec>
|
||
|
|
</target>
|
||
|
|
</configuration>
|
||
|
|
</execution>
|
||
|
|
</executions>
|
||
|
|
</plugin>
|
||
|
|
</plugins>
|
||
|
|
</build>
|
||
|
|
</profile>
|
||
|
|
<profile>
|
||
|
|
<id>docker-production</id>
|
||
|
|
<build>
|
||
|
|
<!-- 先用dockerfile-maven-plugin构建镜像,然后maven-antrun-plugin执行推送aws ecr的命令 -->
|
||
|
|
<plugins>
|
||
|
|
<plugin>
|
||
|
|
<groupId>com.google.cloud.tools</groupId>
|
||
|
|
<artifactId>jib-maven-plugin</artifactId>
|
||
|
|
<version>3.4.5</version>
|
||
|
|
<configuration>
|
||
|
|
<from>
|
||
|
|
<![CDATA[
|
||
|
|
<!--
|
||
|
|
这里先登录【docker login --username=409950420@qq.com registry.ap-northeast-1.aliyuncs.com】,
|
||
|
|
然后【docker pull registry.ap-northeast-1.aliyuncs.com/southwave/jdk17-template:latest】到本地,
|
||
|
|
再docker://使用本地镜像
|
||
|
|
-->
|
||
|
|
]]>
|
||
|
|
<image>docker://registry.ap-northeast-1.aliyuncs.com/southwave/jdk17-template:latest</image>
|
||
|
|
</from>
|
||
|
|
<to>
|
||
|
|
<image>${aws.ecr.registry.production}/${aws.ecr.repository}:${aws.ecr.tag}</image>
|
||
|
|
</to>
|
||
|
|
<container>
|
||
|
|
<workingDirectory>/home/dongjian-center-admin</workingDirectory>
|
||
|
|
<environment>
|
||
|
|
<TZ>Asia/Tokyo</TZ>
|
||
|
|
</environment>
|
||
|
|
<entrypoint>
|
||
|
|
<entrypoint>java</entrypoint>
|
||
|
|
<entrypoint>-jar</entrypoint>
|
||
|
|
<entrypoint>${project.build.finalName}.jar</entrypoint>
|
||
|
|
</entrypoint>
|
||
|
|
</container>
|
||
|
|
<extraDirectories>
|
||
|
|
<paths>
|
||
|
|
<path>
|
||
|
|
<from>${project.build.directory}</from>
|
||
|
|
<includes>${project.build.finalName}.jar</includes>
|
||
|
|
<into>/home/dongjian-center-admin/</into>
|
||
|
|
</path>
|
||
|
|
<path>
|
||
|
|
<from>${project.build.directory}</from>
|
||
|
|
<includes>lib/**</includes>
|
||
|
|
<into>/home/dongjian-center-admin/</into>
|
||
|
|
</path>
|
||
|
|
<path>
|
||
|
|
<from>${project.build.directory}</from>
|
||
|
|
<includes>config/**</includes>
|
||
|
|
<into>/home/dongjian-center-admin/</into>
|
||
|
|
</path>
|
||
|
|
<path>
|
||
|
|
<from>${project.build.directory}</from>
|
||
|
|
<includes>aurora_terraform/**</includes>
|
||
|
|
<into>/home/dongjian-center-admin/</into>
|
||
|
|
</path>
|
||
|
|
</paths>
|
||
|
|
<permissions>
|
||
|
|
<permission>
|
||
|
|
<file>/home/dongjian-center-admin/lib</file>
|
||
|
|
<mode>755</mode>
|
||
|
|
</permission>
|
||
|
|
<permission>
|
||
|
|
<file>/home/dongjian-center-admin/config</file>
|
||
|
|
<mode>755</mode>
|
||
|
|
</permission>
|
||
|
|
<permission>
|
||
|
|
<file>/home/dongjian-center-admin/aurora_terraform</file>
|
||
|
|
<mode>755</mode>
|
||
|
|
</permission>
|
||
|
|
</permissions>
|
||
|
|
</extraDirectories>
|
||
|
|
</configuration>
|
||
|
|
<executions>
|
||
|
|
<execution>
|
||
|
|
<phase>package</phase>
|
||
|
|
<goals>
|
||
|
|
<goal>build</goal>
|
||
|
|
</goals>
|
||
|
|
</execution>
|
||
|
|
</executions>
|
||
|
|
</plugin>
|
||
|
|
<!-- maven-antrun-plugin执行推送aws ecr的命令 -->
|
||
|
|
<plugin>
|
||
|
|
<groupId>org.apache.maven.plugins</groupId>
|
||
|
|
<artifactId>maven-antrun-plugin</artifactId>
|
||
|
|
<version>3.0.0</version>
|
||
|
|
<executions>
|
||
|
|
<execution>
|
||
|
|
<!--放在package阶段后面执行-->
|
||
|
|
<phase>package</phase>
|
||
|
|
<goals>
|
||
|
|
<goal>run</goal>
|
||
|
|
</goals>
|
||
|
|
<configuration>
|
||
|
|
<target>
|
||
|
|
<!-- Run AWS ECR login command using Ant tasks -->
|
||
|
|
<exec executable="cmd" osfamily="windows">
|
||
|
|
<arg value="/c" />
|
||
|
|
<arg value="aws configure set aws_access_key_id ${aws.access.key.production}" />
|
||
|
|
</exec>
|
||
|
|
<exec executable="cmd" osfamily="windows">
|
||
|
|
<arg value="/c" />
|
||
|
|
<arg value="aws configure set aws_secret_access_key ${aws.secret.access.key.production}" />
|
||
|
|
</exec>
|
||
|
|
<exec executable="cmd" osfamily="windows">
|
||
|
|
<arg value="/c" />
|
||
|
|
<arg value="aws configure set default.region ${aws.ecr.region}" />
|
||
|
|
</exec>
|
||
|
|
<exec executable="cmd" osfamily="windows">
|
||
|
|
<arg value="/c" />
|
||
|
|
<arg value="aws configure set default.output text" />
|
||
|
|
</exec>
|
||
|
|
<exec executable="cmd" osfamily="windows">
|
||
|
|
<arg value="/c" />
|
||
|
|
<arg value="aws ecr get-login-password --region ${aws.ecr.region} | docker login --username AWS --password-stdin ${aws.ecr.registry.production}" />
|
||
|
|
</exec>
|
||
|
|
<exec executable="cmd" osfamily="windows">
|
||
|
|
<arg value="/c" />
|
||
|
|
<arg value="docker push ${aws.ecr.registry.production}/${aws.ecr.repository}:${aws.ecr.tag}" />
|
||
|
|
</exec>
|
||
|
|
</target>
|
||
|
|
</configuration>
|
||
|
|
</execution>
|
||
|
|
</executions>
|
||
|
|
</plugin>
|
||
|
|
</plugins>
|
||
|
|
</build>
|
||
|
|
</profile>
|
||
|
|
</profiles>
|
||
|
|
|
||
|
|
</project>
|