Package hudson.plugins.deploy
Class CargoContainerAdapter
java.lang.Object
hudson.plugins.deploy.ContainerAdapter
hudson.plugins.deploy.CargoContainerAdapter
- All Implemented Interfaces:
ExtensionPoint,Describable<ContainerAdapter>,Serializable
- Direct Known Subclasses:
DefaultCargoContainerAdapterImpl
Provides container-specific glue code.
To support remote operations as an inner class, marking the class as serializable.
- Author:
- Kohsuke Kawaguchi
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidconfigure(org.codehaus.cargo.container.configuration.Configuration config, EnvVars envVars, VariableResolver<String> resolver) Fills in theConfigurationobject.protected org.codehaus.cargo.container.deployable.EARCreates a Deployable object EAR from the given file object.protected org.codehaus.cargo.container.deployable.WARCreates a Deployable object WAR from the given file object.protected voiddeploy(org.codehaus.cargo.generic.deployer.DeployerFactory deployerFactory, TaskListener listener, org.codehaus.cargo.container.Container container, File f, String contextPath) protected StringexpandVariable(EnvVars envVars, VariableResolver<String> resolver, String variable) Expands an encoded environment variable.protected org.codehaus.cargo.container.ContainergetContainer(org.codehaus.cargo.generic.configuration.ConfigurationFactory configFactory, org.codehaus.cargo.generic.ContainerFactory containerFactory, String id, EnvVars envVars, VariableResolver<String> resolver) protected abstract StringReturns the container ID used by Cargo.voidredeployFile(FilePath war, String contextPath, Run<?, ?> run, Launcher launcher, TaskListener listener) Perform redeployment.Methods inherited from class hudson.plugins.deploy.ContainerAdapter
all, getDescriptor, redeploy
-
Constructor Details
-
CargoContainerAdapter
public CargoContainerAdapter()
-
-
Method Details
-
getContainerId
Returns the container ID used by Cargo.- Returns:
- the id of the container
-
configure
protected abstract void configure(org.codehaus.cargo.container.configuration.Configuration config, EnvVars envVars, VariableResolver<String> resolver) Fills in theConfigurationobject.- Parameters:
config- the configuration of the adapterenvVars- the environmental variables of the buildresolver- the variable resolver
-
getContainer
protected org.codehaus.cargo.container.Container getContainer(org.codehaus.cargo.generic.configuration.ConfigurationFactory configFactory, org.codehaus.cargo.generic.ContainerFactory containerFactory, String id, EnvVars envVars, VariableResolver<String> resolver) -
deploy
protected void deploy(org.codehaus.cargo.generic.deployer.DeployerFactory deployerFactory, TaskListener listener, org.codehaus.cargo.container.Container container, File f, String contextPath) -
createWAR
Creates a Deployable object WAR from the given file object.- Parameters:
deployableFile- The deployable file to create the Deployable from.- Returns:
- A Deployable object.
-
expandVariable
protected String expandVariable(EnvVars envVars, VariableResolver<String> resolver, String variable) Expands an encoded environment variable. Ex. if HOME=/user/alex, expands '${HOME}' to '/user/alex'- Parameters:
envVars- the environment variables of the buildresolver- unusedvariable- the variable to expand- Returns:
- the value of the expanded variable
-
createEAR
Creates a Deployable object EAR from the given file object.- Parameters:
deployableFile- The deployable file to create the Deployable from.- Returns:
- A deployable object.
-
redeployFile
public void redeployFile(FilePath war, String contextPath, Run<?, ?> run, Launcher launcher, TaskListener listener) throws IOException, InterruptedExceptionPerform redeployment. If failed, return false. Implementations should override me and makeContainerAdapter.redeploy(FilePath, String, AbstractBuild, Launcher, BuildListener)delegate to that implementation to be usable within Pipeline projects- Overrides:
redeployFilein classContainerAdapter- Parameters:
war- the path of the war/ear file to deploycontextPath- the context path for the war to be deployedrun- the build that is being deployedlauncher- the launcher of the buildlistener- the BuildListener of the build to deploy- Throws:
IOException- if there is an error locating the war fileInterruptedException- if there is an error deploying to the server
-