Package hudson.model

Examples of hudson.model.AbstractProject


    }

    @Override
    protected File dir() {
        if (this.project instanceof AbstractProject) {
            AbstractProject abstractProject = (AbstractProject) this.project;

            Run run = abstractProject.getLastCompletedBuild();
            if (run != null) {
                File javadocDir = getBuildArchiveDir(run);

                if (javadocDir.exists()) {
                    return javadocDir;
View Full Code Here


        f = ExtendedEmailPublisherDescriptor.class.getDeclaredField( "recipientList" );
        f.setAccessible( true );
        f.set( publisher.getDescriptor(), "ashlux@gmail.com" );
       
        build =  mock(AbstractBuild.class);
        AbstractProject project = mock(AbstractProject.class);
        DescribableList publishers = mock(DescribableList.class);
        when(publishers.get(ExtendedEmailPublisher.class)).thenReturn(publisher);
        when(project.getPublishersList()).thenReturn(publishers);
        when(build.getProject()).thenReturn(project);
    }
View Full Code Here

        String privateRepository = null;
        FilePath remoteSettingsFromConfig = null;
       
        File tmpSettings = File.createTempFile( "jenkins", "temp-settings.xml" );
        try {
            AbstractProject project = build.getProject();
           
            if (project instanceof MavenModuleSet) {
                MavenModuleSet mavenModuleSet = ((MavenModuleSet) project);
                profiles = mavenModuleSet.getProfiles();
                systemProperties = mavenModuleSet.getMavenProperties();
View Full Code Here

        outputStream.print(json.toString());
        outputStream.flush();
    }

    public Map<String, String> getVariablesForImplementation(String jobName) {
        AbstractProject nearest = Project.findNearest(jobName);
        ImplementationBuildWrapper buildWrapper = BuildWrapperUtils.findBuildWrapper(ImplementationBuildWrapper.class, nearest);
        if(buildWrapper != null) {
            String variables = buildWrapper.getVariables();
            return CollectionUtils.expandToMap(variables);
        }
View Full Code Here


    private Set<String> getVariablesForJob(String... jobNames) throws IOException {
        Set<String> variables = new TreeSet<String>();
        for (String jobName : jobNames) {
            AbstractProject nearest = Project.findNearest(jobName);
            String configFile = nearest.getConfigFile().asString();

            Pattern pattern = Pattern.compile("\\$\\$([\\w\\d_]+)\\b");
            Matcher matcher = pattern.matcher(configFile);

            while (matcher.find()) {
View Full Code Here

        String suffix = request.getParameter("suffix");
        String scaffoldName = request.getParameter("scaffoldName");
        Scaffold scaffold = scaffoldCache.get(scaffoldName);
        List<String> jobs = scaffold.getChildJobs().get(suffix);
        for (String jobName : jobs) {
            AbstractProject job = Project.findNearest(jobName);
            job.delete();
        }
        String rootUrl = Jenkins.getInstance().getRootUrl() == null ? "/" : Jenkins.getInstance().getRootUrl();
        response.sendRedirect(rootUrl + getUrlName());
    }
View Full Code Here

            String value = request.getParameter(variable);
            variableValues.put(variable, value);
        }
        List<String> jobNames = scaffold.getJobNames();
        for (String jobName : jobNames) {
            AbstractProject jobToClone = Project.findNearest(jobName);
            String newName = jobName + jobNameAppend;
            cloneJob(jobToClone, newName, variableValues);

            scaffold.addChildJob(jobNameAppend, newName);
        }
View Full Code Here

    public Snapshot resolve() throws ResolvedFailedException {
        Jenkins h = Jenkins.getInstance();
        AbstractProject<?,?> job = h.getItemByFullName(jobName, AbstractProject.class);
        if(job==null) {
            if(h.getItemByFullName(jobName)==null) {
                AbstractProject nearest = AbstractProject.findNearest(jobName);
                throw new ResolvedFailedException(Messages.WorkspaceSnapshotSCM_NoSuchJob(jobName,nearest.getFullName()));
            } else
                throw new ResolvedFailedException(Messages.WorkspaceSnapshotSCM_IncorrectJobType(jobName));
        }

        PermalinkList permalinks = job.getPermalinks();
View Full Code Here

         * Gets the jobs to be monitored.
         */
        public Collection<AbstractProject> getJobs() {
            List<AbstractProject> r = new ArrayList<AbstractProject>();
            for (String job : Util.tokenize(jobs,",")) {
                AbstractProject j = Jenkins.getInstance().getItemByFullName(job.trim(), AbstractProject.class);
                if(j!=null)
                    r.add(j);
            }
            return r;
        }
View Full Code Here

                return graph.compare(rhs.getDownstreamProject(), lhs.getDownstreamProject());
            }
        });

        for (Dependency dep : downstreamProjects) {
            AbstractProject p = dep.getDownstreamProject();
            if (p.isDisabled()) {
                logger.println(Messages.BuildTrigger_Disabled(ModelHyperlinkNote.encodeTo(p)));
                continue;
            }
            List<Action> buildActions = new ArrayList<Action>();
            if (dep.shouldTriggerBuild(build, listener, buildActions)) {
                // this is not completely accurate, as a new build might be triggered
                // between these calls
                String name = ModelHyperlinkNote.encodeTo(p)+" #"+p.getNextBuildNumber();
                if(p.scheduleBuild(p.getQuietPeriod(), new UpstreamCause((Run)build),
                                   buildActions.toArray(new Action[buildActions.size()]))) {
                    logger.println(Messages.BuildTrigger_Triggering(name));
                } else {
                    logger.println(Messages.BuildTrigger_InQueue(name));
                }
View Full Code Here

TOP

Related Classes of hudson.model.AbstractProject

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.