private void out( Project project, BuildResult build, String msg ) { System.out.println( "Build event for project '" + project.getName() + "':" + msg ); if ( build != null && !StringUtils.isEmpty( build.getError() ) ) { System.out.println( build.getError() ); } }
private void out( Project project, BuildResult build, String msg ) { System.out.println( "Build event for project '" + project.getName() + "':" + msg ); if ( build != null && !StringUtils.isEmpty( build.getError() ) ) { System.out.println( build.getError() ); } }
protected Properties getContinuumSystemProperties( Project project ) { Properties properties = new Properties(); properties.setProperty( "continuum.project.group.name", project.getProjectGroup().getName() ); properties.setProperty( "continuum.project.lastBuild.state", String.valueOf( project.getOldState() ) ); properties.setProperty( "continuum.project.lastBuild.number", String.valueOf( project.getBuildNumber() ) ); properties.setProperty( "continuum.project.nextBuild.number", String.valueOf( project.getBuildNumber() + 1 ) ); properties.setProperty( "continuum.project.id", String.valueOf( project.getId() ) ); properties.setProperty( "continuum.project.name", project.getName() ); properties.setProperty( "continuum.project.version", project.getVersion() ); return properties; }
protected Properties getContinuumSystemProperties( Project project ) { Properties properties = new Properties(); properties.setProperty( "continuum.project.group.name", project.getProjectGroup().getName() ); properties.setProperty( "continuum.project.lastBuild.state", String.valueOf( project.getOldState() ) ); properties.setProperty( "continuum.project.lastBuild.number", String.valueOf( project.getBuildNumber() ) ); properties.setProperty( "continuum.project.nextBuild.number", String.valueOf( project.getBuildNumber() + 1 ) ); properties.setProperty( "continuum.project.id", String.valueOf( project.getId() ) ); properties.setProperty( "continuum.project.name", project.getName() ); properties.setProperty( "continuum.project.version", project.getVersion() ); return properties; }
getLogger().info( "No MSN recipients for '" + project.getName() + "'." );
private String generateMessage( Project project, BuildResult build ) throws ContinuumException { int state = project.getState(); if ( build != null ) { state = build.getState(); } String message; if ( state == ContinuumProjectState.OK ) { message = "BUILD SUCCESSFUL: " + project.getName(); } else if ( state == ContinuumProjectState.FAILED ) { message = "BUILD FAILURE: " + project.getName(); } else if ( state == ContinuumProjectState.ERROR ) { message = "BUILD ERROR: " + project.getName(); } else { getLogger().warn( "Unknown build state " + state + " for project " + project.getId() ); message = "ERROR: Unknown build state " + state + " for " + project.getName() + " project"; } return message + " " + getReportUrl( project, build, configurationService ); }
public void assertProjectEquals( Project expected, Project actual ) { assertProjectEquals( expected.getName(), expected.getNotifiers(), expected.getVersion(), actual ); }
public void assertProjectEquals( Project expected, Project actual ) { assertProjectEquals( expected.getName(), expected.getNotifiers(), expected.getVersion(), actual ); }
private static String getProjectId( Project project ) { String groupId; String artifactId; if ( project.getGroupId() == null ) { groupId = project.getName(); } else { groupId = project.getGroupId(); } if ( project.getArtifactId() == null ) { artifactId = project.getName(); } else { artifactId = project.getArtifactId(); } return groupId + ":" + artifactId + ":" + project.getVersion(); }
/** * Checks out the sources to the specified directory. * * @param project The project to check out. * @throws ContinuumScmException Thrown in case of a exception while checking out the sources. */ public ScmResult checkOutProject( Project project, Map context ) throws ContinuumScmException { File workingDirectory = workingDirectoryService.getWorkingDirectory( project ); if ( workingDirectory == null ) { throw new ContinuumScmException( "The working directory for the project has to be set. Project: '" + project.getName() + "', id: '" + project.getId() + "'." ); } return checkOut( project, workingDirectory, context ); }
private static String getProjectId( Project project ) { String groupId; String artifactId; if ( project.getGroupId() == null ) { groupId = project.getName(); } else { groupId = project.getGroupId(); } if ( project.getArtifactId() == null ) { artifactId = project.getName(); } else { artifactId = project.getArtifactId(); } String projectGroupId = "[" + project.getProjectGroup().getId() + "]"; return projectGroupId + ":" + groupId + ":" + artifactId + ":" + project.getVersion(); }
public void execute( Map context ) throws Exception { Project project = ContinuumBuildAgentUtil.getProject( context ); logger.info( "Updating project '" + project.getName() + "' from checkout." ); BuildDefinition buildDefinition = ContinuumBuildAgentUtil.getBuildDefinition( context ); File workingDirectory = buildAgentConfigurationService.getWorkingDirectory( project.getId() ); ContinuumAgentBuildExecutor buildExecutor = buildAgentBuildExecutorManager.getBuildExecutor( project.getExecutorId() ); buildExecutor.updateProjectFromWorkingDirectory( workingDirectory, project, buildDefinition ); }
public void assertProjectEquals( String name, List notifiers, String version, Project actual ) { assertEquals( "project.name", name, actual.getName() ); // assertEquals( "project.scmUrl", scmUrl, actual.getScmUrl() ); if ( notifiers != null ) { assertNotNull( "project.notifiers", actual.getNotifiers() ); assertEquals( "project.notifiers.size", notifiers.size(), actual.getNotifiers().size() ); for ( int i = 0; i < notifiers.size(); i++ ) { ProjectNotifier notifier = (ProjectNotifier) notifiers.get( i ); ProjectNotifier actualNotifier = (ProjectNotifier) actual.getNotifiers().get( i ); assertEquals( "project.notifiers.notifier.type", notifier.getType(), actualNotifier.getType() ); assertEquals( "project.notifiers.notifier.configuration.address", notifier.getConfiguration().get( "address" ), actualNotifier.getConfiguration().get( "address" ) ); } } assertEquals( "project.version", version, actual.getVersion() ); }
public void assertProjectEquals( String name, List<ProjectNotifier> notifiers, String version, Project actual ) { assertEquals( "project.name", name, actual.getName() ); // assertEquals( "project.scmUrl", scmUrl, actual.getScmUrl() ); if ( notifiers != null ) { assertNotNull( "project.notifiers", actual.getNotifiers() ); assertEquals( "project.notifiers.size", notifiers.size(), actual.getNotifiers().size() ); for ( int i = 0; i < notifiers.size(); i++ ) { ProjectNotifier notifier = notifiers.get( i ); ProjectNotifier actualNotifier = (ProjectNotifier) actual.getNotifiers().get( i ); assertEquals( "project.notifiers.notifier.type", notifier.getType(), actualNotifier.getType() ); assertEquals( "project.notifiers.notifier.configuration.address", notifier.getConfiguration().get( "address" ), actualNotifier.getConfiguration().get( "address" ) ); } } assertEquals( "project.version", version, actual.getVersion() ); }
public void execute( Map context ) throws Exception { Project project = store.getProject( getProjectId( context ) ); CheckOutTask checkOutTask = new CheckOutTask( project.getId(), workingDirectoryService.getWorkingDirectory( project ), project.getName() ); checkOutQueue.put( checkOutTask ); } }
parallelBuildsManager.checkoutProject( project.getId(), project.getName(), workingDirectoryService.getWorkingDirectory( project ), scmRootUrl, scmUsername, scmPassword, defaultBuildDefinition,
public void execute( Map context ) throws Exception { Project project = ContinuumBuildAgentUtil.getProject( context ); try { File workingDirectory = buildAgentConfigurationService.getWorkingDirectory( project.getId() ); ContinuumScmConfiguration config = createScmConfiguration( project, workingDirectory ); config.setLatestUpdateDate( ContinuumBuildAgentUtil.getLatestUpdateDate( context ) ); getLogger().info( "Getting changeLog of project: " + project.getName() ); ChangeLogScmResult changeLogResult = scm.changeLog( config ); if ( !changeLogResult.isSuccess() ) { getLogger().warn( "Error getting change log of project " + project.getName() ); getLogger().warn( "Command Output: " + changeLogResult.getCommandOutput() ); getLogger().warn( "Provider Message: " + changeLogResult.getProviderMessage() ); } context.put( ContinuumBuildAgentUtil.KEY_LATEST_UPDATE_DATE, getLatestUpdateDate( changeLogResult ) ); } catch ( ScmException e ) { context.put( ContinuumBuildAgentUtil.KEY_LATEST_UPDATE_DATE, null ); getLogger().error( e.getMessage(), e ); } }
getLogger().info( "Updating project '" + project.getName() + "' from checkout." );
public void execute( Map context ) throws ContinuumStoreException, ContinuumException, ContinuumBuildExecutorException { Project project = getProject( context ); project = store.getProjectWithAllDetails( project.getId() ); getLogger().info( "Updating project '" + project.getName() + "' from checkout." ); BuildDefinition buildDefinition = store.getBuildDefinition( getBuildDefinitionId( context ) ); // ---------------------------------------------------------------------- // Make a new descriptor // ---------------------------------------------------------------------- ContinuumBuildExecutor builder = buildExecutorManager.getBuildExecutor( project.getExecutorId() ); builder.updateProjectFromCheckOut( workingDirectoryService.getWorkingDirectory( project ), project, buildDefinition ); // ---------------------------------------------------------------------- // Store the new descriptor // ---------------------------------------------------------------------- store.updateProject( project ); } }
getLogger().info( "Remove project " + project.getName() + "(" + projectId + ")" );