The Unified and Autonomous Development Platform
chore: Enable variable interpolation for shell executable
Robin Shen4b157ac7b395
diff --git a/server-core/src/main/java/io/onedev/server/buildspec/step/commandinterpreter/PowerShellInterpreter.java b/server-core/src/main/java/io/onedev/server/buildspec/step/commandinterpreter/PowerShellInterpreter.javaindex 1a07501cb6..faf4e94c32 100644--- a/server-core/src/main/java/io/onedev/server/buildspec/step/commandinterpreter/PowerShellInterpreter.java+++ b/server-core/src/main/java/io/onedev/server/buildspec/step/commandinterpreter/PowerShellInterpreter.java@@ -17,6 +17,7 @@ public class PowerShellInterpreter extends Interpreter {private String powershell = "powershell.exe";@Editable(order=100, name="Executable", description="Specify powershell executable to be used")+ @Interpolative(variableSuggester = "suggestVariables")@NotEmptypublic String getPowershell() {return powershell;diff --git a/server-core/src/main/java/io/onedev/server/buildspec/step/commandinterpreter/ShellInterpreter.java b/server-core/src/main/java/io/onedev/server/buildspec/step/commandinterpreter/ShellInterpreter.javaindex 7453c2dbd7..ce2229c212 100644--- a/server-core/src/main/java/io/onedev/server/buildspec/step/commandinterpreter/ShellInterpreter.java+++ b/server-core/src/main/java/io/onedev/server/buildspec/step/commandinterpreter/ShellInterpreter.java@@ -1,13 +1,16 @@package io.onedev.server.buildspec.step.commandinterpreter;+import io.onedev.commons.codeassist.InputSuggestion;import io.onedev.k8shelper.CommandFacade;import io.onedev.k8shelper.ShellFacade;import io.onedev.server.annotation.Code;import io.onedev.server.annotation.Editable;import io.onedev.server.annotation.Interpolative;+import io.onedev.server.buildspec.BuildSpec;import io.onedev.server.model.support.administration.jobexecutor.JobExecutor;import javax.validation.constraints.NotEmpty;+import java.util.List;@Editable(order=200, name="Custom Linux Shell")public class ShellInterpreter extends Interpreter {@@ -17,6 +20,7 @@ public class ShellInterpreter extends Interpreter {private String shell = "bash";@Editable(order=100, name="Shell", description="Specify shell to be used")+ @Interpolative(variableSuggester = "suggestVariables")@NotEmptypublic String getShell() {return shell;@@ -40,7 +44,7 @@ public class ShellInterpreter extends Interpreter {public void setCommands(String commands) {super.setCommands(commands);}-+@Overridepublic CommandFacade getExecutable(JobExecutor jobExecutor, String jobToken, String image,String runAs, String builtInRegistryAccessToken, boolean useTTY) {