public boolean removeFromBuildingQueue( int projectId, int buildDefinitionId, int trigger, String projectName ) throws ContinuumException { BuildDefinition buildDefinition = getBuildDefinition( buildDefinitionId ); String buildDefinitionLabel = buildDefinition.getDescription(); if ( StringUtils.isEmpty( buildDefinitionLabel ) ) { buildDefinitionLabel = buildDefinition.getGoals(); } BuildProjectTask buildProjectTask = new BuildProjectTask( projectId, buildDefinitionId, trigger, projectName, buildDefinitionLabel ); return this.buildQueue.remove( buildProjectTask ); }
arguments.append( StringUtils.clean( buildDefinition.getGoals() ) );
public ContinuumBuildExecutionResult build( Project project, BuildDefinition buildDefinition, File buildOutput ) throws ContinuumBuildExecutorException { String executable = getInstallationService().getExecutorConfigurator( InstallationService.MAVEN2_TYPE ) .getExecutable(); StringBuffer arguments = new StringBuffer(); String buildFile = getBuildFileForProject( project, buildDefinition ); if ( !StringUtils.isEmpty( buildFile ) && !"pom.xml".equals( buildFile ) ) { arguments.append( "-f " ).append( buildFile ).append( " " ); } arguments.append( StringUtils.clean( buildDefinition.getArguments() ) ).append( " " ); Properties props = getContinuumSystemProperties( project ); for ( Enumeration itr = props.propertyNames(); itr.hasMoreElements(); ) { String name = (String) itr.nextElement(); String value = props.getProperty( name ); arguments.append( "\"-D" ).append( name ).append( "=" ).append( value ).append( "\" " ); } arguments.append( StringUtils.clean( buildDefinition.getGoals() ) ); Map<String, String> environments = getEnvironments( buildDefinition ); String m2Home = environments.get( getInstallationService().getEnvVar( InstallationService.MAVEN2_TYPE ) ); if ( StringUtils.isNotEmpty( m2Home ) ) { executable = m2Home + File.separator + "bin" + File.separator + executable; setResolveExecutable( false ); } return executeShellCommand( project, executable, arguments.toString(), buildOutput, environments ); }
public ContinuumBuildExecutionResult build( Project project, BuildDefinition buildDefinition, File buildOutput ) throws ContinuumBuildExecutorException { String executable = getInstallationService().getExecutorConfigurator( InstallationService.ANT_TYPE ) .getExecutable(); StringBuffer arguments = new StringBuffer(); String buildFile = getBuildFileForProject( project, buildDefinition ); if ( !StringUtils.isEmpty( buildFile ) ) { arguments.append( "-f " ).append( buildFile ).append( " " ); } arguments.append( StringUtils.clean( buildDefinition.getArguments() ) ).append( " " ); Properties props = getContinuumSystemProperties( project ); for ( Enumeration itr = props.propertyNames(); itr.hasMoreElements(); ) { String name = (String) itr.nextElement(); String value = props.getProperty( name ); arguments.append( "\"-D" ).append( name ).append( "=" ).append( value ).append( "\" " ); } arguments.append( StringUtils.clean( buildDefinition.getGoals() ) ); Map<String, String> environments = getEnvironments( buildDefinition ); String antHome = environments.get( getInstallationService().getEnvVar( InstallationService.ANT_TYPE ) ); if ( StringUtils.isNotEmpty( antHome ) ) { executable = antHome + File.separator + "bin" + File.separator + executable; setResolveExecutable( false ); } return executeShellCommand( project, executable, arguments.toString(), buildOutput, environments ); }
public ContinuumBuildExecutionResult build( Project project, BuildDefinition buildDefinition, File buildOutput, List<Project> projectsWithCommonScmRoot, String projectScmRootUrl ) throws ContinuumBuildExecutorException { String executable = getInstallationService().getExecutorConfigurator( InstallationService.ANT_TYPE ).getExecutable(); StringBuffer arguments = new StringBuffer(); String buildFile = getBuildFileForProject( project, buildDefinition ); if ( !StringUtils.isEmpty( buildFile ) ) { arguments.append( "-f " ).append( buildFile ).append( " " ); } arguments.append( StringUtils.clean( buildDefinition.getArguments() ) ).append( " " ); Properties props = getContinuumSystemProperties( project ); for ( Enumeration itr = props.propertyNames(); itr.hasMoreElements(); ) { String name = (String) itr.nextElement(); String value = props.getProperty( name ); arguments.append( "\"-D" ).append( name ).append( "=" ).append( value ).append( "\" " ); } arguments.append( StringUtils.clean( buildDefinition.getGoals() ) ); Map<String, String> environments = getEnvironments( buildDefinition ); String antHome = environments.get( getInstallationService().getEnvVar( InstallationService.ANT_TYPE ) ); if ( StringUtils.isNotEmpty( antHome ) ) { executable = antHome + File.separator + "bin" + File.separator + executable; setResolveExecutable( false ); } return executeShellCommand( project, executable, arguments.toString(), buildOutput, environments, null, null ); }
public ContinuumBuildExecutionResult build( Project project, BuildDefinition buildDefinition, File buildOutput ) throws ContinuumBuildExecutorException { String executable = getInstallationService().getExecutorConfigurator( InstallationService.MAVEN1_TYPE ) .getExecutable(); StringBuffer arguments = new StringBuffer(); String buildFile = getBuildFileForProject( project, buildDefinition ); if ( !StringUtils.isEmpty( buildFile ) && !"project.xml".equals( buildFile ) ) { arguments.append( "-p " ).append( buildFile ).append( " " ); } arguments.append( StringUtils.clean( buildDefinition.getArguments() ) ).append( " " ); Properties props = getContinuumSystemProperties( project ); for ( Enumeration itr = props.propertyNames(); itr.hasMoreElements(); ) { String name = (String) itr.nextElement(); String value = props.getProperty( name ); arguments.append( "\"-D" ).append( name ).append( "=" ).append( value ).append( "\" " ); } arguments.append( StringUtils.clean( buildDefinition.getGoals() ) ); Map<String, String> environments = getEnvironments( buildDefinition ); String m1Home = environments.get( getInstallationService().getEnvVar( InstallationService.MAVEN1_TYPE ) ); if ( StringUtils.isNotEmpty( m1Home ) ) { executable = m1Home + File.separator + "bin" + File.separator + executable; setResolveExecutable( false ); } return executeShellCommand( project, executable, arguments.toString(), buildOutput, environments ); }
arguments.append( StringUtils.clean( buildDefinition.getGoals() ) );
arguments.append( StringUtils.clean( buildDefinition.getGoals() ) );
arguments.append( StringUtils.clean( buildDefinition.getGoals() ) );
arguments.append( StringUtils.clean( buildDefinition.getGoals() ) );
buildDefinitionLabel = buildDefinition.getGoals();
storedDefinition.setGoals( buildDefinition.getGoals() ); storedDefinition.setArguments( buildDefinition.getArguments() ); storedDefinition.setBuildFile( buildDefinition.getBuildFile() );
/** * @see org.apache.maven.continuum.builddefinition.BuildDefinitionService#cloneBuildDefinition(org.apache.maven.continuum.model.project.BuildDefinition) */ public BuildDefinition cloneBuildDefinition( BuildDefinition buildDefinition ) { BuildDefinition cloned = new BuildDefinition(); cloned.setAlwaysBuild( buildDefinition.isAlwaysBuild() ); cloned.setArguments( buildDefinition.getArguments() ); cloned.setBuildFile( buildDefinition.getBuildFile() ); cloned.setBuildFresh( buildDefinition.isBuildFresh() ); cloned.setDefaultForProject( buildDefinition.isDefaultForProject() ); cloned.setDescription( buildDefinition.getDescription() ); cloned.setGoals( buildDefinition.getGoals() ); cloned.setProfile( buildDefinition.getProfile() ); cloned.setSchedule( buildDefinition.getSchedule() ); cloned.setType( buildDefinition.getType() ); cloned.setTemplate( buildDefinition.isTemplate() ); return cloned; }
/** * @see org.apache.maven.continuum.builddefinition.BuildDefinitionService#cloneBuildDefinition(org.apache.maven.continuum.model.project.BuildDefinition) */ public BuildDefinition cloneBuildDefinition( BuildDefinition buildDefinition ) { BuildDefinition cloned = new BuildDefinition(); cloned.setAlwaysBuild( buildDefinition.isAlwaysBuild() ); cloned.setArguments( buildDefinition.getArguments() ); cloned.setBuildFile( buildDefinition.getBuildFile() ); cloned.setBuildFresh( buildDefinition.isBuildFresh() ); cloned.setDefaultForProject( buildDefinition.isDefaultForProject() ); cloned.setDescription( buildDefinition.getDescription() ); cloned.setGoals( buildDefinition.getGoals() ); cloned.setProfile( buildDefinition.getProfile() ); cloned.setSchedule( buildDefinition.getSchedule() ); cloned.setType( buildDefinition.getType() ); cloned.setTemplate( buildDefinition.isTemplate() ); cloned.setUpdatePolicy( buildDefinition.getUpdatePolicy() ); return cloned; }
public void updateBuildDefinition( BuildDefinition buildDefinition ) throws BuildDefinitionServiceException { try { BuildDefinition storedBuildDefinition = store.getBuildDefinition( buildDefinition.getId() ); storedBuildDefinition.setBuildFresh( buildDefinition.isBuildFresh() ); storedBuildDefinition.setAlwaysBuild( buildDefinition.isAlwaysBuild() ); storedBuildDefinition.setArguments( buildDefinition.getArguments() ); storedBuildDefinition.setBuildFile( buildDefinition.getBuildFile() ); storedBuildDefinition.setDefaultForProject( buildDefinition.isDefaultForProject() ); storedBuildDefinition.setDescription( buildDefinition.getDescription() ); storedBuildDefinition.setGoals( buildDefinition.getGoals() ); storedBuildDefinition.setProfile( buildDefinition.getProfile() ); storedBuildDefinition.setSchedule( buildDefinition.getSchedule() ); storedBuildDefinition.setType( buildDefinition.getType() ); store.storeBuildDefinition( storedBuildDefinition ); } catch ( ContinuumStoreException e ) { throw new BuildDefinitionServiceException( e.getMessage(), e ); } }
public void updateBuildDefinition( BuildDefinition buildDefinition ) throws BuildDefinitionServiceException { try { BuildDefinition storedBuildDefinition = buildDefinitionDao.getBuildDefinition( buildDefinition.getId() ); storedBuildDefinition.setBuildFresh( buildDefinition.isBuildFresh() ); storedBuildDefinition.setAlwaysBuild( buildDefinition.isAlwaysBuild() ); storedBuildDefinition.setArguments( buildDefinition.getArguments() ); storedBuildDefinition.setBuildFile( buildDefinition.getBuildFile() ); storedBuildDefinition.setDefaultForProject( buildDefinition.isDefaultForProject() ); storedBuildDefinition.setDescription( buildDefinition.getDescription() ); storedBuildDefinition.setGoals( buildDefinition.getGoals() ); storedBuildDefinition.setProfile( buildDefinition.getProfile() ); storedBuildDefinition.setSchedule( buildDefinition.getSchedule() ); storedBuildDefinition.setType( buildDefinition.getType() ); storedBuildDefinition.setUpdatePolicy( buildDefinition.getUpdatePolicy() ); buildDefinitionDao.storeBuildDefinition( storedBuildDefinition ); } catch ( ContinuumStoreException e ) { throw new BuildDefinitionServiceException( e.getMessage(), e ); } }
if ( StringUtils.isEmpty( buildDefinitionLabel ) ) buildDefinitionLabel = buildDefinition.getGoals();
storedDefinition.setGoals( buildDefinition.getGoals() ); storedDefinition.setArguments( buildDefinition.getArguments() ); storedDefinition.setBuildFile( buildDefinition.getBuildFile() );