DistributedReleaseManager releaseManager = getContinuum().getDistributedReleaseManager();
Map<String, String> environments = new HashMap<String, String>();
if ( profileId != -1 )
{
Profile profile = getContinuum().getProfileService().getProfile( profileId );
environments = getEnvironments( profile, releaseManager.getDefaultBuildagent( projectId ) );
}
try
{
releaseId = releaseManager.releasePerformFromScm( projectId, goals, arguments, useReleaseProfile, repository, scmUrl,
scmUsername, scmPassword, scmTag, scmTagBase, environments, getPrincipal() );
}
catch ( BuildAgentConfigurationException e )
{
List<String> args = new ArrayList<String>();
args.add( e.getMessage() );
addActionError( getText( "distributedBuild.releasePerform.release.error", args ) );
return ERROR;
}
return SUCCESS;
}
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, null ) );
}
do
{