Skip to content

Commit 053871f

Browse files
CRX Package Manager Upload: Add system ready check after deployment (#208)
1 parent 3f8bd01 commit 053871f

File tree

7 files changed

+53
-10
lines changed

7 files changed

+53
-10
lines changed

changes.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@
2424
xsi:schemaLocation="http://maven.apache.org/changes/2.0.0 https://maven.apache.org/xsd/changes-2.0.0.xsd">
2525
<body>
2626

27+
<release version="2.22.0" date="not released">
28+
<action type="add" dev="sseifert" issue="208">
29+
CRX Package Manager Upload: Add system ready check after deployment (enabled by default, can be disabled).
30+
It only has an effect when deploying to AEMaaCS instances. Default responses from AEM 6.5 and 6.6 instances are accepted as valid.
31+
</action>
32+
</release>
33+
2734
<release version="2.21.0" date="2025-06-18">
2835
<action type="add" dev="sseifert" issue="179">
2936
Content Package Post Processors: Add option "dependencyChainIgnore" to ignore a content package in the dependency chain, i.e. it does not play a role for this package in which order it is deployed compared to other packages.

parent/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@
5757
<dependency>
5858
<groupId>io.wcm.devops.conga</groupId>
5959
<artifactId>io.wcm.devops.conga.generator</artifactId>
60-
<version>1.17.4</version>
60+
<version>1.17.5-SNAPSHOT</version>
6161
</dependency>
6262
<dependency>
6363
<groupId>io.wcm.devops.conga</groupId>
6464
<artifactId>conga-maven-plugin</artifactId>
65-
<version>1.17.4</version>
65+
<version>1.17.5-SNAPSHOT</version>
6666
</dependency>
6767

6868
<dependency>
@@ -85,7 +85,7 @@
8585
<dependency>
8686
<groupId>io.wcm.tooling.commons</groupId>
8787
<artifactId>io.wcm.tooling.commons.crx-packmgr-helper</artifactId>
88-
<version>2.2.0</version>
88+
<version>2.2.1-SNAPSHOT</version>
8989
</dependency>
9090

9191
<dependency>

tooling/conga-aem-maven-plugin/src/it/example/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
<plugin>
7979
<groupId>io.wcm.devops.conga</groupId>
8080
<artifactId>conga-maven-plugin</artifactId>
81-
<version>1.17.4</version>
81+
<version>1.17.5-SNAPSHOT</version>
8282
<extensions>true</extensions>
8383
<dependencies>
8484

tooling/conga-aem-maven-plugin/src/it/mixed-no-package-type/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
<plugin>
7070
<groupId>io.wcm.devops.conga</groupId>
7171
<artifactId>conga-maven-plugin</artifactId>
72-
<version>1.17.4</version>
72+
<version>1.17.5-SNAPSHOT</version>
7373
<extensions>true</extensions>
7474
<dependencies>
7575

tooling/conga-aem-maven-plugin/src/it/wcmio-archetype-aem65/parent/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@
321321
<plugin>
322322
<groupId>io.wcm.devops.conga</groupId>
323323
<artifactId>conga-maven-plugin</artifactId>
324-
<version>1.17.4</version>
324+
<version>1.17.5-SNAPSHOT</version>
325325
<dependencies>
326326
<dependency>
327327
<groupId>io.wcm.devops.conga.plugins</groupId>

tooling/conga-aem-maven-plugin/src/it/wcmio-archetype-cloud/parent/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@
268268
<plugin>
269269
<groupId>io.wcm.devops.conga</groupId>
270270
<artifactId>conga-maven-plugin</artifactId>
271-
<version>1.17.4</version>
271+
<version>1.17.5-SNAPSHOT</version>
272272
<dependencies>
273273
<dependency>
274274
<groupId>io.wcm.devops.conga.plugins</groupId>

tooling/conga-aem-maven-plugin/src/main/java/io/wcm/devops/conga/plugins/aem/maven/AbstractContentPackageMojo.java

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
import javax.inject.Inject;
2828

29-
import org.apache.commons.lang3.StringUtils;
29+
import org.apache.commons.lang3.Strings;
3030
import org.apache.maven.execution.MavenSession;
3131
import org.apache.maven.plugin.AbstractMojo;
3232
import org.apache.maven.plugin.MojoExecutionException;
@@ -190,6 +190,28 @@ abstract class AbstractContentPackageMojo extends AbstractMojo {
190190
+ "^org\\.apache\\.sling\\.jcr\\.davex$")
191191
private String[] bundleStatusWhitelistBundleNames;
192192

193+
/**
194+
* System ready JSON URL. If an URL is configured the systemready status of the target instance is checked
195+
* after installing finishing the upload. This works only for AEMaaCS SDK instances.
196+
*
197+
* <p>
198+
* Expected is an URL like: http://localhost:4502/systemready
199+
* </p>
200+
*
201+
* <p>
202+
* If the URL is not set it is derived from serviceURL. If set to "-" the status check is disabled.
203+
* </p>
204+
*/
205+
@Parameter(property = "vault.systemReadyURL", required = false)
206+
private String systemReadyURL;
207+
208+
/**
209+
* Number of seconds to wait as maximum for a positive system ready check.
210+
* If this limit is reached and the system ready is still not positive the install of the package proceeds anyway.
211+
*/
212+
@Parameter(property = "vault.systemReadyWaitLimitSec", defaultValue = "30")
213+
private int systemReadyWaitLimitSec;
214+
193215
/**
194216
* If set to true also self-signed certificates are accepted.
195217
*/
@@ -241,6 +263,8 @@ protected PackageManagerProperties getPackageManagerProperties() throws MojoExec
241263
props.setBundleStatusWaitLimitSec(this.bundleStatusWaitLimit);
242264
props.setBundleStatusBlacklistBundleNames(List.of(this.bundleStatusBlacklistBundleNames));
243265
props.setBundleStatusWhitelistBundleNames(List.of(this.bundleStatusWhitelistBundleNames));
266+
props.setSystemReadyUrl(buildSystemReadyUrl());
267+
props.setSystemReadyWaitLimitSec(this.systemReadyWaitLimitSec);
244268
props.setPackageManagerInstallStatusURL(buildPackageManagerInstallStatusUrl());
245269
props.setPackageManagerInstallStatusWaitLimitSec(this.packageManagerInstallStatusWaitLimit);
246270
props.setRelaxedSSLCheck(this.relaxedSSLCheck);
@@ -268,7 +292,7 @@ private String buildPackageManagerUrl() throws MojoExecutionException {
268292
}
269293

270294
private String buildBundleStatusUrl() throws MojoExecutionException {
271-
if (StringUtils.equals(this.bundleStatusURL, "-")) {
295+
if (Strings.CS.equals(this.bundleStatusURL, "-")) {
272296
return null;
273297
}
274298
if (this.bundleStatusURL != null) {
@@ -279,8 +303,20 @@ private String buildBundleStatusUrl() throws MojoExecutionException {
279303
return baseUrl + "/system/console/bundles/.json";
280304
}
281305

306+
private String buildSystemReadyUrl() throws MojoExecutionException {
307+
if (Strings.CS.equals(this.systemReadyURL, "-")) {
308+
return null;
309+
}
310+
if (this.systemReadyURL != null) {
311+
return this.systemReadyURL;
312+
}
313+
// if not set use hostname from serviceURL and add default path to bundle status
314+
String baseUrl = VendorInstallerFactory.getBaseUrl(buildPackageManagerUrl());
315+
return baseUrl + "/systemready";
316+
}
317+
282318
private String buildPackageManagerInstallStatusUrl() throws MojoExecutionException {
283-
if (StringUtils.equals(this.packageManagerInstallStatusURL, "-")
319+
if (Strings.CS.equals(this.packageManagerInstallStatusURL, "-")
284320
|| VendorInstallerFactory.identify(this.serviceURL) != Service.CRX) {
285321
return null;
286322
}

0 commit comments

Comments
 (0)