You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@continuum.apache.org by jv...@apache.org on 2005/07/19 00:26:44 UTC
svn commit: r219578 - in /maven/continuum/trunk:
continuum-api/src/main/java/org/apache/maven/continuum/
continuum-core/src/main/java/org/apache/maven/continuum/
continuum-core/src/main/resources/META-INF/plexus/
continuum-plexus-application/ continuum...
Author: jvanzyl
Date: Mon Jul 18 15:23:39 2005
New Revision: 219578
URL: http://svn.apache.org/viewcvs?rev=219578&view=rev
Log:
o committing for trygve
Added:
maven/continuum/trunk/continuum-site/src/site/apt/articles.apt
Modified:
maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
maven/continuum/trunk/continuum-plexus-application/pom.xml
maven/continuum/trunk/continuum-plexus-application/src/conf/application.xml
maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/validation/ScmUrlValidator.java
maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml
maven/continuum/trunk/continuum-web/src/main/resources/forms/mavenTwoProject.xml
maven/continuum/trunk/continuum-web/src/main/resources/localization/Continuum.properties
maven/continuum/trunk/continuum-web/src/main/resources/templates/CommonMacros.vm
maven/continuum/trunk/continuum-web/src/main/resources/templates/navigations/Menu.vm
maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Add.vm
Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java?rev=219578&r1=219577&r2=219578&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java (original)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java Mon Jul 18 15:23:39 2005
@@ -27,8 +27,10 @@
import org.apache.maven.continuum.project.MavenTwoProject;
import org.apache.maven.continuum.project.ShellProject;
import org.apache.maven.continuum.project.ContinuumNotifier;
+import org.apache.maven.continuum.project.ContinuumSchedule;
import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
import org.apache.maven.continuum.scm.ScmResult;
+import org.apache.maven.continuum.store.ContinuumStoreException;
import org.codehaus.plexus.util.dag.CycleDetectedException;
/**
@@ -177,4 +179,21 @@
void removeNotifier( String projectId, String notifierType )
throws ContinuumException;
+
+ // ----------------------------------------------------------------------
+ // Schedules
+ // ----------------------------------------------------------------------
+
+ public ContinuumSchedule getSchedule( String scheduleId )
+ throws ContinuumException;
+
+ public void addSchedule( ContinuumSchedule schedule )
+ throws ContinuumException;
+
+ public void updateSchedule( ContinuumSchedule schedule )
+ throws ContinuumException;
+
+ public void removeSchedule( String scheduleId )
+ throws ContinuumException;
+
}
Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=219578&r1=219577&r2=219578&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java Mon Jul 18 15:23:39 2005
@@ -41,9 +41,12 @@
import org.apache.maven.continuum.scheduler.ContinuumScheduler;
import org.apache.maven.continuum.scheduler.ContinuumSchedulerConstants;
import org.apache.maven.continuum.configuration.ConfigurationService;
+import org.apache.maven.continuum.store.ContinuumStore;
+import org.apache.maven.continuum.store.ContinuumStoreException;
import org.codehaus.plexus.action.ActionManager;
import org.codehaus.plexus.logging.AbstractLogEnabled;
import org.codehaus.plexus.util.dag.CycleDetectedException;
+import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
@@ -75,6 +78,9 @@
/** @plexus.requirement */
private ConfigurationService configurationService;
+ /** @plexus.requirement */
+ private ContinuumStore store;
+
// ----------------------------------------------------------------------
// Projects
// ----------------------------------------------------------------------
@@ -659,24 +665,60 @@
// Build Scheduling
// ----------------------------------------------------------------------
- public ContinuumSchedule getSchedule( String id )
+ public ContinuumSchedule getSchedule( String scheduleId )
+ throws ContinuumException
{
- return null;
+ try
+ {
+ ContinuumSchedule schedule = store.getSchedule( scheduleId );
+
+ return schedule;
+ }
+ catch ( ContinuumStoreException ex )
+ {
+ throw logAndCreateException( "Exception while getting project '" + scheduleId + "'.", ex );
+ }
}
public void addSchedule( ContinuumSchedule schedule )
+ throws ContinuumException
{
+ try
+ {
+ store.addSchedule( schedule );
+ }
+ catch ( ContinuumStoreException ex )
+ {
+ throw logAndCreateException( "Error while removing project.", ex );
+ }
}
public void updateSchedule( ContinuumSchedule schedule )
+ throws ContinuumException
{
+ try
+ {
+ store.updateSchedule( schedule );
+ }
+ catch ( ContinuumStoreException ex )
+ {
+ throw logAndCreateException( "Error while removing project.", ex );
+ }
}
- public void removeSchedule( ContinuumSchedule schedule )
+ public void removeSchedule( String scheduleId )
+ throws ContinuumException
{
+ try
+ {
+ store.removeSchedule( scheduleId );
+ }
+ catch ( ContinuumStoreException ex )
+ {
+ throw logAndCreateException( "Error while removing project.", ex );
+ }
}
-
public void addScheduleToProject( ContinuumProject project, ContinuumSchedule schedule )
{
project.addSchedule( schedule );
@@ -710,6 +752,19 @@
schedule.setScmMode( ContinuumSchedulerConstants.DEFAULT_SCHEDULE_SCM_MODE );
+ schedule.setActive( true );
+
schedule.setCronExpression( ContinuumSchedulerConstants.DEFAULT_CRON_EXPRESSION );
+ }
+
+ // ----------------------------------------------------------------------
+ // Logging
+ // ----------------------------------------------------------------------
+
+ private ContinuumException logAndCreateException( String message, Throwable cause )
+ {
+ getLogger().error( message, cause );
+
+ return new ContinuumException( message, cause );
}
}
Modified: maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml?rev=219578&r1=219577&r2=219578&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml (original)
+++ maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml Mon Jul 18 15:23:39 2005
@@ -57,6 +57,9 @@
<requirement>
<role>org.apache.maven.continuum.configuration.ConfigurationService</role>
</requirement>
+ <requirement>
+ <role>org.apache.maven.continuum.store.ContinuumStore</role>
+ </requirement>
</requirements>
</component>
Modified: maven/continuum/trunk/continuum-plexus-application/pom.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-plexus-application/pom.xml?rev=219578&r1=219577&r2=219578&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-plexus-application/pom.xml (original)
+++ maven/continuum/trunk/continuum-plexus-application/pom.xml Mon Jul 18 15:23:39 2005
@@ -62,12 +62,12 @@
<groupId>plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>1.0.1</version>
- </dependency>
+ </dependency>
<dependency>
<groupId>plexus</groupId>
<artifactId>plexus-appserver</artifactId>
<version>1.0-alpha-3</version>
- </dependency>
+ </dependency>
<dependency>
<groupId>plexus</groupId>
<artifactId>plexus-container-artifact</artifactId>
@@ -158,6 +158,34 @@
<scope>runtime</scope>
</dependency>
</dependencies>
+
+ <profiles>
+ <profile>
+ <id>env-test</id>
+ <activator>
+ <property>
+ <name>env</name>
+ <value>test</value>
+ </property>
+ </activator>
+ <properties>
+ <appProperties>test.properties</appProperties>
+ </properties>
+ </profile>
+ <profile>
+ <id>env-production</id>
+ <activator>
+ <property>
+ <name>env</name>
+ <value>production</value>
+ </property>
+ </activator>
+ <properties>
+ <appProperties>test.properties</appProperties>
+ </properties>
+ </profile>
+ </profiles>
+
<build>
<plugins>
<plugin>
@@ -169,7 +197,7 @@
<configurationProperties>app.properties</configurationProperties>
<applicationName>continuum</applicationName>
<runtimeConfiguration>src/test/conf/test-runtime-configuration.xml</runtimeConfiguration>
- <runtimeConfigurationProperties>app.properties</runtimeConfigurationProperties>
+ <runtimeConfigurationProperties>${appProperties}</runtimeConfigurationProperties>
<runtimePath>target/plexus-test-runtime</runtimePath>
</configuration>
<executions>
Modified: maven/continuum/trunk/continuum-plexus-application/src/conf/application.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-plexus-application/src/conf/application.xml?rev=219578&r1=219577&r2=219578&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-plexus-application/src/conf/application.xml (original)
+++ maven/continuum/trunk/continuum-plexus-application/src/conf/application.xml Mon Jul 18 15:23:39 2005
@@ -6,7 +6,7 @@
</component>
<component>
<role>org.apache.maven.continuum.trigger.ContinuumTrigger</role>
- <role-hint>alarm-clock</role-hint>
+ <role-hint>quartz-alarm-clock</role-hint>
</component>
<component>
<role>org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor</role>
@@ -220,6 +220,32 @@
<delay>3600</delay>
</configuration>
</component>
+
+ <component>
+ <role>org.apache.maven.continuum.trigger.ContinuumTrigger</role>
+ <role-hint>quartz-alarm-clock</role-hint>
+ <implementation>org.apache.maven.continuum.trigger.quartz.QuartzAlarmClockTrigger</implementation>
+ <requirements>
+ <requirement>
+ <role>org.apache.maven.continuum.Continuum</role>
+ </requirement>
+ <requirement>
+ <role>org.apache.maven.continuum.scheduler.ContinuumScheduler</role>
+ </requirement>
+ </requirements>
+ <configuration>
+ <!--
+ | The interval in number of seconds between scheduling the projects.
+ | The default value is one hour.
+ |-->
+ <interval>3600</interval>
+ <!--
+ | The delay to wait after startup.
+ | The default value is one hour.
+ |-->
+ <delay>3600</delay>
+ </configuration>
+ </component>
<component>
<role>org.apache.maven.continuum.network.ConnectionFactory</role>
Added: maven/continuum/trunk/continuum-site/src/site/apt/articles.apt
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-site/src/site/apt/articles.apt?rev=219578&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-site/src/site/apt/articles.apt (added)
+++ maven/continuum/trunk/continuum-site/src/site/apt/articles.apt Mon Jul 18 15:23:39 2005
@@ -0,0 +1,14 @@
+ ------
+ Articles on CI
+ ------
+ Jason van Zyl
+ ------
+
+Articles on CI
+
+ * {{{http://www.martinfowler.com/articles/continuousIntegration.html}Continuous Integration}}
+
+ * {{{http://www.joelonsoftware.com/articles/fog0000000023.html}Daily Builds Are Your Friend}}
+
+ * {{{http://www.stevemcconnell.com/bp04.htm}Daily Builds and Smoke Test}}
+
Modified: maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/validation/ScmUrlValidator.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/validation/ScmUrlValidator.java?rev=219578&r1=219577&r2=219578&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/validation/ScmUrlValidator.java (original)
+++ maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/validation/ScmUrlValidator.java Mon Jul 18 15:23:39 2005
@@ -38,13 +38,12 @@
throws FormicaException
{
List messages = scmManager.validateScmRepository( scmUrl );
+
if (messages.size() != 0)
{
- throw new RuntimeException( "Error : " + messages.get(0));
- }
- else
- {
- return messages.size() == 0;
+ return false;
}
+
+ return true;
}
}
Modified: maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml?rev=219578&r1=219577&r2=219578&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml Mon Jul 18 15:23:39 2005
@@ -101,6 +101,11 @@
<role>org.apache.maven.continuum.web.tool.FormicaTool</role>
<scope>global</scope>
</tool>
+ <tool>
+ <name>formDataTool</name>
+ <role>org.apache.maven.continuum.web.tool.FormDataTool</role>
+ <scope>global</scope>
+ </tool>
</tools>
</configuration>
</component>
@@ -115,6 +120,12 @@
<role>csstool</role>
<implementation>org.apache.maven.continuum.web.tool.CssTool</implementation>
<instantiation-strategy>per-lookup</instantiation-strategy>
+ <configuration/>
+ </component>
+
+ <component>
+ <role>org.apache.maven.continuum.web.tool.FormDataTool</role>
+ <implementation>org.apache.maven.continuum.web.tool.FormDataTool</implementation>
<configuration/>
</component>
Modified: maven/continuum/trunk/continuum-web/src/main/resources/forms/mavenTwoProject.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/forms/mavenTwoProject.xml?rev=219578&r1=219577&r2=219578&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/forms/mavenTwoProject.xml (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/forms/mavenTwoProject.xml Mon Jul 18 15:23:39 2005
@@ -33,6 +33,7 @@
<action>updateEntity</action>
<view>Summary.vm</view>
<view-on-failure>Edit.vm</view-on-failure>
+ <fid-on-failure>maven2Project</fid-on-failure>
<expression>updateMavenTwoProject(#entity)</expression>
</update>
Modified: maven/continuum/trunk/continuum-web/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/localization/Continuum.properties?rev=219578&r1=219577&r2=219578&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/localization/Continuum.properties (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/localization/Continuum.properties Mon Jul 18 15:23:39 2005
@@ -169,3 +169,32 @@
msn.password.label = MSN Password
msn.password.message = Enter your password
+
+// ----------------------------------------------------------------------
+// Schedules
+// ----------------------------------------------------------------------
+
+schedule.addTitle = Add Schedule
+
+schedule.updateTitle = Update Schedule
+
+scheduleName.label = Name
+scheduleName.message = Enter the name of the schedule
+scheduleName.error = You must enter a name for the schedule
+
+scheduleDescription.label = Description
+scheduleDescription.message = Enter a description of the schedule
+scheduleDescription.error = You must enter a description for the schedule
+
+scheduleScmMode.label = Scm Mode
+scheduleScmMode.message = Enter an scm mode
+scheduleScmMode.error = none
+
+scheduleCronExpression.label = Cron Expression
+scheduleCronExpression.message = Enter the cron expression
+xscheduleCronExpression.error = You must enter a cron expression
+
+scheduleActive.label = Active
+scheduleActive.message = Activate or deactivate the schedule
+scheduleActive.error = none
+
Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/CommonMacros.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/CommonMacros.vm?rev=219578&r1=219577&r2=219578&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/CommonMacros.vm (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/CommonMacros.vm Mon Jul 18 15:23:39 2005
@@ -29,6 +29,10 @@
#radio( $element $elementData )
#elseif ( $element.type == "upload" )
#upload( $element $elementData )
+ #elseif ( $element.type == "pulldown" )
+ #pulldown( $element $elementData )
+ #elseif ( $element.type == "checkbox" )
+ #checkbox( $element $elementData )
#end
<p>
$i18n.getString( $element.messageKey ) <font color="red"><b>$!errorMsg</b></font>
@@ -77,13 +81,14 @@
#end
#macro ( checkbox $element $elementData )
-<input type="checkbox" name="$element.id" value=""/>
+>>>>> $elementData
+<input type="checkbox" name="$element.id"/>
#end
#macro ( pulldown $element $elementData )
<select name="$element.id">
- #foreach ( $datum in $elementData )
- <option>
+ #foreach ( $datum in $formDataTool.pulldown( $element.data ) )
+ <option value="$datum.name">$datum.value
#end
</select>
#end
@@ -105,4 +110,4 @@
##The Selection Box.
-##Active Images.
+##Active Images.
\ No newline at end of file
Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/navigations/Menu.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/navigations/Menu.vm?rev=219578&r1=219577&r2=219578&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/navigations/Menu.vm (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/navigations/Menu.vm Mon Jul 18 15:23:39 2005
@@ -1,29 +1,55 @@
<div id="navcolum">
- <div id="projecttools" class="toolgroup">
- <div class="label">Continuum</div>
- <div class="body">
- <div><a href="$link.setPage('Summary.vm').addPathInfo( 'fid', 'continuumProject')">Show Projects</a></div>
+ <div id="projecttools" class="toolgroup">
+ <div class="label">Continuum</div>
+ <div class="body">
+ <div>
+ <a href="$link.setPage('Summary.vm').addPathInfo( 'fid', 'continuumProject')">Show Projects</a>
+ </div>
+ </div>
+ </div>
+
+ <div id="projecttools" class="toolgroup">
+ <div class="label">Add Project</div>
+ <div class="body">
+ <div>
+ <a href="$link.setPage('Add.vm').addPathInfo( 'fid', 'addMavenTwoProject')">Add M2 Project</a>
+ </div>
+ <div>
+ <a href="$link.setPage('Add.vm').addPathInfo( 'fid', 'uploadMavenTwoProject')">Upload M2 Project</a>
+ </div>
+ <div>
+ <a href="$link.setPage('Add.vm').addPathInfo( 'fid', 'addMavenOneProject')">Add M1 Project</a>
+ </div>
+ <div>
+ <a href="$link.setPage('Add.vm').addPathInfo( 'fid', 'uploadMavenOneProject')">Upload M1 Project</a>
+ </div>
+ <div>
+ <a href="$link.setPage('Add.vm').addPathInfo( 'fid', 'antProject')">Add Ant Project</a>
+ </div>
+ <div>
+ <a href="$link.setPage('Add.vm').addPathInfo( 'fid', 'shellProject')">Add Shell Project</a>
+ </div>
+ </div>
</div>
- </div>
- <div id="projecttools" class="toolgroup">
- <div class="label">Add Project</div>
- <div class="body">
- <div><a href="$link.setPage('Add.vm').addPathInfo( 'fid', 'addMavenTwoProject')">Add M2 Project</a></div>
- <div><a href="$link.setPage('Add.vm').addPathInfo( 'fid', 'uploadMavenTwoProject')">Upload M2 Project</a></div>
- <div><a href="$link.setPage('Add.vm').addPathInfo( 'fid', 'addMavenOneProject')">Add M1 Project</a></div>
- <div><a href="$link.setPage('Add.vm').addPathInfo( 'fid', 'uploadMavenOneProject')">Upload M1 Project</a></div>
- <div><a href="$link.setPage('Add.vm').addPathInfo( 'fid', 'antProject')">Add Ant Project</a></div>
- <div><a href="$link.setPage('Add.vm').addPathInfo( 'fid', 'shellProject')">Add Shell Project</a></div>
+ <div id="projecttools" class="toolgroup">
+ <div class="label">Schedules</div>
+ <div class="body">
+ <div>
+ <a href="$link.setPage('schedule,ScheduleSummary.vm')">Schedules</a>
+ </div>
+ </div>
</div>
- </div>
<div id="projecttools" class="toolgroup">
- <div class="label">Build</div>
- <div class="body">
- <div><a href="$link.setPage('BuildOrder.vm')">Build Order</a></div>
- </div>
+ <div class="label">Schedules</div>
+ <div class="body">
+ <div>
+ <a href="$link.setPage('BuildOrder.vm')">Build Order</a>
+ </div>
+ </div>
</div>
+
<!--
<div id="projecttools" class="toolgroup">
Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Add.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Add.vm?rev=219578&r1=219577&r2=219578&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Add.vm (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Add.vm Mon Jul 18 15:23:39 2005
@@ -2,6 +2,7 @@
<div class="app">
<div id="axial" class="h3">
+ >>>>>>>>> $form.add.titleKey
<h3>$i18n.getString( $form.add.titleKey )</h3>
<form method="post" action="$link" #if( $form.attributes.multipart )enctype="multipart/form-data"#end>
#hidden ( "fid" $form.id )