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() );

        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>2.1-SNAPSHOT</version>" ) > 0 );

        doPrepareWithNoError( descriptor );

        pom = FileUtils.fileRead( new File( workDir, "pom.xml" ) );
        assertTrue( "Test version increment", pom.indexOf( "<version>2.2-SNAPSHOT</version>" ) > 0 );

        repository = getScmRepositorty( "scm:svn:file://localhost/" + scmPath + "/tags/test-artifact-2.1" );
        fileSet = new ScmFileSet( testDir );
        scmManager.getProviderByRepository( repository ).checkOut( repository, fileSet, (ScmVersion) null );

        pom = FileUtils.fileRead( new File( testDir, "pom.xml" ) );
        assertTrue( "Test released version", pom.indexOf( "<version>2.1</version>" ) > 0 );

        File file = new File( descriptor.getWorkingDirectory(), "release.properties" );
        assertTrue( "release.properties file does not exist", file.exists() );

        Properties properties = new Properties();

        InputStream inStream = null;
View Full Code Here


        }
        else
        {
            ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();
   
            ContinuumReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();
            descriptor.setScmSourceUrl( scmUrl );
            descriptor.setScmUsername( scmUsername );
            descriptor.setScmPassword( scmPassword );
            descriptor.setScmReleaseLabel( scmTag );
            descriptor.setScmTagBase( scmTagBase );
   
            if ( profileId != -1 )
            {
                Profile profile = getContinuum().getProfileService().getProfile( profileId );
                descriptor.setEnvironments( getEnvironments( profile ) );
            }
   
            do
            {
                releaseId = String.valueOf( System.currentTimeMillis() );
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 )
        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

    public String executeFromScm()
        throws Exception
    {
        ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();

        ContinuumReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();
        descriptor.setScmSourceUrl( scmUrl );
        descriptor.setScmUsername( scmUsername );
        descriptor.setScmPassword( scmPassword );
        descriptor.setScmReleaseLabel( scmTag );
        descriptor.setScmTagBase( scmTagBase );
       
        Profile profile = null;
       
        if ( profileId != -1 )
        {
            profile = getContinuum().getProfileService().getProfile( profileId );
            descriptor.setEnvironments( releaseManager.getEnvironments( profile ) );
        }

        do
        {
            releaseId = String.valueOf( System.currentTimeMillis() );
View Full Code Here

    }

    private ReleaseDescriptor getReleaseDescriptor( Project project, Properties releaseProperties, Map relVersions,
                                                    Map devVersions, Profile profile )
    {
        ContinuumReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();
        String workingDirectory = workingDirectoryService.getWorkingDirectory( project ).getPath();

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

        //required properties
        descriptor.setScmReleaseLabel( releaseProperties.getProperty( "tag" ) );
        descriptor.setScmTagBase( releaseProperties.getProperty( "tagBase" ) );
        descriptor.setReleaseVersions( relVersions );
        descriptor.setDevelopmentVersions( devVersions );
        descriptor.setPreparationGoals( releaseProperties.getProperty( "prepareGoals" ) );
       
        LocalRepository repository = project.getProjectGroup().getLocalRepository();
       
        if ( repository != null )
        {
            descriptor.setAdditionalArguments( "\"-Dmaven.repo.local=" + repository.getLocation() + "\"" );
        }
       
        //other properties
        if ( releaseProperties.containsKey( "username" ) )
        {
            descriptor.setScmUsername( releaseProperties.getProperty( "username" ) );
        }
        if ( releaseProperties.containsKey( "password" ) )
        {
            descriptor.setScmPassword( releaseProperties.getProperty( "password" ) );
        }

        //forced properties
        descriptor.setInteractive( false );
       
        //set environments
        descriptor.setEnvironments( getEnvironments( profile ) );
       
        return descriptor;
    }
View Full Code Here

    }

    private ReleaseDescriptor readReleaseDescriptor( String workingDirectory )
        throws ContinuumReleaseException
    {
        ReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();
        descriptor.setWorkingDirectory( workingDirectory );

        try
        {
            descriptor = releaseStore.read( descriptor );
        }
View Full Code Here

    }

    private ReleaseDescriptor getReleaseDescriptor( Project project, Properties releaseProperties, Map relVersions,
                                                    Map devVersions, Profile profile )
    {
        ContinuumReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();
        String workingDirectory = workingDirectoryService.getWorkingDirectory( project ).getPath();

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

        //required properties
        descriptor.setScmReleaseLabel( releaseProperties.getProperty( "tag" ) );
        descriptor.setScmTagBase( releaseProperties.getProperty( "tagBase" ) );
        descriptor.setReleaseVersions( relVersions );
        descriptor.setDevelopmentVersions( devVersions );
        descriptor.setPreparationGoals( releaseProperties.getProperty( "prepareGoals" ) );
       
        String useEditMode = releaseProperties.getProperty( "useEditMode" );
        if ( BooleanUtils.toBoolean( useEditMode ) )
        {
            descriptor.setScmUseEditMode( Boolean.valueOf( useEditMode ) );
        }
       
        LocalRepository repository = project.getProjectGroup().getLocalRepository();
       
        if ( repository != null )
        {
            descriptor.setAdditionalArguments( "\"-Dmaven.repo.local=" + repository.getLocation() + "\"" );
        }
       
        //other properties
        if ( releaseProperties.containsKey( "username" ) )
        {
            descriptor.setScmUsername( releaseProperties.getProperty( "username" ) );
        }
        if ( releaseProperties.containsKey( "password" ) )
        {
            descriptor.setScmPassword( releaseProperties.getProperty( "password" ) );
        }

        //forced properties
        descriptor.setInteractive( false );
       
        //set environments
        descriptor.setEnvironments( getEnvironments( profile ) );
       
        return descriptor;
    }
View Full Code Here

    }

    private ReleaseDescriptor readReleaseDescriptor( String workingDirectory )
        throws ContinuumReleaseException
    {
        ReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();
        descriptor.setWorkingDirectory( workingDirectory );

        try
        {
            descriptor = releaseStore.read( 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.