Commit 5a75c80b by 钟明宏

update

parent be1c2b59
......@@ -393,7 +393,7 @@ public class BuildMojo extends AbstractDockerMojo {
getLog().debug(errorMessage);
}
} else {
getLog().info("获取git提交ID:"+commitId);
getLog().info("获取git提交ID:" + commitId);
mavenProject.getProperties().put("gitShortCommitId", commitId);
if (imageName != null) {
imageName = expand(imageName);
......@@ -813,6 +813,7 @@ public class BuildMojo extends AbstractDockerMojo {
/**
* 复制文件
*
* @param destination
* @return
* @throws IOException
......@@ -829,14 +830,16 @@ public class BuildMojo extends AbstractDockerMojo {
final List<String> excludes = resource.getExcludes();
final DirectoryScanner scanner = new DirectoryScanner();
scanner.setBasedir(source);
//如果includes/excludes是一个空的集合,则传递一个控制来获得一个默认的过滤器
// must pass null if includes/excludes is empty to get default filters.
//如果传递一个空的数组,将获取不到过滤器
// passing zero length array forces it to have no filters at all.
scanner.setIncludes(includes.isEmpty() ? null
: includes.toArray(new String[includes.size()]));
scanner.setExcludes(excludes.isEmpty() ? null
: excludes.toArray(new String[excludes.size()]));
scanner.scan();
//获取到满足条件的文件
final String[] includedFiles = scanner.getIncludedFiles();
if (includedFiles.length == 0) {
getLog().info("No resources will be copied, no files match specified patterns");
......
......@@ -26,10 +26,10 @@
<env>
<FOO>BAR</FOO>
</env>
<healthcheck>
<healthCheck>
<options>--interval=30s</options>
<cmd>curl --fail http://localhost:8080/ || exit 1</cmd>
</healthcheck>
</healthCheck>
<exposes>
<expose>8081</expose>
<expose>8080</expose>
......@@ -54,7 +54,7 @@
<run>ln -s /a /b</run>
<run>wget 127.0.0.1:8080</run>
</runs>
<workdir>/opt/app</workdir>
<workDir>/opt/app</workDir>
<user>app</user>
</configuration>
</plugin>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment