Package org.apache.continuum.release.config

Examples of org.apache.continuum.release.config.ContinuumReleaseDescriptor


        File workDir = new File( getBasedir(), "target/test-classes/work-dir" );
        FileUtils.deleteDirectory( workDir );
        File testDir = new File( getBasedir(), "target/test-classes/test-dir" );
        FileUtils.deleteDirectory( testDir );

        ContinuumReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();
        descriptor.setInteractive( false );
        descriptor.setScmSourceUrl( "scm:svn:file://localhost/" + scmPath + "/trunk" );
        descriptor.setWorkingDirectory( workDir.getAbsolutePath() );
        descriptor.mapReleaseVersion( "test-group:test-artifact", "2.0" );
        descriptor.mapDevelopmentVersion( "test-group:test-artifact", "2.1-SNAPSHOT" );

        ScmRepository repository = getScmRepositorty( descriptor.getScmSourceUrl() );
        ScmFileSet fileSet = new ScmFileSet( workDir );
        scmManager.getProviderByRepository( repository ).checkOut( repository, fileSet, (ScmVersion) null );

        String pom = FileUtils.fileRead( new File( workDir, "pom.xml" ) );
        assertTrue( "Test dev version", pom.indexOf( "<version>1.1-SNAPSHOT</version>" ) > 0 );
View Full Code Here


        File workDir = new File( getBasedir(), "target/test-classes/work-dir" );
        FileUtils.deleteDirectory( workDir );
        File testDir = new File( getBasedir(), "target/test-classes/test-dir" );
        FileUtils.deleteDirectory( testDir );

        ContinuumReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();
        descriptor.setInteractive( false );
        descriptor.setScmSourceUrl( "scm:svn:file://localhost/" + scmPath + "/trunk" );
        descriptor.setWorkingDirectory( workDir.getAbsolutePath() );

        ScmRepository repository = getScmRepositorty( descriptor.getScmSourceUrl() );
        ScmFileSet fileSet = new ScmFileSet( workDir );
        scmManager.getProviderByRepository( repository ).checkOut( repository, fileSet, (ScmVersion) null );

        String pom = FileUtils.fileRead( new File( workDir, "pom.xml" ) );
        assertTrue( "Test dev version", pom.indexOf( "<version>1.1-SNAPSHOT</version>" ) > 0 );
View Full Code Here

    public String releasePerformFromScm( String goals, String arguments, boolean useReleaseProfile, Map repository,
                                         String scmUrl, String scmUsername, String scmPassword, String scmTag,
                                         String scmTagBase, Map<String, String> environments, String username )
        throws ContinuumReleaseException
    {
        ContinuumReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();
        descriptor.setScmSourceUrl( scmUrl );
        descriptor.setScmUsername( scmUsername );
        descriptor.setScmPassword( scmPassword );
        descriptor.setScmReleaseLabel( scmTag );
        descriptor.setScmTagBase( scmTagBase );
        descriptor.setEnvironments( environments );

        String releaseId = "";

        do
        {
View Full Code Here

        result.setStartTime( System.currentTimeMillis() );
        result.setEndTime( System.currentTimeMillis() );
        result.setResultCode( 200 );
        result.appendOutput( "Error in release" );

        ContinuumReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();
        descriptor.setPreparationGoals( "clean" );
        descriptor.setReleaseBy( "admin" );

        continuum.getReleaseManager().getReleaseResults().put( "test-release-id", result );
        continuum.getReleaseManager().getPreparedReleases().put( "test-release-id", descriptor );

        ContinuumReleaseResult releaseResult = continuum.addContinuumReleaseResult( project.getId(), "test-release-id",
View Full Code Here

            }
        }
        else
        {
            result = (ReleaseResult) releaseManager.getReleaseResults().get( releaseId );
            ContinuumReleaseDescriptor descriptor =
                (ContinuumReleaseDescriptor) releaseManager.getPreparedReleases().get( releaseId );
            if ( descriptor != null )
            {
                releaseBy = descriptor.getReleaseBy();
            }
        }

        if ( result != null && getContinuumReleaseResult( projectId, releaseType, result.getStartTime(),
                                                          result.getEndTime() ) == null )
View Full Code Here

    public void testWorkingDirDoesNotExist()
        throws Exception
    {
        assertNotNull( phase );

        ContinuumReleaseDescriptor releaseDescriptor = createReleaseDescriptor();

        File workingDirectory = new File( releaseDescriptor.getWorkingDirectory() );

        FileUtils.deleteDirectory( workingDirectory );
        assertFalse( workingDirectory.exists() );

        phase.execute( releaseDescriptor, new Settings(), null );
View Full Code Here

    public void testWorkingDirAlreadyExistsWithProjectCheckout()
        throws Exception
    {
        assertNotNull( phase );

        ContinuumReleaseDescriptor releaseDescriptor = createReleaseDescriptor();

        File workingDirectory = new File( releaseDescriptor.getWorkingDirectory() );

        // assert working directory already exists with project checkout
        assertTrue( workingDirectory.exists() );
        assertTrue( workingDirectory.listFiles().length > 0 );
View Full Code Here

    public void testWorkingDirAlreadyExistsNoProjectCheckout()
        throws Exception
    {
        assertNotNull( phase );

        ContinuumReleaseDescriptor releaseDescriptor = createReleaseDescriptor();

        File workingDirectory = new File( releaseDescriptor.getWorkingDirectory() );
        FileUtils.deleteDirectory( workingDirectory );
        workingDirectory.mkdirs();

        // assert empty working directory
        assertTrue( workingDirectory.exists() );
View Full Code Here

        // project source and working directory paths
        String projectUrl = getBasedir() + "/target/scm-test/trunk";
        String workingDirPath = getBasedir() + "/target/test-classes/updateWorkingCopy_working-directory";

        // create release descriptor
        ContinuumReleaseDescriptor releaseDescriptor = new ContinuumReleaseDescriptor();
        releaseDescriptor.setScmSourceUrl( "scm:svn:file://localhost/" + projectUrl );
        releaseDescriptor.setWorkingDirectory( workingDirPath );

        return releaseDescriptor;
    }
View Full Code Here

    private ReleaseDescriptor getReleaseDescriptor( Project project, Properties releaseProperties,
                                                    Map<String, String> relVersions, Map<String, String> devVersions,
                                                    Map<String, String> environments, String workingDirectory,
                                                    String executable )
    {
        ContinuumReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();

        //release properties from the project
        descriptor.setWorkingDirectory( workingDirectory );
        descriptor.setScmSourceUrl( project.getScmUrl() );

        //required properties
        descriptor.setScmReleaseLabel( releaseProperties.getProperty( "scm-tag" ) );
        descriptor.setScmTagBase( releaseProperties.getProperty( "scm-tagbase" ) );
        descriptor.setReleaseVersions( relVersions );
        descriptor.setDevelopmentVersions( devVersions );
        descriptor.setPreparationGoals( releaseProperties.getProperty( "preparation-goals" ) );
        descriptor.setAdditionalArguments( releaseProperties.getProperty( "arguments" ) );
        descriptor.setAddSchema( Boolean.valueOf( releaseProperties.getProperty( "add-schema" ) ) );
        descriptor.setAutoVersionSubmodules( Boolean.valueOf( releaseProperties.getProperty(
            "auto-version-submodules" ) ) );

        String useEditMode = releaseProperties.getProperty( "use-edit-mode" );
        if ( BooleanUtils.toBoolean( useEditMode ) )
        {
            descriptor.setScmUseEditMode( Boolean.valueOf( useEditMode ) );
        }

        LocalRepository repository = project.getProjectGroup().getLocalRepository();

        if ( repository != null )
        {
            String args = descriptor.getAdditionalArguments();

            if ( StringUtils.isNotEmpty( args ) )
            {
                descriptor.setAdditionalArguments( args +
                                                       " \"-Dmaven.repo.local=" + repository.getLocation() + "\"" );
            }
            else
            {
                descriptor.setAdditionalArguments( "\"-Dmaven.repo.local=" + repository.getLocation() + "\"" );
            }
        }

        //other properties
        if ( releaseProperties.containsKey( "scm-username" ) )
        {
            descriptor.setScmUsername( releaseProperties.getProperty( "scm-username" ) );
        }
        if ( releaseProperties.containsKey( "scm-password" ) )
        {
            descriptor.setScmPassword( releaseProperties.getProperty( "scm-password" ) );
        }
        if ( releaseProperties.containsKey( "scm-comment-prefix" ) )
        {
            descriptor.setScmCommentPrefix( releaseProperties.getProperty( "scm-comment-prefix" ) );
        }
        if ( releaseProperties.containsKey( "use-release-profile" ) )
        {
            descriptor.setUseReleaseProfile( Boolean.valueOf( releaseProperties.getProperty(
                "use-release-profile" ) ) );
        }

        //forced properties
        descriptor.setInteractive( false );

        //set environments
        descriptor.setEnvironments( environments );
        descriptor.setExecutable( executable );

        //release by
        descriptor.setReleaseBy( releaseProperties.getProperty( "release-by" ) );

        return descriptor;
    }
View Full Code Here

TOP

Related Classes of org.apache.continuum.release.config.ContinuumReleaseDescriptor

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.