Package org.apache.continuum.model.project

Examples of org.apache.continuum.model.project.ProjectScmRoot


            {
                for ( Integer buildDefId : buildDefIds )
                {
                    if ( buildDefId != null && isProjectOkToBuild( project.getId(), buildDefId ) )
                    {
                        ProjectScmRoot scmRoot = getProjectScmRootByProject( project.getId() );

                        Map<Integer, Integer> projectsAndBuildDefinitionsMap = map.get( scmRoot );

                        if ( projectsAndBuildDefinitionsMap == null )
                        {
                            projectsAndBuildDefinitionsMap = new HashMap<Integer, Integer>();
                        }

                        projectsAndBuildDefinitionsMap.put( project.getId(), buildDefId );

                        map.put( scmRoot, projectsAndBuildDefinitionsMap );

                        if ( !sortedScmRoot.contains( scmRoot ) )
                        {
                            sortedScmRoot.add( scmRoot );
                        }
                    }
                }
            }
        }

        BuildTrigger buildTrigger = new BuildTrigger( ContinuumProjectState.TRIGGER_SCHEDULED, "" );

        for ( ProjectScmRoot scmRoot : sortedScmRoot )
        {
            try
            {
                prepareBuildProjects( map.get( scmRoot ), buildTrigger, scmRoot.getScmRootAddress(),
                                      scmRoot.getProjectGroup().getId(), scmRoot.getId(), sortedScmRoot );
            }
            catch ( NoBuildAgentException e )
            {
                log.error( "Unable to build projects in project group " + scmRoot.getProjectGroup().getName()
                           + " because there is no build agent configured" );
            }
            catch ( NoBuildAgentInGroupException e )
            {
                log.error( "Unable to build projects in project group " + scmRoot.getProjectGroup().getName()
                           + " because there is no build agent configured in build agent group" );
            }
        }
    }
View Full Code Here


        }

        Map<Integer, Integer> projectsBuildDefinitionsMap = new HashMap<Integer, Integer>();
        projectsBuildDefinitionsMap.put( projectId, buildDef.getId() );

        ProjectScmRoot scmRoot = getProjectScmRootByProject( projectId );
        List<ProjectScmRoot> sortedScmRoot = new ArrayList<ProjectScmRoot>();
        sortedScmRoot.add(scmRoot);

        prepareBuildProjects( projectsBuildDefinitionsMap, buildTrigger, scmRoot.getScmRootAddress(),
                              scmRoot.getProjectGroup().getId(), scmRoot.getId(), sortedScmRoot );
    }
View Full Code Here

        }

        Map<Integer, Integer> projectsBuildDefinitionsMap = new HashMap<Integer, Integer>();
        projectsBuildDefinitionsMap.put( projectId, buildDefinitionId );

        ProjectScmRoot scmRoot = getProjectScmRootByProject( projectId );
        List<ProjectScmRoot> sortedScmRoot = new ArrayList<ProjectScmRoot>();
        sortedScmRoot.add(scmRoot);

        prepareBuildProjects( projectsBuildDefinitionsMap, buildTrigger, scmRoot.getScmRootAddress(),
                              scmRoot.getProjectGroup().getId(), scmRoot.getId(), sortedScmRoot );
    }
View Full Code Here

        try
        {
            boolean removeWorkingDirectory = false;

            Project p = projectDao.getProject( project.getId() );
            ProjectScmRoot projectScmRoot = null;

            if ( !p.getScmUrl().equals( project.getScmUrl() ) )
            {
                removeWorkingDirectory = true;
                projectScmRoot = getProjectScmRootByProject( project.getId() );
View Full Code Here

            if ( !isProjectOkToBuild( projectId, buildDefId ) )
            {
                continue;
            }

            ProjectScmRoot scmRoot = getProjectScmRootByProject( projectId );

            Map<Integer, Integer> projectsAndBuildDefinitionsMap = map.get( scmRoot );

            if ( projectsAndBuildDefinitionsMap == null )
            {
View Full Code Here

            {
                log.info( "not building" );
                continue;
            }

            ProjectScmRoot scmRoot = getProjectScmRootByProject( projectId );

            Map<Integer, Integer> projectsAndBuildDefinitionsMap = map.get( scmRoot );

            if ( projectsAndBuildDefinitionsMap == null )
            {
View Full Code Here

    private ProjectScmRoot createProjectScmRoot( ProjectGroup projectGroup, String url )
        throws ContinuumException
    {
        try
        {
            ProjectScmRoot scmRoot =
                projectScmRootDao.getProjectScmRootByProjectGroupAndScmRootAddress( projectGroup.getId(), url );

            if ( scmRoot != null )
            {
                return null;
            }

            ProjectScmRoot projectScmRoot = new ProjectScmRoot();

            projectScmRoot.setProjectGroup( projectGroup );

            projectScmRoot.setScmRootAddress( url );

            return projectScmRootDao.addProjectScmRoot( projectScmRoot );
        }
        catch ( ContinuumStoreException e )
        {
View Full Code Here

        throws ContinuumException
    {
        try
        {
            removeProjectScmRoot( oldScmRoot );
            ProjectScmRoot scmRoot =
                projectScmRootDao.getProjectScmRootByProjectGroupAndScmRootAddress( project.getProjectGroup().getId(),
                                                                                    project.getScmUrl() );
            if ( scmRoot == null )
            {
                ProjectScmRoot newScmRoot = new ProjectScmRoot();
                if ( project.getScmUrl().equals( oldScmRoot.getScmRootAddress() ) )
                {
                    BeanUtils.copyProperties( oldScmRoot, newScmRoot, new String[]{"id", "projectGroup"} );
                }
                else
                {
                    newScmRoot.setScmRootAddress( project.getScmUrl() );
                }
                newScmRoot.setProjectGroup( project.getProjectGroup() );
                projectScmRootDao.addProjectScmRoot( newScmRoot );
            }
        }
        catch ( ContinuumStoreException ex )
        {
View Full Code Here

        List<ProjectNotifier> notifiers = context.getNotifiers();
        BuildResult build = context.getBuildResult();
        log.error( "br state="+build.getState() );
        log.error( "project state="+project.getState() );
        BuildDefinition buildDefinition = context.getBuildDefinition();
        ProjectScmRoot projectScmRoot = context.getProjectScmRoot();

        boolean isPrepareBuildComplete =
            messageId.equals( ContinuumNotificationDispatcher.MESSAGE_ID_PREPARE_BUILD_COMPLETE );

        if ( projectScmRoot == null && isPrepareBuildComplete )
View Full Code Here

                }
            }
        }
        else
        {
            ProjectScmRoot projectScmRoot = (ProjectScmRoot) tableModel.getCurrentRowBean();

            switch ( projectScmRoot.getState() )
            {
                case ContinuumProjectState.UPDATING:
                case ContinuumProjectState.UPDATED:
                case ContinuumProjectState.ERROR:
                {
                    String state = StateGenerator.generate( projectScmRoot.getState(),
                                                            tableModel.getContext().getContextPath() );

                    if ( !StateGenerator.NEW.equals( state ) )
                    {
                        if ( isAuthorized( projectScmRoot.getProjectGroup().getName() ) &&
                            projectScmRoot.getState() == ContinuumProjectState.ERROR )
                        {
                            return createActionLink( "scmResult", projectScmRoot, state );
                        }
                        else
                        {
View Full Code Here

TOP

Related Classes of org.apache.continuum.model.project.ProjectScmRoot

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.