Package net.sourceforge.cruisecontrol.util

Examples of net.sourceforge.cruisecontrol.util.ManagedCommandline


     */
    private String getProjectRelease() throws CruiseControlException {
        String release;
       
        // Create the CM Synergy command line
        ManagedCommandline cmd = CMSynergy.createCcmCommand(
                getCcmExe(), getSessionName(), getSessionFile());
        cmd.createArgument().setValue("attribute");
        cmd.createArgument().setValue("-show");
        cmd.createArgument().setValue("release");
        cmd.createArgument().setValue("-project");
        cmd.createArgument().setValue(getProject());

        try {
            cmd.execute();
            cmd.assertExitCode(0);
            release = cmd.getStdoutAsString().trim();
        } catch (Exception e) {
            throw new CruiseControlException(
                    "Could not determine the release value of project \""
                            + getProject() + "\".", e);
        }
View Full Code Here


        try {
            if (getBranch() != null) {
                setActiveBranch(getBranch());
            }

            ManagedCommandline cmdLine = buildBootstrapCommand();
            cmdLine.execute();
            LOG.debug(cmdLine.getStdoutAsString());
            LOG.debug(cmdLine.getStderrAsString());
        } catch (IOException e) {
            LOG.error("Error executing AlienBrain bootstrap." + e);
        } catch (CruiseControlException e) {
            LOG.error("Error executing AlienBrain bootstrap." + e);
        }
View Full Code Here

    }

    public ManagedCommandline buildBootstrapCommand() {

        ManagedCommandline cmdLine = buildCommonCommand();

        cmdLine.createArgument().setValue("getlatest");
        cmdLine.createArgument().setValue(getPath());
        addArgumentIfSet(cmdLine, localPath, "-localpath");
        addFlagIfSet(cmdLine, forceFileUpdate, "-forcefileupdate");
        addArgumentIfSet(cmdLine, overwriteWritable, "-overwritewritable");

        return cmdLine;
View Full Code Here

        } catch (IOException e) {
            throw new CruiseControlException(e);
        }

        // Get a list of currently running CM Synergy sessions
        ManagedCommandline cmd = new ManagedCommandline(ccmExe);
        cmd.createArgument().setValue("status");
        String availableSessions;
        try {
            cmd.execute();
            cmd.assertExitCode(0);
            availableSessions = cmd.getStdoutAsString();
        } catch (Exception e) {
            LOG.warn("CM Synergy failed to provide a list of valid sessions.",
                    e);
            availableSessions = "";
        }
View Full Code Here

       
        LOG.info("Starting a new CM Synergy session for \"" + session.getName()
                + "\".");

        // Create CM Synergy startup command
        ManagedCommandline cmd = new ManagedCommandline(ccmExe);
        cmd.createArgument().setValue("start");
        cmd.createArgument().setValue("-q");
        cmd.createArgument().setValue("-nogui");
        cmd.createArgument().setValue("-m");
        cmd.createArgument().setValue("-d");
        cmd.createArgument().setValue(session.getDatabase());
        cmd.createArgument().setValue("-r");
        cmd.createArgument().setValue(session.getRole());
        cmd.createArgument().setValue("-n");
        cmd.createArgument().setValue(session.getUser());
        cmd.createArgument().setValue("-pw");
        cmd.createArgument().setValue(session.getPassword());
        if (session.getHost() != null) {
            cmd.createArgument().setValue("-h");
            cmd.createArgument().setValue(session.getHost());
        }

        try {
            cmd.execute();
            cmd.assertExitCode(0);
        } catch (Exception e) {
            LOG.error("Could not start a CM Synergy session for "
                    + session.getName(), e);
            return null;
        }

        return cmd.getStdoutAsString().trim();
    }   
View Full Code Here

TOP

Related Classes of net.sourceforge.cruisecontrol.util.ManagedCommandline

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.