The goal is to refactoring continuum-core to remove :

  • use of PlexusAction and the context Map which is a real nigthmare to debug ( (minus) ) and/or add improvment.
  • easily add news feature (the plugin feature !)

Using a lifecycle "a la" maven

Why ?

  • easily adding new phases (something to do in the start/middle/end of the build).
  • attach plugins (a phase has a default plugin which is not possible to override)

Phases

Checkout Sources

A particular one checkout-sources ("a la" clean). possible to add plugins here ? (with a previous phase called prepare-checkout-sources ?)

CheckoutSourcesPlugin.java
checkoutSources( ScmInformation scmInformation, ProjectInformation projectInformation )
ScmInformation.java
getScmUrl();
getScmUserName();
getScmPassword();
ProjectInformation.java
// defined constants m2,m1,ant,shell etc...
short getType();
ProjectGroup getProjectGroup();
BuildDefinitionTemplate getBuildDefinitionTemplate();
// for non maven projects
getName();
getVersion();
getName();

Build phases

  • update-sources
  • build-project
  • deploy-artifacts
  • build-reports
  • send-notifications
  • end-build ( ? )

A common interface for all phases or one for each phase (question)

One for all

ContinuumBuildPlugin.java
execute(ContinuumBuildContext continuumBuildContext)
ContinuumBuildContext.java
//like the already existing BuildContext

One interface for each phases

update-sources

ContinuumUpdateSourcesPlugin.java
execute(ProjectInformation projectInformation, ScmResult scmResult)

Note the default one will instantiate scmResult for the next ones

build-project.

ContinuumUpdateSourcesPlugin.java
execute(ProjectInformation projectInformation, ScmResult scmResult, BuildResult buildResult)

build-reports.

ContinuumUpdateSourcesPlugin.java
execute(ProjectInformation projectInformation, ScmResult scmResult, BuildResult buildResult)

This phase will add some BuildReport bean (to define) in BuildResult as a List which will be available for next phases.

send-notifications.

ContinuumUpdateSourcesPlugin.java
execute(ProjectInformation projectInformation, ScmResult scmResult, BuildResult buildResult) (with a new parameter List<BuildReport> buildReports ?)

end-build.

Usefull ?

ContinuumUpdateSourcesPlugin.java
execute(ProjectInformation projectInformation, ScmResult scmResult, BuildResult buildResult) (with a new parameter List<BuildReport> buildReports ?)

Implementations details.

Common

Each phase will have a default implementation which cannot be override.
Attaching plugins to project build will be done at the build definition level. (easy to build some templates).
Each plugin will have an archetype.

  • No labels