Class SwarmComputerLauncher

java.lang.Object
hudson.slaves.ComputerLauncher
hudson.slaves.JNLPLauncher
io.jenkins.plugins.swarmcloud.SwarmComputerLauncher
All Implemented Interfaces:
ExtensionPoint, Describable<ComputerLauncher>

public class SwarmComputerLauncher extends JNLPLauncher
Launcher for Docker Swarm agents. Extends JNLPLauncher to allow inbound agent connections via WebSocket or JNLP.
  • Constructor Details

    • SwarmComputerLauncher

      public SwarmComputerLauncher(@NonNull String cloudName, @NonNull String image)
    • SwarmComputerLauncher

      public SwarmComputerLauncher(@NonNull String cloudName, @NonNull String image, boolean useWebSocket, @CheckForNull String tunnel, @CheckForNull String workDir)
    • SwarmComputerLauncher

      public SwarmComputerLauncher(@NonNull String cloudName, @NonNull String image, boolean useWebSocket, @CheckForNull String tunnel, @CheckForNull String workDir, int connectionTimeoutSeconds)
  • Method Details

    • launch

      public void launch(SlaveComputer computer, TaskListener listener)
      Overrides:
      launch in class JNLPLauncher
    • afterDisconnect

      public void afterDisconnect(SlaveComputer computer, TaskListener listener)
      Overrides:
      afterDisconnect in class ComputerLauncher
    • beforeDisconnect

      public void beforeDisconnect(SlaveComputer computer, TaskListener listener)
      Overrides:
      beforeDisconnect in class ComputerLauncher
    • getAgentSecret

      @NonNull public static String getAgentSecret(@NonNull String agentName)
      Gets the secret for an agent from Jenkins.
    • buildAgentCommand

      @NonNull public static String[] buildAgentCommand(@NonNull String jenkinsUrl, @NonNull String agentName, @NonNull String secret, boolean useWebSocket, @CheckForNull String workDir)
      Builds the command for the inbound agent container.
    • buildAgentEnvironment

      @NonNull public static Map<String,String> buildAgentEnvironment(@NonNull String jenkinsUrl, @NonNull String agentName, @NonNull String secret, boolean useWebSocket, @CheckForNull String workDir)
      Builds environment variables for the agent container.
    • getJnlpUrl

      @NonNull public static String getJnlpUrl(@NonNull String jenkinsUrl, @NonNull String agentName)
      Gets the JNLP URL for legacy connections.
    • getCloudName

      public String getCloudName()
    • getImage

      public String getImage()
    • isUseWebSocket

      public boolean isUseWebSocket()
    • getWorkDir

      public String getWorkDir()
    • getConnectionTimeoutSeconds

      public int getConnectionTimeoutSeconds()