• ■ ■ ■ ■
    pom.xml
    skipped 9 lines
    10 10   <version>1.0.5</version>
    11 11   </parent>
    12 12   <artifactId>k8s-helper</artifactId>
    13  - <version>2.5.0</version>
     13 + <version>2.5.1</version>
    14 14   <build>
    15 15   <plugins>
    16 16   <plugin>
    skipped 79 lines
  • ■ ■ ■ ■ ■ ■
    src/main/java/io/onedev/k8shelper/Action.java
    skipped 9 lines
    10 10  
    11 11   private final ExecuteCondition condition;
    12 12  
    13  - private final Executable executable;
     13 + private final StepFacade executable;
    14 14  
    15  - public Action(String name, Executable executable, ExecuteCondition condition) {
     15 + public Action(String name, StepFacade executable, ExecuteCondition condition) {
    16 16   this.name = name;
    17 17   this.executable = executable;
    18 18   this.condition = condition;
    skipped 3 lines
    22 22   return name;
    23 23   }
    24 24   
    25  - public Executable getExecutable() {
     25 + public StepFacade getExecutable() {
    26 26   return executable;
    27 27   }
    28 28   
    skipped 6 lines
  • ■ ■ ■ ■ ■ ■
    src/main/java/io/onedev/k8shelper/BashExecutable.java src/main/java/io/onedev/k8shelper/BashFacade.java
    skipped 5 lines
    6 6   
    7 7  import io.onedev.commons.utils.command.Commandline;
    8 8   
    9  -public class BashExecutable extends CommandExecutable {
     9 +public class BashFacade extends CommandFacade {
    10 10   
    11 11   private static final long serialVersionUID = 1L;
    12 12   
    13  - public BashExecutable(@Nullable String image, List<String> commands, boolean useTTY) {
     13 + public BashFacade(@Nullable String image, List<String> commands, boolean useTTY) {
    14 14   super(image, commands, useTTY);
    15 15   }
    16 16   
    skipped 16 lines
  • ■ ■ ■ ■ ■ ■
    src/main/java/io/onedev/k8shelper/BuildImageFacade.java
     1 +package io.onedev.k8shelper;
     2 + 
     3 +import javax.annotation.Nullable;
     4 + 
     5 +public class BuildImageFacade extends LeafFacade {
     6 + 
     7 + private static final long serialVersionUID = 1L;
     8 + 
     9 + private final String buildPath;
     10 +
     11 + private final String dockerfile;
     12 +
     13 + private final String tags;
     14 +
     15 + private final boolean publish;
     16 +
     17 + public BuildImageFacade(@Nullable String buildPath, @Nullable String dockerFile, String tags, boolean publish) {
     18 + this.buildPath = buildPath;
     19 + this.dockerfile = dockerFile;
     20 + this.tags = tags;
     21 + this.publish = publish;
     22 + }
     23 + 
     24 + @Nullable
     25 + public String getBuildPath() {
     26 + return buildPath;
     27 + }
     28 + 
     29 + @Nullable
     30 + public String getDockerfile() {
     31 + return dockerfile;
     32 + }
     33 + 
     34 + public String getTags() {
     35 + return tags;
     36 + }
     37 + 
     38 + public boolean isPublish() {
     39 + return publish;
     40 + }
     41 + 
     42 +}
     43 + 
  • ■ ■ ■ ■ ■ ■
    src/main/java/io/onedev/k8shelper/CheckoutExecutable.java src/main/java/io/onedev/k8shelper/CheckoutFacade.java
    1 1  package io.onedev.k8shelper;
    2 2   
    3  -public class CheckoutExecutable extends LeafExecutable {
     3 +public class CheckoutFacade extends LeafFacade {
    4 4   
    5 5   private static final long serialVersionUID = 1L;
    6 6   
    skipped 5 lines
    12 12  
    13 13   private final CloneInfo cloneInfo;
    14 14  
    15  - public CheckoutExecutable(int cloneDepth, boolean withLfs, boolean withSubmodules, CloneInfo cloneInfo) {
     15 + public CheckoutFacade(int cloneDepth, boolean withLfs, boolean withSubmodules, CloneInfo cloneInfo) {
    16 16   this.cloneDepth = cloneDepth;
    17 17   this.withLfs = withLfs;
    18 18   this.withSubmodules = withSubmodules;
    skipped 21 lines
  • ■ ■ ■ ■ ■ ■
    src/main/java/io/onedev/k8shelper/CommandExecutable.java src/main/java/io/onedev/k8shelper/CommandFacade.java
    skipped 10 lines
    11 11  import io.onedev.commons.utils.ExplicitException;
    12 12  import io.onedev.commons.utils.command.Commandline;
    13 13   
    14  -public class CommandExecutable extends LeafExecutable {
     14 +public class CommandFacade extends LeafFacade {
    15 15   
    16 16   private static final long serialVersionUID = 1L;
    17 17   
    skipped 1 lines
    19 19  
    20 20   private final boolean useTTY;
    21 21  
    22  - public CommandExecutable(List<OsExecution> executions, boolean useTTY) {
     22 + public CommandFacade(List<OsExecution> executions, boolean useTTY) {
    23 23   this.executions = executions;
    24 24   this.useTTY = useTTY;
    25 25   }
    26 26   
    27  - public CommandExecutable(@Nullable String image, List<String> commands, boolean useTTY) {
     27 + public CommandFacade(@Nullable String image, List<String> commands, boolean useTTY) {
    28 28   this(Lists.newArrayList(new OsExecution(OsMatcher.ALL, image, commands)), useTTY);
    29 29   }
    30 30  
    skipped 39 lines
  • ■ ■ ■ ■ ■ ■
    src/main/java/io/onedev/k8shelper/CompositeExecutable.java src/main/java/io/onedev/k8shelper/CompositeFacade.java
    skipped 7 lines
    8 8   
    9 9  import static io.onedev.k8shelper.ExecuteCondition.*;
    10 10   
    11  -public class CompositeExecutable implements Executable {
     11 +public class CompositeFacade implements StepFacade {
    12 12   
    13 13   private static final long serialVersionUID = 1L;
    14 14   
    15 15   private final List<Action> actions;
    16 16  
    17  - public CompositeExecutable(List<Action> actions) {
     17 + public CompositeFacade(List<Action> actions) {
    18 18   this.actions = actions;
    19 19   }
    20 20   
    skipped 48 lines
    69 69   Action action = actions.get(positionCopy.remove(0));
    70 70   names.add(action.getName());
    71 71   if (!positionCopy.isEmpty()) {
    72  - CompositeExecutable executable = (CompositeExecutable) action.getExecutable();
     72 + CompositeFacade executable = (CompositeFacade) action.getExecutable();
    73 73   names.addAll(executable.getNames(positionCopy));
    74 74   }
    75 75   return names;
    skipped 8 lines
  • ■ ■ ■ ■ ■ ■
    src/main/java/io/onedev/k8shelper/KubernetesHelper.java
    skipped 73 lines
    74 74  
    75 75   public static final String ENV_OS_INFO = "ONEDEV_OS_INFO";
    76 76  
     77 + public static final String ENV_REGISTRY_LOGINS = "ONEDEV_REGISTRY_LOGINS";
     78 +
    77 79   public static final String BEARER = "Bearer";
    78 80  
    79 81   public static final String LOG_END_MESSAGE = "===== End of OneDev K8s Helper Log =====";
    skipped 122 lines
    202 204   }
    203 205  
    204 206   private static void generateCommandScript(List<Integer> position, String stepNames,
    205  - List<String> setupCommands, CommandExecutable commandExecutable, File workspace,
     207 + List<String> setupCommands, CommandFacade commandFacade, File workspace,
    206 208   OsInfo osInfo) {
    207 209   try {
    208 210   String positionStr = stringifyPosition(position);
    209 211   File commandHome = getCommandHome();
    210  - File stepScriptFile = new File(commandHome, "step-" + positionStr + commandExecutable.getScriptExtension());
    211  - OsExecution execution = commandExecutable.getExecution(osInfo);
    212  - FileUtils.writeLines(stepScriptFile, execution.getCommands(), commandExecutable.getEndOfLine());
     212 + File stepScriptFile = new File(commandHome, "step-" + positionStr + commandFacade.getScriptExtension());
     213 + OsExecution execution = commandFacade.getExecution(osInfo);
     214 + FileUtils.writeLines(stepScriptFile, execution.getCommands(), commandFacade.getEndOfLine());
    213 215  
    214 216   if (SystemUtils.IS_OS_WINDOWS) {
    215 217   StringBuilder escapedStepNames = new StringBuilder();
    skipped 27 lines
    243 245   "cd " + workspace.getAbsolutePath()
    244 246   + " && cmd /c " + setupScriptFile.getAbsolutePath()
    245 247   + " && cmd /c echo " + TaskLogger.wrapWithAnsiNotice("Running step ^\"" + escapedStepNames + "^\"...")
    246  - + " && " + commandExecutable.getInterpreter() + " " + stepScriptFile.getAbsolutePath(),
     248 + + " && " + commandFacade.getInterpreter() + " " + stepScriptFile.getAbsolutePath(),
    247 249   "set exit_code=%errorlevel%",
    248 250   "if \"%exit_code%\"==\"0\" (",
    249 251   " echo " + TaskLogger.wrapWithAnsiSuccess("Step ^\"" + escapedStepNames + "^\" is successful"),
    skipped 34 lines
    284 286   "cd " + workspace.getAbsolutePath()
    285 287   + " && sh " + setupScriptFile.getAbsolutePath()
    286 288   + " && echo '" + TaskLogger.wrapWithAnsiNotice("Running step \"" + escapedStepNames + "\"...") + "'"
    287  - + " && " + commandExecutable.getInterpreter() + " " + stepScriptFile.getAbsolutePath(),
     289 + + " && " + commandFacade.getInterpreter() + " " + stepScriptFile.getAbsolutePath(),
    288 290   "exitCode=\"$?\"",
    289 291   "if [ $exitCode -eq 0 ]",
    290 292   "then",
    skipped 117 lines
    408 410   commands.add("@echo off");
    409 411   commands.add("echo hello from container");
    410 412   generateCommandScript(Lists.newArrayList(0), "test", Lists.newArrayList(),
    411  - new CommandExecutable("any", commands, true), getWorkspace(), osInfo);
     413 + new CommandFacade("any", commands, true), getWorkspace(), osInfo);
    412 414   } else {
    413 415   WebTarget target = client.target(serverUrl).path("api/k8s/job-data");
    414 416   Invocation.Builder builder = target.request();
    skipped 38 lines
    453 455  
    454 456   logger.info("Generating command scripts...");
    455 457  
    456  - CompositeExecutable entryExecutable = new CompositeExecutable(jobData.getActions());
    457  - entryExecutable.traverse(new LeafVisitor<Void>() {
     458 + CompositeFacade entryFacade = new CompositeFacade(jobData.getActions());
     459 + entryFacade.traverse(new LeafVisitor<Void>() {
    458 460   
    459 461   @Override
    460  - public Void visit(LeafExecutable executable, List<Integer> position) {
    461  - String stepNames = entryExecutable.getNamesAsString(position);
     462 + public Void visit(LeafFacade facade, List<Integer> position) {
     463 + String stepNames = entryFacade.getNamesAsString(position);
    462 464   
    463 465   List<String> setupCommands = new ArrayList<>();
    464 466   if (SystemUtils.IS_OS_WINDOWS) {
    skipped 27 lines
    492 494   String positionStr = stringifyPosition(position);
    493 495   
    494 496   File workingDir = getWorkspace();
    495  - CommandExecutable commandExecutable;
    496  - if (executable instanceof CommandExecutable) {
    497  - commandExecutable = (CommandExecutable) executable;
    498  - } else if (executable instanceof ContainerExecutable) {
    499  - ContainerExecutable containerExecutable = (ContainerExecutable) executable;
    500  - OsContainer container = containerExecutable.getContainer(osInfo);
     497 + CommandFacade commandFacade;
     498 + if (facade instanceof CommandFacade) {
     499 + commandFacade = (CommandFacade) facade;
     500 + } else if (facade instanceof BuildImageFacade) {
     501 + BuildImageFacade buildImageFacade = (BuildImageFacade) facade;
     502 +
     503 + List<String> commands = new ArrayList<>();
     504 +
     505 + StringBuilder buildCommand = new StringBuilder("docker build ");
     506 +
     507 + String[] parsedTags = StringUtils.parseQuoteTokens(buildImageFacade.getTags());
     508 + for (String tag: parsedTags)
     509 + buildCommand.append("-t ").append(tag).append(" ");
     510 +
     511 + List<String> loginCommands = new ArrayList<>();
     512 + try {
     513 + List<RegistryLoginFacade> registryLogins = SerializationUtils.deserialize(
     514 + Hex.decodeHex(System.getenv(ENV_REGISTRY_LOGINS).toCharArray()));
     515 + for (RegistryLoginFacade login: registryLogins) {
     516 + StringBuilder loginCommand = new StringBuilder("echo ");
     517 + loginCommand.append(login.getPassword()).append("|docker login -u ");
     518 + loginCommand.append(login.getUserName()).append(" --password-stdin || exit /b 1");
     519 + if (login.getRegistryUrl() != null)
     520 + loginCommand.append(" ").append(login.getRegistryUrl());
     521 + loginCommands.add(loginCommand.toString());
     522 + }
     523 + } catch (DecoderException e) {
     524 + throw new RuntimeException(e);
     525 + }
     526 +
     527 + if (SystemUtils.IS_OS_WINDOWS) {
     528 + if (buildImageFacade.getDockerfile() != null)
     529 + buildCommand.append("-f ").append("%workspace%\\" + buildImageFacade.getDockerfile().replace('/', '\\'));
     530 + else
     531 + buildCommand.append("-f ").append("%workspace%\\Dockerfile");
     532 +
     533 + buildCommand.append(" ");
     534 +
     535 + if (buildImageFacade.getBuildPath() != null)
     536 + buildCommand.append("%workspace%\\" + buildImageFacade.getBuildPath().replace('/', '\\'));
     537 + else
     538 + buildCommand.append("%workspace%");
     539 +
     540 + buildCommand.append(" || exit /b 1");
     541 +
     542 + commands.add("@echo off");
     543 + commands.addAll(loginCommands);
     544 + commands.add("set workspace=%cd%");
     545 + } else {
     546 + if (buildImageFacade.getDockerfile() != null)
     547 + buildCommand.append("-f ").append("$workspace/" + buildImageFacade.getDockerfile());
     548 + else
     549 + buildCommand.append("-f ").append("$workspace/Dockerfile");
     550 +
     551 + buildCommand.append(" ");
     552 +
     553 + if (buildImageFacade.getBuildPath() != null)
     554 + buildCommand.append("$workspace/" + buildImageFacade.getBuildPath());
     555 + else
     556 + buildCommand.append("$workspace");
     557 +
     558 + commands.add("set -e");
     559 + commands.addAll(loginCommands);
     560 + commands.add("workspace=$(pwd)");
     561 + }
     562 +
     563 + commands.add(buildCommand.toString());
     564 +
     565 + if (buildImageFacade.isPublish()) {
     566 + for (String tag: parsedTags)
     567 + commands.add("docker push " + tag);
     568 + }
     569 +
     570 + commandFacade = new CommandFacade("any", commands, true);
     571 + } else if (facade instanceof RunContainerFacade) {
     572 + RunContainerFacade containerFacade = (RunContainerFacade) facade;
     573 + OsContainer container = containerFacade.getContainer(osInfo);
    501 574   if (container.getWorkingDir() != null)
    502 575   workingDir = new File(container.getWorkingDir());
    503 576   // We will inspect container image and populate appropriate commands in sidecar as
    504 577   // container images are not pulled at init stage
    505  - commandExecutable = new CommandExecutable("any", Lists.newArrayList(), true);
     578 + commandFacade = new CommandFacade("any", Lists.newArrayList(), true);
    506 579   } else {
    507 580   String command;
    508 581   String classPath;
    skipped 1 lines
    510 583   classPath = "C:\\k8s-helper\\*";
    511 584   else
    512 585   classPath = "/k8s-helper/*";
    513  - if (executable instanceof CheckoutExecutable) {
    514  - CheckoutExecutable checkoutExecutable = (CheckoutExecutable) executable;
    515  - checkoutExecutable.getCloneInfo();
     586 + if (facade instanceof CheckoutFacade) {
     587 + CheckoutFacade checkoutFacade = (CheckoutFacade) facade;
     588 + checkoutFacade.getCloneInfo();
    516 589   command = String.format("java -classpath \"%s\" io.onedev.k8shelper.CheckoutCode %s %b %b %d %s",
    517  - classPath, positionStr, checkoutExecutable.isWithLfs(), checkoutExecutable.isWithSubmodules(),
    518  - checkoutExecutable.getCloneDepth(), checkoutExecutable.getCloneInfo().toString());
     590 + classPath, positionStr, checkoutFacade.isWithLfs(), checkoutFacade.isWithSubmodules(),
     591 + checkoutFacade.getCloneDepth(), checkoutFacade.getCloneInfo().toString());
    519 592   } else {
    520  - ServerExecutable serverExecutable = (ServerExecutable) executable;
     593 + ServerSideFacade serverSideFacade = (ServerSideFacade) facade;
    521 594  
    522  - String includeFiles = encodeAsCommandArg(serverExecutable.getIncludeFiles());
    523  - String excludeFiles = encodeAsCommandArg(serverExecutable.getExcludeFiles());
    524  - String placeholders = encodeAsCommandArg(serverExecutable.getPlaceholders());
    525  - command = String.format("java -classpath \"%s\" io.onedev.k8shelper.RunServerStep %s %s %s %s",
     595 + String includeFiles = encodeAsCommandArg(serverSideFacade.getIncludeFiles());
     596 + String excludeFiles = encodeAsCommandArg(serverSideFacade.getExcludeFiles());
     597 + String placeholders = encodeAsCommandArg(serverSideFacade.getPlaceholders());
     598 + command = String.format("java -classpath \"%s\" io.onedev.k8shelper.RunServerSideStep %s %s %s %s",
    526 599   classPath, positionStr, includeFiles, excludeFiles, placeholders);
    527 600   }
    528 601  
    skipped 2 lines
    531 604   commands.add("@echo off");
    532 605   commands.add(command);
    533 606  
    534  - commandExecutable = new CommandExecutable("any", commands, true);
     607 + commandFacade = new CommandFacade("any", commands, true);
    535 608   }
    536 609  
    537  - generateCommandScript(position, stepNames, setupCommands, commandExecutable, workingDir, osInfo);
     610 + generateCommandScript(position, stepNames, setupCommands, commandFacade, workingDir, osInfo);
    538 611  
    539 612   return null;
    540 613   }
    skipped 344 lines
    885 958   LeafHandler commandHandler = new LeafHandler() {
    886 959   
    887 960   @Override
    888  - public boolean execute(LeafExecutable executable, List<Integer> position) {
     961 + public boolean execute(LeafFacade facade, List<Integer> position) {
    889 962   String positionStr = stringifyPosition(position);
    890 963  
    891 964   File file;
    skipped 9 lines
    901 974   
    902 975   try {
    903 976   String stepScript = FileUtils.readFileToString(stepScriptFile, UTF_8);
    904  - if (executable instanceof ContainerExecutable) {
    905  - ContainerExecutable containerExecutable = (ContainerExecutable) executable;
    906  - OsContainer container = containerExecutable.getContainer(osInfo);
     977 + if (facade instanceof RunContainerFacade) {
     978 + RunContainerFacade rubContainerFacade = (RunContainerFacade) facade;
     979 + OsContainer container = rubContainerFacade.getContainer(osInfo);
    907 980   stepScript = getContainerRunScript(container.getImage(), container.getArgs());
    908 981   } else {
    909 982   stepScript = FileUtils.readFileToString(stepScriptFile, UTF_8);
    skipped 35 lines
    945 1018   }
    946 1019   
    947 1020   @Override
    948  - public void skip(LeafExecutable executable, List<Integer> position) {
     1021 + public void skip(LeafFacade facade, List<Integer> position) {
    949 1022   File file = new File(getMarkHome(), stringifyPosition(position) + ".skip");
    950 1023   try {
    951 1024   if (!file.createNewFile())
    skipped 6 lines
    958 1031   };
    959 1032  
    960 1033   if (test) {
    961  - CommandExecutable executable = new CommandExecutable(
     1034 + CommandFacade facade = new CommandFacade(
    962 1035   "this does not matter", Lists.newArrayList("this does not matter"), false);
    963  - executable.execute(commandHandler, Lists.newArrayList(0));
     1036 + facade.execute(commandHandler, Lists.newArrayList(0));
    964 1037   } else {
    965 1038   JobData jobData = readJobData();
    966 1039  
    967 1040   List<Action> actions = jobData.getActions();
    968 1041  
    969  - new CompositeExecutable(actions).execute(commandHandler, new ArrayList<>());
     1042 + new CompositeFacade(actions).execute(commandHandler, new ArrayList<>());
    970 1043   }
    971 1044   }
    972 1045  
    skipped 103 lines
    1076 1149   }
    1077 1150  
    1078 1151   };
    1079  - runServerStep(serverUrl, jobToken, position, includeFiles, excludeFiles, placeholders,
     1152 + runServerSideStep(serverUrl, jobToken, position, includeFiles, excludeFiles, placeholders,
    1080 1153   getBuildHome(), getWorkspace(), logger);
    1081 1154   }
    1082 1155   
    1083  - public static void runServerStep(String serverUrl, String jobToken, List<Integer> position,
     1156 + public static void runServerSideStep(String serverUrl, String jobToken, List<Integer> position,
    1084 1157   Collection<String> includeFiles, Collection<String> excludeFiles,
    1085 1158   Collection<String> placeholders, File buildHome, File workspace, TaskLogger logger) {
    1086 1159   Client client = ClientBuilder.newClient();
    skipped 126 lines
  • ■ ■ ■ ■
    src/main/java/io/onedev/k8shelper/LeafExecutable.java src/main/java/io/onedev/k8shelper/LeafFacade.java
    skipped 1 lines
    2 2   
    3 3  import java.util.List;
    4 4   
    5  -public abstract class LeafExecutable implements Executable {
     5 +public abstract class LeafFacade implements StepFacade {
    6 6   
    7 7   private static final long serialVersionUID = 1L;
    8 8   
    skipped 17 lines
  • ■ ■ ■ ■ ■ ■
    src/main/java/io/onedev/k8shelper/LeafHandler.java
    skipped 3 lines
    4 4   
    5 5  public interface LeafHandler {
    6 6   
    7  - boolean execute(LeafExecutable executable, List<Integer> position);
     7 + boolean execute(LeafFacade executable, List<Integer> position);
    8 8  
    9  - void skip(LeafExecutable executable, List<Integer> position);
     9 + void skip(LeafFacade executable, List<Integer> position);
    10 10  
    11 11  }
    12 12   
  • ■ ■ ■ ■
    src/main/java/io/onedev/k8shelper/LeafVisitor.java
    skipped 3 lines
    4 4   
    5 5  public interface LeafVisitor<T> {
    6 6   
    7  - T visit(LeafExecutable executable, List<Integer> position);
     7 + T visit(LeafFacade executable, List<Integer> position);
    8 8  
    9 9  }
    10 10   
  • ■ ■ ■ ■ ■ ■
    src/main/java/io/onedev/k8shelper/PowerShellExecutable.java src/main/java/io/onedev/k8shelper/PowerShellFacade.java
    skipped 5 lines
    6 6   
    7 7  import io.onedev.commons.utils.command.Commandline;
    8 8   
    9  -public class PowerShellExecutable extends CommandExecutable {
     9 +public class PowerShellFacade extends CommandFacade {
    10 10   
    11 11   private static final long serialVersionUID = 1L;
    12 12   
    13  - public PowerShellExecutable(@Nullable String image, List<String> commands, boolean useTTY) {
     13 + public PowerShellFacade(@Nullable String image, List<String> commands, boolean useTTY) {
    14 14   super(image, commands, useTTY);
    15 15   }
    16 16   
    skipped 16 lines
  • ■ ■ ■ ■ ■ ■
    src/main/java/io/onedev/k8shelper/RegistryLoginFacade.java
     1 +package io.onedev.k8shelper;
     2 + 
     3 +import java.io.Serializable;
     4 + 
     5 +public class RegistryLoginFacade implements Serializable {
     6 + 
     7 + private static final long serialVersionUID = 1L;
     8 + 
     9 + private final String registryUrl;
     10 +
     11 + private final String userName;
     12 +
     13 + private final String password;
     14 +
     15 + public RegistryLoginFacade(String registryUrl, String userName, String password) {
     16 + this.registryUrl = registryUrl;
     17 + this.userName = userName;
     18 + this.password = password;
     19 + }
     20 + 
     21 + public String getRegistryUrl() {
     22 + return registryUrl;
     23 + }
     24 + 
     25 + public String getUserName() {
     26 + return userName;
     27 + }
     28 + 
     29 + public String getPassword() {
     30 + return password;
     31 + }
     32 +
     33 +}
     34 + 
  • ■ ■ ■ ■ ■ ■
    src/main/java/io/onedev/k8shelper/ContainerExecutable.java src/main/java/io/onedev/k8shelper/RunContainerFacade.java
    skipped 8 lines
    9 9   
    10 10  import io.onedev.commons.utils.ExplicitException;
    11 11   
    12  -public class ContainerExecutable extends LeafExecutable {
     12 +public class RunContainerFacade extends LeafFacade {
    13 13   
    14 14   private static final long serialVersionUID = 1L;
    15 15   
    skipped 1 lines
    17 17  
    18 18   private final boolean useTTY;
    19 19  
    20  - public ContainerExecutable(List<OsContainer> containers, boolean useTTY) {
     20 + public RunContainerFacade(List<OsContainer> containers, boolean useTTY) {
    21 21   this.containers = containers;
    22 22   this.useTTY = useTTY;
    23 23   }
    24 24   
    25  - public ContainerExecutable(String image, @Nullable String args, Map<String, String> envMap,
     25 + public RunContainerFacade(String image, @Nullable String args, Map<String, String> envMap,
    26 26   @Nullable String workingDir, boolean useTTY) {
    27 27   this(Lists.newArrayList(new OsContainer(OsMatcher.ALL, image, args, envMap, workingDir)), useTTY);
    28 28   }
    skipped 19 lines
  • ■ ■ ■ ■ ■ ■
    src/main/java/io/onedev/k8shelper/RunServerStep.java src/main/java/io/onedev/k8shelper/RunServerSideStep.java
    skipped 6 lines
    7 7   
    8 8  import io.onedev.commons.utils.TaskLogger;
    9 9   
    10  -public class RunServerStep {
     10 +public class RunServerSideStep {
    11 11   
    12  - private static final Logger logger = LoggerFactory.getLogger(RunServerStep.class);
     12 + private static final Logger logger = LoggerFactory.getLogger(RunServerSideStep.class);
    13 13  
    14 14   public static void main(String[] args) {
    15 15   int exitCode = 0;
    skipped 20 lines
  • ■ ■ ■ ■ ■
    src/main/java/io/onedev/k8shelper/ServerExecutable.java src/main/java/io/onedev/k8shelper/ServerSideFacade.java
    skipped 2 lines
    3 3  import java.util.Collection;
    4 4  import java.util.Set;
    5 5   
    6  -public class ServerExecutable extends LeafExecutable {
     6 +public class ServerSideFacade extends LeafFacade {
    7 7   
    8 8   private static final long serialVersionUID = 1L;
    9 9   
    skipped 5 lines
    15 15  
    16 16   private final Collection<String> placeholders;
    17 17  
    18  - public ServerExecutable(Object step, Set<String> includeFiles, Set<String> excludeFiles, Collection<String> placeholders) {
     18 + public ServerSideFacade(Object step, Set<String> includeFiles, Set<String> excludeFiles,
     19 + Collection<String> placeholders) {
    19 20   this.step = step;
    20 21   this.includeFiles = includeFiles;
    21 22   this.excludeFiles = excludeFiles;
    skipped 21 lines
  • ■ ■ ■ ■
    src/main/java/io/onedev/k8shelper/Executable.java src/main/java/io/onedev/k8shelper/StepFacade.java
    skipped 2 lines
    3 3  import java.io.Serializable;
    4 4  import java.util.List;
    5 5   
    6  -public interface Executable extends Serializable {
     6 +public interface StepFacade extends Serializable {
    7 7   
    8 8   boolean execute(LeafHandler handler, List<Integer> position);
    9 9  
    skipped 6 lines
Please wait...
Page is in error, reload to recover