Class AssignToNode

    • Constructor Detail

      • AssignToNode

        public AssignToNode​(Node node)
    • Method Detail

      • allJobsShouldHaveOnlineAgent

        public static boolean allJobsShouldHaveOnlineAgent​(ParsedBuild build)
                                                    throws ParseException
        Checks if all jobs from the build have online build agent or throws an exception if one node has all build agents offline.

        In a large company the build agents might be coming and going depending on the time of the day where more processing power is needed. In a long build it's possible that an agent will be present by the time our job is available for building and calling this method at the start of the build will throw an exception.

        For now, I still think it's better to be fail fast over hoping that the agents will appear one day and be stuck with a build that does not progresses.

        Throws:
        ParseException
      • findJenkinsAgent

        public static Node findJenkinsAgent​(List<BuildAgent> allPossibleBuildAgents,
                                            List<Node> buildNodes)
        Find appropriate jenkins agent node, based on the needs of the build job. Right now the job is assigned to agent with the most free executors.