Package hudson.model

Examples of hudson.model.Run$Artifact


        return "Sets the result of the current build. Works only if invoked from within a build.";
    }

    @Override
    protected int run() throws Exception {
        Run r = getCurrentlyBuilding();
        r.getParent().checkPermission(Item.BUILD);
        r.setResult(result);
        return 0;
    }
View Full Code Here


   
    @Argument(metaVar="DESCRIPTION",required=true,usage="Description to be set. '=' to read from stdin.", index=2)
    public String description;

    protected int run() throws Exception {
      Run run = job.getBuildByNumber(number);
        run.checkPermission(Run.UPDATE);

        if ("=".equals(description)) {
          description = channel.call(new Callable<String,IOException>() {
        public String call() throws IOException {
          return IOUtils.toString(System.in);
        }
          });
        }
       
        run.setDescription(description);
       
        return 0;
    }
View Full Code Here

        public Map<String,String> getRecords() {
            return record;
        }

        public void onLoad() {
            Run pb = build.getPreviousBuild();
            if (pb!=null) {
                FingerprintAction a = pb.getAction(FingerprintAction.class);
                if (a!=null)
                    compact(a);
            }
        }
View Full Code Here

    public void perform(Job<?, ?> job) throws IOException, InterruptedException {
        LOGGER.log(FINE, "Running the log rotation for " + job.getFullDisplayName());

        // keep the last successful build regardless of the status
        Run lsb = job.getLastSuccessfulBuild();
        Run lstb = job.getLastStableBuild();

        List<? extends Run<?, ?>> builds = job.getBuilds();
        Calendar cal = null;
        //Delete builds
        if (-1 != numToKeep || -1 != daysToKeep) {
View Full Code Here

        if (j!=null) {
            Item job = Hudson.getInstance().getItemByFullName(j);
            binding.setProperty("currentJob", job);
            String b = getClientEnvironmentVariable("BUILD_NUMBER");
            if (b!=null && job instanceof AbstractProject) {
                Run r = ((AbstractProject) job).getBuildByNumber(Integer.parseInt(b));
                binding.setProperty("currentBuild", r);
            }
        }

        GroovyShell groovy = new GroovyShell(binding);
View Full Code Here

            Job j = Hudson.getInstance().getItemByFullName(envs[0],Job.class);
            if (j==null)    throw new CmdLineException("No such job: "+envs[0]);

            try {
                Run r = j.getBuildByNumber(Integer.parseInt(envs[1]));
                if (r==null)    throw new CmdLineException("No such build #"+envs[1]+" in "+envs[0]);
                return r;
            } catch (NumberFormatException e) {
                throw new CmdLineException("Invalid build number: "+envs[1]);
            }
View Full Code Here

            List<AbstractProject> noFingerprints = new ArrayList<AbstractProject>();
            for (AbstractProject job : getJobs()) {
                RangeSet rs = owner.getDownstreamRelationship(job);
                if(rs.isEmpty()) {
                    // is this job expected to produce a test result?
                    Run b = job.getLastSuccessfulBuild();
                    if(b!=null && b.getAction(AbstractTestResultAction.class)!=null) {
                        if(b.getAction(FingerprintAction.class)!=null) {
                            didntRun.add(job);
                        } else {
                            noFingerprints.add(job);
                        }
                    }
                } else {
                    for (int n : rs.listNumbersReverse()) {
                        Run b = job.getBuildByNumber(n);
                        if(b==null) continue;
                        if(b.isBuilding() || b.getResult().isWorseThan(Result.UNSTABLE))
                            continue;   // don't count them

                        for( AbstractTestResultAction ta : b.getActions(AbstractTestResultAction.class)) {
                            failCount += ta.getFailCount();
                            totalCount += ta.getTotalCount();
                            individuals.add(ta);
                        }
                        break;
View Full Code Here

        ConnectorDCB connector = (ConnectorDCB) dcbRoot.getDConfigBean(root.getChildBean(dcbRoot.getXpaths()[0])[0]);
        assertNotNull(connector);
        assertNull(connector.getEnvironment());
        EnvironmentData environment = new EnvironmentData();
        connector.setEnvironment(environment);
        Artifact configId = new Artifact();
        environment.setConfigId(configId);
        assertNull(configId.getArtifactId());
        assertNull(configId.getGroupId());
        assertNull(configId.getType());
        assertNull(configId.getVersion());
        configId.setGroupId("test");
        configId.setArtifactId("product");
        configId.setType("rar");
        configId.setVersion("1.0");
        Artifact parent = new Artifact();
        Artifact dependency = new Artifact();
        environment.setDependencies(new Artifact[]{parent, dependency});
        assertNull(parent.getArtifactId());
        assertNull(parent.getGroupId());
        assertNull(parent.getType());
        assertNull(parent.getVersion());
        assertNull(dependency.getArtifactId());
        assertNull(dependency.getGroupId());
        assertNull(dependency.getType());
        assertNull(dependency.getVersion());
        parent.setGroupId("org.apache.geronimo.configs");
        parent.setArtifactId("j2ee-server");
        parent.setType("car");
        assertNull(parent.getVersion());
        dependency.setGroupId("postgresql");
        dependency.setArtifactId("postgresql-8.0");
        dependency.setType("jar");
        dependency.setVersion("313.jdbc3");
        // todo: Try the /connector/environment/hidden-classes element
        // todo: Try the /connector/environment/non-overridable-classes element
        // Try the /connector/resourceadapter element
        assertNotNull(connector.getResourceAdapter());
        assertEquals(1, connector.getResourceAdapter().length);
View Full Code Here

        ConnectorDCB connector = (ConnectorDCB) dcbRoot.getDConfigBean(root.getChildBean(dcbRoot.getXpaths()[0])[0]);
        assertNotNull(connector);
        assertNull(connector.getEnvironment());
        EnvironmentData environment = new EnvironmentData();
        connector.setEnvironment(environment);
        Artifact configId = new Artifact();
        environment.setConfigId(configId);
        assertNull(configId.getArtifactId());
        assertNull(configId.getGroupId());
        assertNull(configId.getType());
        assertNull(configId.getVersion());
        configId.setGroupId("test");
        configId.setArtifactId("product");
        configId.setType("rar");
        configId.setVersion("1.0");
        Artifact parent = new Artifact();
        Artifact dependency = new Artifact();
        environment.setDependencies(new Artifact[]{parent, dependency});
        assertNull(parent.getArtifactId());
        assertNull(parent.getGroupId());
        assertNull(parent.getType());
        assertNull(parent.getVersion());
        assertNull(dependency.getArtifactId());
        assertNull(dependency.getGroupId());
        assertNull(dependency.getType());
        assertNull(dependency.getVersion());
        parent.setGroupId("geronimo");
        parent.setArtifactId("j2ee-server");
        parent.setType("car");
        assertNull(parent.getVersion());
        dependency.setGroupId("postgresql");
        dependency.setArtifactId("postgresql-8.0");
        dependency.setType("jar");
        dependency.setVersion("313.jdbc3");
        // todo: Try the /connector/environment/hidden-classes element
        // todo: Try the /connector/environment/non-overridable-classes element
        // Try the /connector/resourceadapter element
        assertNotNull(connector.getResourceAdapter());
        assertEquals(1, connector.getResourceAdapter().length);
View Full Code Here

        ConnectorDCB connector = (ConnectorDCB) dcbRoot.getDConfigBean(root.getChildBean(dcbRoot.getXpaths()[0])[0]);
        assertNotNull(connector);
        assertNull(connector.getEnvironment());
        EnvironmentData environment = new EnvironmentData();
        connector.setEnvironment(environment);
        Artifact configId = new Artifact();
        environment.setConfigId(configId);
        assertNull(configId.getArtifactId());
        assertNull(configId.getGroupId());
        assertNull(configId.getType());
        assertNull(configId.getVersion());
        configId.setGroupId("test");
        configId.setArtifactId("product");
        configId.setType("rar");
        configId.setVersion("1.0");
        Artifact parent = new Artifact();
        Artifact dependency = new Artifact();
        environment.setDependencies(new Artifact[]{parent, dependency});
        assertNull(parent.getArtifactId());
        assertNull(parent.getGroupId());
        assertNull(parent.getType());
        assertNull(parent.getVersion());
        assertNull(dependency.getArtifactId());
        assertNull(dependency.getGroupId());
        assertNull(dependency.getType());
        assertNull(dependency.getVersion());
        parent.setGroupId("org.apache.geronimo.configs");
        parent.setArtifactId("j2ee-server");
        parent.setType("car");
        assertNull(parent.getVersion());
        dependency.setGroupId("postgresql");
        dependency.setArtifactId("postgresql-8.0");
        dependency.setType("jar");
        dependency.setVersion("313.jdbc3");
        // todo: Try the /connector/environment/hidden-classes element
        // todo: Try the /connector/environment/non-overridable-classes element
        // Try the /connector/resourceadapter element
        assertNotNull(connector.getResourceAdapter());
        assertEquals(1, connector.getResourceAdapter().length);
View Full Code Here

TOP

Related Classes of hudson.model.Run$Artifact

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.