Package hudson.model

Examples of hudson.model.Node


                        if (config.content != null ) {
                            remoteGlobalSettingsFromConfig = SettingsProviderUtils.copyConfigContentToFile( config );
                        }
                    }
                }
                Node buildNode = build.getBuiltOn();
               
                if(buildNode == null) {
                    // assume that build was made on master
                    buildNode = Jenkins.getInstance();
                }

                if (StringUtils.isBlank( altSettingsPath ) ) {
                    // get userHome from the node where job has been executed
                    String remoteUserHome = build.getWorkspace().act( new GetUserHome() );
                    altSettingsPath = remoteUserHome + "/.m2/settings.xml";
                }
               
                // we copy this file in the master in a  temporary file
                FilePath filePath = new FilePath( tmpSettings );
                FilePath remoteSettings = build.getWorkspace().child( altSettingsPath );
                if (!remoteSettings.exists()) {
                    // JENKINS-9084 we finally use $M2_HOME/conf/settings.xml as maven do
                   
                    String mavenHome =
                        ((MavenModuleSet) project).getMaven().forNode(buildNode, listener ).getHome();
                    String settingsPath = mavenHome + "/conf/settings.xml";
                    remoteSettings = build.getWorkspace().child( settingsPath);
                }
                listener.getLogger().println( "Maven RedeployPublished use remote " + (buildNode != null ? buildNode.getNodeName() : "local"
                                              + " maven settings from : " + remoteSettings.getRemote() );
                remoteSettings.copyTo( filePath );
                settingsLoc = tmpSettings;
               
            }
View Full Code Here


            return addRunHeadLessOption(this.mavenOpts);

        String mavenOpts = mms.getMavenOpts();

        if ((mavenOpts==null) || (mavenOpts.trim().length()==0)) {
            Node n = getCurrentNode();
            if (n!=null) {
                try {
                    String localMavenOpts = n.toComputer().getEnvironment().get("MAVEN_OPTS");
                   
                    if ((localMavenOpts!=null) && (localMavenOpts.trim().length()>0)) {
                        mavenOpts = localMavenOpts;
                    }
                } catch (IOException e) {
View Full Code Here

       
        mvn = mvn.forEnvironment(envs);
       
        Computer computer = Computer.currentComputer();
        if (computer != null) { // just in case were not in a build
            Node node = computer.getNode();
            if (node != null) {
                mvn = mvn.forNode(node, log);
                mvn.buildEnvVars(envs);
            }
        }
View Full Code Here

     * {@link MavenModule} uses the workspace of the {@link MavenModuleSet},
     * so it always needs to be built on the same slave as the parent.
     */
    @Override
    public Label getAssignedLabel() {
        Node n = getParent().getLastBuiltOn();
        if(n==null) return null;
        return n.getSelfLabel();
    }
View Full Code Here

            this.nodeName = nodeName.equals(MASTER_NAME) ? "" : nodeName;
            this.labelExpr = labelExpr;
        }

        public Boolean call() throws ANTLRException {
            Node n = Hudson.getInstance().getNode(nodeName);
            if (n == null)
                return false;
            return Label.parseExpression(labelExpr).matches(n);
        }
View Full Code Here

            DynaSlave slave = new DynaSlave(name, "Dynamic slave at " + hostname + ": " + description,
                    remoteFsRoot, String.valueOf(executors), labels, hostname, defaultRemoteSlaveUser,
                    defaultBaseLauncherCommand, defaultIdleTerminationMinutes);

            synchronized (jenkins) {
                Node n = jenkins.getNode(name);
                if (n != null) jenkins.removeNode(n);
                jenkins.addNode(slave);
            }
        } catch (FormException e) {
            LOG.log(Level.WARNING, "Unable to create dynaslave:", e);
View Full Code Here

     */
    @SuppressWarnings("unchecked")
    protected void doRun() {
        final long startRun = System.currentTimeMillis();
        for (Computer c : Jenkins.getInstance().getComputers()) {
            Node n = c.getNode();
            if (n!=null && n.isHoldOffLaunchUntilSave())
                continue;
            if (!nextCheck.containsKey(c) || startRun > nextCheck.get(c)) {
                // at the moment I don't trust strategies to wait more than 60 minutes
                // strategies need to wait at least one minute
                final long waitInMins = Math.min(1, Math.max(60, c.getRetentionStrategy().check(c)));
View Full Code Here

            super(base);
            assert !base.isEmpty();
            this.index = index;
            this.assignedLabel = getAssignedLabel(base.get(0));

            Node lbo = base.get(0).getLastBuiltOn();
            for (ExecutorChunk ec : executors) {
                if (ec.node==lbo) {
                    lastBuiltOn = ec;
                    return;
                }
View Full Code Here

        when(o.getExecutor()).thenReturn(e);
        return o;
    }

    private Computer createMockComputer(int nExecutors) throws Exception {
        Node n = mock(Node.class);
        Computer c = mock(Computer.class);
        when(c.getNode()).thenReturn(n);

        List executors = new CopyOnWriteArrayList();
View Full Code Here

        Executor exec = b.getExecutor();
        if (exec==null)
            throw new AbortException(b.getFullDisplayName()+" is not building");

        Node node = exec.getOwner().getNode();

        t = t.translate(node, EnvVars.getRemote(checkChannel()), new StreamTaskListener(stderr));
        stdout.println(t.getHome());
        return 0;
    }
View Full Code Here

TOP

Related Classes of hudson.model.Node

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.