Class DslBuild

    • Method Detail

      • durationToString

        public static String durationToString​(long milliseconds)
      • convertBuildResult

        public static String convertBuildResult​(Result buildResult)
      • isFinished

        public boolean isFinished()
      • getStatus

        @Exported
        public net.sf.json.JSONObject getStatus()
        Endpoint that is called by the frontend when we want to get the current build status report.
      • getDslBuild

        @Exported
        public net.sf.json.JSONObject getDslBuild()
        Endpoint to get the structure of the build graph. All graph nodes are returned (even the ones that are waiting in the build queue). This endpoint is accessible under specific job build: /jenkins/job//
      • doStartPartialBuild

        @POST
        public void doStartPartialBuild​(org.kohsuke.stapler.StaplerRequest req,
                                        org.kohsuke.stapler.StaplerResponse rsp,
                                        @QueryParameter
                                        String job)
                                 throws IOException
        Endpoint that allows the user to trigger a partial build of the pipeline. This action is usually triggered by clicking on the play icon of the node in pipeline frontend.
        Parameters:
        job - name of the job that should be built
        Throws:
        IOException
      • getBuildGraph

        public ProjectGraph getBuildGraph()
        Get the structure of the build pipeline (how are jobs connected).
      • verifyPipeline

        public static ParsedBuild verifyPipeline​(String projectName,
                                                 String pipeline)
                                          throws ParseException,
                                                 BuildCycleException
        Parse the DslProject pipeline and verify the build settings.
        Parameters:
        projectName - - name of the project for which the pipeline is verified
        pipeline - - pipeline DSL that will be validated
        Returns:
        parsed pipeline into build nodes
        Throws:
        ParseException - in case of any parse error or setting that does not exist
        BuildCycleException