Skip to content

The Unified and Autonomous Development Platform

Bug fixes for server shell executor

Robin Shen02fd9415bac4
diff --git a/server-core/src/main/java/io/onedev/server/buildspec/job/CacheSpec.java b/server-core/src/main/java/io/onedev/server/buildspec/job/CacheSpec.java
index ce51a51b3f..85f8e71b5b 100644
--- a/server-core/src/main/java/io/onedev/server/buildspec/job/CacheSpec.java
+++ b/server-core/src/main/java/io/onedev/server/buildspec/job/CacheSpec.java
@@ -10,7 +10,6 @@ import org.hibernate.validator.constraints.NotEmpty;
import io.onedev.commons.codeassist.InputSuggestion;
import io.onedev.k8shelper.KubernetesHelper;
import io.onedev.server.buildspec.BuildSpec;
-import io.onedev.server.util.validation.annotation.Path;
import io.onedev.server.util.validation.annotation.RegEx;
import io.onedev.server.web.editable.annotation.Editable;
import io.onedev.server.web.editable.annotation.Interpolative;
@@ -41,7 +40,6 @@ public class CacheSpec implements Serializable {
+ "Specify \".\" (without quote) to cache workspace itself. "
+ "<span class='text-warning'>Absolute path is not allowed if the job is executed by a shell/batch executor</span>")
@Interpolative(variableSuggester="suggestVariables", literalSuggester="suggestPaths")
- @Path
@NotEmpty
public String getPath() {
return path;
diff --git a/server-core/src/main/java/io/onedev/server/web/page/admin/buildsetting/agent/AgentDownloadPanel.html b/server-core/src/main/java/io/onedev/server/web/page/admin/buildsetting/agent/AgentDownloadPanel.html
index 55faf5a957..1837a00271 100644
--- a/server-core/src/main/java/io/onedev/server/web/page/admin/buildsetting/agent/AgentDownloadPanel.html
+++ b/server-core/src/main/java/io/onedev/server/web/page/admin/buildsetting/agent/AgentDownloadPanel.html
@@ -6,12 +6,17 @@
<li>On remote machine (Windows/Mac/Linux/FreeBSD) where you want to install agent:</li>
<ol>
<li>Make sure <a href="https://openjdk.java.net" target="_blank">JDK 1.8 or higher</a> is installed</li>
- <li>Make sure docker engine is installed and docker command line is available in system path</li>
- <li>Make sure current user has permission to run docker containers</li>
+ <li>
+ If you plan to use the agent to run docker jobs, make sure that:
+ <ul>
+ <li>Docker engine is installed and docker command line is available in system path</li>
+ <li>Make sure current user has permission to run docker containers</li>
+ </ul>
+ </li>
<li>Make sure git version 2.11.1 or higher is installed and available in system path</li>
<li>Download <a wicket:id="agent" class="link-primary">agent package</a>. A new agent token will be included in the package</li>
<li>Extract the package into a folder</li>
- <li>From extracted folder, run <code>bin\agent.bat console</code> on Windows or <code>bin/agent.sh console</code> on other OS</li>
+ <li>From extracted folder, run <code>bin\agent.bat console</code> as administrator on Windows or <code>bin/agent.sh console</code> on other OS </li>
</ol>
<li>Check <a wicket:id="agentManagement" class="link-primary" target="_blank">agent management</a> for more details, such as running as service etc.</li>
</ul>
diff --git a/server-plugin/server-plugin-executor-servershell/src/main/java/io/onedev/server/plugin/executor/servershell/ServerShellExecutor.java b/server-plugin/server-plugin-executor-servershell/src/main/java/io/onedev/server/plugin/executor/servershell/ServerShellExecutor.java
index 8d195d785c..88f41e608d 100644
--- a/server-plugin/server-plugin-executor-servershell/src/main/java/io/onedev/server/plugin/executor/servershell/ServerShellExecutor.java
+++ b/server-plugin/server-plugin-executor-servershell/src/main/java/io/onedev/server/plugin/executor/servershell/ServerShellExecutor.java
@@ -124,6 +124,9 @@ public class ServerShellExecutor extends JobExecutor implements Testable<TestDat
FileUtils.createDir(workspaceDir);
}
+ jobLogger.log("Copying job dependencies...");
+ jobContext.copyDependencies(workspaceDir);
+
File userDir = new File(buildDir, "user");
FileUtils.createDir(userDir);
Map<String, String> environments = new HashMap<>();