Class BuildFlowScriptAction

    • Constructor Detail

      • BuildFlowScriptAction

        public BuildFlowScriptAction()
    • Method Detail

      • onLoad

        public void onLoad​(Run<?,​?> r)
        Specified by:
        onLoad in interface RunAction2
      • getProject

        public AbstractProject<?,​?> getProject()
        Returns the project associated with the build this action is configured on.
        Returns:
        null, if no build is present from which the project can be grabbed.
      • getProject

        public InheritanceProject getProject​(org.kohsuke.stapler.StaplerRequest request)
        This method returns the InheritanceProject associated with the given request; if any are. Otherwise, returns null.
        Parameters:
        request - the request to check for an InheritanceProject
        Returns:
        null, if no such project is associated with the request
      • getBuild

        public AbstractBuild<?,​?> getBuild​(org.kohsuke.stapler.StaplerRequest req)
      • doDownload

        public ReadOnlyConfigurationArchive doDownload()
        Creates an HttpResponse that will send a TGZ containing build scripts.
        Returns:
        null, if the file could not be generated, otherwise a valid HttpResponse.
      • getBuildersFor

        protected List<Builder> getBuildersFor​(AbstractProject<?,​?> p)
        Returns the list of build steps for a given project, or an empty list if the project is invalid or has no builders.
        Parameters:
        p - the project to scan
        Returns:
        a list, never null but may be empty.
      • getCmdControlFile

        public static MetaScript getCmdControlFile​(File prefix,
                                                   String scriptName,
                                                   List<MetaScript> scripts,
                                                   Map<String,​String> env,
                                                   boolean setWorkspaceVars)
        This method generates a "build.bat" windows CMD control file for the given script files
        Parameters:
        prefix - the directory the control file will be created in. May be null.
        scriptName - the name for the control file, defaults to "build" if null or blank.
        scripts - the scripts for which to create the control file
        env - the environment variables to be set in this control file
        setWorkspaceVars - if true, the script will set and create the WORKSPACE variable.
        Returns:
        a script containing a Windows CMD control file
      • getBashControlFile

        public static MetaScript getBashControlFile​(File prefix,
                                                    String scriptName,
                                                    List<MetaScript> scripts,
                                                    Map<String,​String> env,
                                                    boolean setWorkspaceVars)
        This method generates a "build.sh" Bash control file for the given script files.
        Parameters:
        prefix - the directory the control file will be created in. May be null.
        scriptName - the name for the control file, defaults to "build" if null or blank.
        scripts - the scripts for which to create the control file
        env - the environment variables to be set in this control file
        setWorkspaceVars - if true, the script will set and create the WORKSPACE variable.
        Returns:
        a script containing a Bash control file