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只是其中之一。理想情況下,系統可以存儲一些額外的數據,如節點類型,但詢問端點可能更便宜。我們可能會添加一個功能來存儲節點類型,或者我們可能會這樣做,這取決於我們得到的答案。 –