org.jenkinsci.plugins.managedscripts
Class ScriptBuildStep

java.lang.Object
  extended by hudson.tasks.BuildStepCompatibilityLayer
      extended by hudson.tasks.Builder
          extended by org.jenkinsci.plugins.managedscripts.ScriptBuildStep
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Describable<hudson.tasks.Builder>, hudson.tasks.BuildStep

public class ScriptBuildStep
extends hudson.tasks.Builder

LibraryBuildStep Builder.

A project that uses this builder can choose a build step from a list of predefined config files that are uses as command line scripts. The hash-bang sequence at the beginning of each file is used to determine the interpreter.

Author:
Norman Baumann, Dominik Bartholdi (imod)

Nested Class Summary
static class ScriptBuildStep.ArgValue
           
static class ScriptBuildStep.DescriptorImpl
          Descriptor for ScriptBuildStep.
 
Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
hudson.tasks.BuildStep.PublisherList
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
 
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
 
Constructor Summary
ScriptBuildStep(String buildStepId, boolean defineArgs, ScriptBuildStep.ArgValue[] buildStepArgs)
          The constructor used at form submission
ScriptBuildStep(String buildStepId, String[] buildStepArgs)
           
 
Method Summary
 String[] getBuildStepArgs()
           
 String getBuildStepId()
           
 ScriptBuildStep.DescriptorImpl getDescriptor()
           
 boolean perform(hudson.model.AbstractBuild<?,?> build, hudson.Launcher launcher, hudson.model.BuildListener listener)
          Perform the build step on the execution host.
 
Methods inherited from class hudson.tasks.Builder
all, getRequiredMonitorService, prebuild
 
Methods inherited from class hudson.tasks.BuildStepCompatibilityLayer
getProjectAction, getProjectAction, getProjectActions, perform, prebuild
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface hudson.tasks.BuildStep
getProjectAction, getProjectActions, prebuild
 

Constructor Detail

ScriptBuildStep

@DataBoundConstructor
public ScriptBuildStep(String buildStepId,
                                            boolean defineArgs,
                                            ScriptBuildStep.ArgValue[] buildStepArgs)
The constructor used at form submission

Parameters:
buildStepId - the Id of the config file
defineArgs - if the passed arguments should be saved (required because of html form submission, which also sends hidden values)
buildStepArgs - list of arguments specified as buildStepargs

ScriptBuildStep

public ScriptBuildStep(String buildStepId,
                       String[] buildStepArgs)
Method Detail

getBuildStepId

public String getBuildStepId()

getBuildStepArgs

public String[] getBuildStepArgs()

perform

public boolean perform(hudson.model.AbstractBuild<?,?> build,
                       hudson.Launcher launcher,
                       hudson.model.BuildListener listener)
Perform the build step on the execution host.

Generates a temporary file and copies the content of the predefined config file (by using the buildStepId) into it. It then copies this file into the workspace directory of the execution host and executes it.

Specified by:
perform in interface hudson.tasks.BuildStep
Overrides:
perform in class hudson.tasks.BuildStepCompatibilityLayer

getDescriptor

public ScriptBuildStep.DescriptorImpl getDescriptor()
Specified by:
getDescriptor in interface hudson.model.Describable<hudson.tasks.Builder>
Overrides:
getDescriptor in class hudson.tasks.Builder


Copyright © 2004-2013. All Rights Reserved.