Package org.apache.continuum.utils.build

Examples of org.apache.continuum.utils.build.BuildTrigger


         return getString( context, KEY_USERNAME, "" );
    }
   
    public static BuildTrigger getBuildTrigger( Map<String, Object> context )
    {
         return new BuildTrigger( getTrigger( context ), getUsername( context ) );
    }
View Full Code Here


        throws ContinuumBuildAgentException
    {
        if ( buildContexts != null && buildContexts.size() > 0 )
        {
            BuildContext context = buildContexts.get( 0 );
            return new PrepareBuildProjectsTask( buildContexts, new BuildTrigger( context.getTrigger(), context.getUsername() ),
                                             context.getProjectGroupId(), context.getScmRootAddress(), context.getScmRootId() );
        }
        else
        {
            log.info( "Nothing to build" );
View Full Code Here

        catch ( AuthorizationRequiredException e )
        {
            return REQUIRES_AUTHORIZATION;
        }
       
        BuildTrigger buildTrigger = new BuildTrigger( ContinuumProjectState.TRIGGER_FORCED, getPrincipal() );

        try
        {
            if ( projectId > 0 )
            {
                if ( buildDefinitionId > 0 )
                {
                  getContinuum().buildProjectWithBuildDefinition( projectId, buildDefinitionId, buildTrigger );
                }
                else
                {
                  getContinuum().buildProject( projectId, buildTrigger.getUsername() );
                }
            }
            else
            {
                if ( buildDefinitionId > 0 )
                {
                  getContinuum().buildProjectGroupWithBuildDefinition( projectGroupId, buildDefinitionId, buildTrigger );
                }
                else
                {
                    //TODO: Check if this code is called, I don't think
                    //If it is, it should used the projectId
                  getContinuum().buildProjects( buildTrigger.getUsername() );
                }
            }
        }
        catch ( NoBuildAgentException e )
        {
View Full Code Here

    {
        List<BuildContext> buildContexts = ContinuumBuildAgentUtil.getBuildContexts( context );

        for ( BuildContext buildContext : buildContexts )
        {
          BuildTrigger buildTrigger = new BuildTrigger( buildContext.getTrigger(), buildContext.getUsername() );
         
          BuildProjectTask buildProjectTask =
                new BuildProjectTask( buildContext.getProjectId(), buildContext.getBuildDefinitionId(),
                                  buildTrigger, buildContext.getProjectName(), buildContext.getBuildDefinitionLabel(),
                                      buildContext.getScmResult(), buildContext.getProjectGroupId() );
View Full Code Here

    }

    private BuildProjectTask createBuildProjectTask()
    {
        BuildProjectTask task =
            new BuildProjectTask( 1, 1, new BuildTrigger( 1 ), "Test Project", "Default Build Definition",
                                  new ScmResult(), 1 );
        return task;
    }
View Full Code Here

        {
            addActionError( authzE.getMessage() );
            return REQUIRES_AUTHORIZATION;
        }
       
        BuildTrigger buildTrigger = new BuildTrigger( ContinuumProjectState.TRIGGER_FORCED, getPrincipal() );

        try
        {
            if ( this.getBuildDefinitionId() == -1 )
            {
View Full Code Here

        throws TaskExecutionException
    {
        PrepareBuildProjectsTask prepareTask = (PrepareBuildProjectsTask) task;

        Map<Integer, Integer> projectsBuildDefinitionsMap = prepareTask.getProjectsBuildDefinitionsMap();
        BuildTrigger buildTrigger = prepareTask.getBuildTrigger();
        Set<Integer> projectsId = projectsBuildDefinitionsMap.keySet();
        Map<String, Object> context = new HashMap<String, Object>();
        Map<Integer, ScmResult> scmResultMap = new HashMap<Integer, ScmResult>();

        try
View Full Code Here

    private PrepareBuildProjectsTask getPrepareBuildProjectsTask( Map context )
    {
        int projectGroupId = ContinuumBuildConstant.getProjectGroupId( context );
        int scmRootId = ContinuumBuildConstant.getScmRootId( context );
        String scmRootAddress = ContinuumBuildConstant.getScmRootAddress( context );
        BuildTrigger buildTrigger = new BuildTrigger( ContinuumBuildConstant.getTrigger( context ), ContinuumBuildConstant.getUsername( context ) );

        return new PrepareBuildProjectsTask( null, buildTrigger, projectGroupId, null, scmRootAddress, scmRootId );
    }
View Full Code Here

    public void testAddToBuildQueue()
        throws Exception
    {
        final BuildProjectTask buildTask =
          new BuildProjectTask( 2, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-2", "BUILD_DEF", null, 2 );
        final TaskQueue buildQueue = context.mock( TaskQueue.class, "build-queue" );

        context.checking( new Expectations()
        {
            {
View Full Code Here

    private BuildProjectTask getBuildProjectTask( Map context )
    {
        int projectId = ContinuumBuildConstant.getProjectId( context );
        int buildDefinitionId = ContinuumBuildConstant.getBuildDefinitionId( context );
        BuildTrigger buildTrigger = new BuildTrigger( ContinuumBuildConstant.getTrigger( context ), ContinuumBuildConstant.getUsername( context ) );
        int projectGroupId = ContinuumBuildConstant.getProjectGroupId( context );
        String buildDefinitionLabel = ContinuumBuildConstant.getBuildDefinitionLabel( context );

        return new BuildProjectTask( projectId, buildDefinitionId, buildTrigger, null, buildDefinitionLabel, null, projectGroupId );
    }
View Full Code Here

TOP

Related Classes of org.apache.continuum.utils.build.BuildTrigger

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.