Skip to content

Commit da036f6

Browse files
committed
Add a new task: upgrade.
It gathers all the task to perform the upgrade of Silverpeas to a new version.
1 parent 6bd0a01 commit da036f6

File tree

3 files changed

+45
-4
lines changed

3 files changed

+45
-4
lines changed

src/main/groovy/org/silverpeas/setup/SilverpeasSetupPlugin.groovy

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,20 @@ class SilverpeasSetupPlugin implements Plugin<Project> {
124124
jboss = jBossServer.useLogger(log)
125125
}
126126

127+
project.tasks.register(UPGRADE.name, SilverpeasInstallationTask) {
128+
description = "Upgrade Silverpeas in JBoss/Wildfly to version ${project.version}"
129+
dependsOn project.tasks.named('clean'), migration
130+
131+
installation = extension.installation
132+
settings = extension.settings
133+
jboss = jBossServer.useLogger(log)
134+
135+
doFirst {
136+
FileLogger log = FileLogger.getLogger(UPGRADE.name)
137+
log.info("Upgrade of Silverpeas to version ${project.version}")
138+
}
139+
}
140+
127141
initializePredefinedTasks(project, extension)
128142
}
129143

@@ -138,7 +152,7 @@ class SilverpeasSetupPlugin implements Plugin<Project> {
138152
try {
139153
TaskProvider<Task> assemble = project.tasks.named(ASSEMBLE.name)
140154
assemble.configure {
141-
description = 'Assemble all the software bundles that made Silverpeas'
155+
description = 'Assemble all the software bundles making up Silverpeas'
142156
onlyIf {
143157
!extension.installation.distDir.get().exists() &&
144158
!extension.installation.dsDriversDir.get().exists()

src/main/groovy/org/silverpeas/setup/api/SilverpeasSetupTaskNames.groovy

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,42 @@ package org.silverpeas.setup.api
2828
* @author mmoquillon
2929
*/
3030
enum SilverpeasSetupTaskNames {
31-
31+
/**
32+
* Extracts all the software bundles making up Silverpeas and assembles their content into a single location
33+
*/
3234
ASSEMBLE('assemble'),
35+
/**
36+
* Builds the Silverpeas Web application by generating the JEE required descriptors (web.xml, persistence.xml, ...)
37+
*/
3338
BUILD('build'),
39+
/**
40+
* Assembles from different software bundles and builds the Silverpeas Web application.
41+
*/
3442
CONSTRUCT('construct'),
43+
/**
44+
* Configures the JBoss/Wildfly JEE server for running Silverpeas.
45+
*/
3546
CONFIGURE_JBOSS('configure_jboss'),
47+
/**
48+
* Configure Silverpeas.
49+
*/
3650
CONFIGURE_SILVERPEAS('configure_silverpeas'),
51+
/**
52+
* Configure both JBoss/Wildfly and Silverpeas.
53+
*/
3754
CONFIGURE('configure'),
55+
/**
56+
* Migrates the data source structure from the current version to the latest one.
57+
*/
3858
MIGRATE('migrate'),
39-
INSTALL('install')
59+
/**
60+
* Installs Silverpeas into JBoss/Wildfly
61+
*/
62+
INSTALL('install'),
63+
/**
64+
* Upgrade Silverpeas from the current version to the one specified in its installation descriptor.
65+
*/
66+
UPGRADE('upgrade')
4067

4168
final String name
4269

src/main/groovy/org/silverpeas/setup/installation/SilverpeasInstallationTask.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class SilverpeasInstallationTask extends DefaultTask {
5050
final FileLogger log = FileLogger.getLogger(this.name)
5151

5252
SilverpeasInstallationTask() {
53-
description = 'Installs Silverpeas into JBoss/Wildfly'
53+
description = "Installs Silverpeas ${project.version} into JBoss/Wildfly"
5454
group = 'Build'
5555
}
5656

0 commit comments

Comments
 (0)