即使使用完全相同的参数运行,我的构建也会随机运行并随机挂起。我的复制任务后总是卡住(某些部分替换为 )
task createDocker(group: '<placeholder>', type: Docker) {
push = true
dockerfile = file(stageDir.getAbsolutePath()+"/Dockerfile")
project.group = "<placeholder>"
applicationName = "<placeholder>-clusterservice"
tagVersion = "${project.version}"
doFirst {
println ("Copying Dockerfile to staging area:" + stageDir.getAbsolutePath())
copy {
from "${project.projectDir}/src/main/docker/"
include "**/*"
into stageDir
}
println ("Getting artifact")
copy {
from "$distDir/${war.baseName}-${war.version}.war"
rename "${war.baseName}-${war.version}.war", "clusterservice.war"
into stageDir
}
}
}
Run Code Online (Sandbox Code Playgroud)
我用调试标志运行它,这是它工作时的样子:
[16:26:15] : [Step 1/1] 16:25:49.730 [QUIET] [system.out] Getting artifact
[16:26:15] : [Step 1/1] 16:25:50.041 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Execute doFirst {} …Run Code Online (Sandbox Code Playgroud)