AEM提供,除非你有不同的部署将这些实例部署包的runmode不可知的方式。
在大多数常规用例中,部署包对作者和发布都是相同的,部署路径也是如此,所有更改都是主机。我们为部署目的构建一个单独的pom项目,它可以将任何类型的包直接推送到指定为CI Job参数的任何节点。在我们的例子中,我们只用它来部署一个完整的应用程序包。
POM看起来是这样的 -
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>cms-parent</artifactId>
<groupId>com.myproject.cms</groupId>
<version>1.0.2</version>
</parent>
<artifactId>cms-deploy</artifactId>
<groupId>com.myproject.cms.deploy</groupId>
<packaging>pom</packaging>
<version>1.0.0</version>
<name>
AEM :: Deploy
</name>
<properties>
<app.cms.myproject.complete.version>1.0.0-SNAPSHOT</app.cms.myproject.complete.version>
</properties>
<build>
<plugins>
<!-- additionally deploy three further content-packages which are not part of the complete-package -->
<plugin>
<groupId>com.day.jcr.vault</groupId>
<artifactId>content-package-maven-plugin</artifactId>
<executions>
<execution>
<!-- override the default execution defined in the cq-parent by binding it to some invalid phase -->
<id>default-package</id>
<goals>
<goal>package</goal>
</goals>
<phase>foobar</phase>
</execution>
<execution>
<!-- override the default execution for install-package, which is called whenever you call deploy -->
<id>install-package</id>
<goals>
<goal>install</goal>
</goals>
<phase>foobar</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>install-myproject-complete</id>
<build>
<plugins>
<plugin>
<artifactId>content-package-maven-plugin</artifactId>
<groupId>com.day.jcr.vault</groupId>
<executions>
<!-- deploy the scripts and classes (part of the release) -->
<execution>
<id>install-myproject-complete</id>
<goals>
<goal>install</goal>
</goals>
<configuration>
<artifactId>myproject-complete</artifactId>
<groupId>com.myproject.cms.msites</groupId>
<version>${app.cms.myproject.complete.version}</version>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
的,你可以创建CI Maven项目(我指的是詹金斯作为CI,你可以适应您的服务器),并设置它作为一个参数化建设接受host
和deployment version
下一步将配置源代码管理指向上述聚甲醛项目在供应链管理和配置Maven构建步骤 -
在目标和选项指定 - 对于作者的部署 -
-U clean install -Pinstall-myproject-complete -Dcrx.host=${host}-author.mysite.com -Dcrx.port=4502 -e -Dapp.cms.myproject.complete.version=${version}
对于发布部署 -
-U clean install -Pinstall-myproject-complete -Dcrx.host=${host}-publish.mysite.com -Dcrx.port=4503 -e -Dapp.cms.myproject.complete.version=${version}
这是基地配置,你可以进一步定制接受整个node_name/ip以及端口信息以保持单个pipleline部署
您可以获得http://author.local.telegraph.co。uk:4502/system/console/status-slingsettings.json'来检查运行模式,但是你需要提供系统控制台的证书。无论如何,你为什么需要这样做?部署AEM实例时,将其设置为作者或发布者,并且以后无法更改。为了针对多个AEM实例执行脚本,无论如何都需要一个列表。该列表可能包含必要的元数据(无论实例是AEM作者还是发布者) – toniedzwiedz
原因是经济。我不是脚本编写人员,管道实际上是一个支持N部署技术的复杂系统,AEM只是其中之一。理想情况下,系统可以存储一些额外的数据,如节点类型,但询问端点可能更便宜。我们可能会添加一个功能来存储节点类型,或者我们可能会这样做,这取决于我们得到的答案。 –