
`sub-execution`元素用于對當前execution的分解,若此操作可分解為多個子操作,可在這里進行設置。`sub-execution`元素下可有>=1個`execution`元素。`execution`元素的定義與前面介紹的`execution`元素一致。
部署工具會對子操作自動添加序號,規則與`execution`的序號一致。如假設當前`execution`是2.1,`sub-execution`在中的有2個`execution`,則它們的序號分別是2.1.1及2.1.2。在交互界面中,當用戶選擇2.1.1時,即會執行對應的子操作。
一般有子操作時,會把當前`execution`元素設置為`OperRunDependency`操作類型,然后使用`dependencies`元素,把此操作依賴它的`sub-execution`,這樣,即可在用戶選擇2.1時,自動執行2.1.1和2.1.2。如下面示例,安裝消息服務,就是"安裝Erlang與RabbitMQ"和"安裝MsgService",因此把`installMessageService`設置為`OperRunDependency`,然后依賴這兩個操作:
```xml
<execution name="安裝消息服務" id="installMessageService" display="true" class-name="deploy.OperRunDependency">
<dependencies>
<dependency ref-id="installErlangAndRabbitMQ">
<result skip="true" />
</dependency>
<dependency ref-id="installMsgService"/>
</dependencies>
<sub-execution>
<execution name="安裝Erlang與RabbitMQ" id="installErlangAndRabbitMQ" display="true" class-name="deploy.OperRunCommand">
<configuration>
<commands>
<command>
<exec><![CDATA[scripts/windows/test/message/install_message_erlang_mq.bat]]></exec>
</command>
</commands>
</configuration>
</execution>
<execution name="安裝MsgService" id="installMsgService" display="true" class-name="deploy.OperRunCommand">
<configuration>
<commands>
<command>
<exec><![CDATA[scripts/windows/test/message/install_msg_service.bat]]></exec>
<args>
<arg><![CDATA[$${server_msg_tcp_port}]]></arg>
</args>
</command>
</commands>
</configuration>
<dependencies>
<dependency ref-id="updateConfigFiles"/>
</dependencies>
</execution>
<sub-execution>
</execution>
```
[14]: http://ww2.sinaimg.cn/large/72d660a7gw1fbn6x1paruj20c806074a.jpg
- 關于部署工具
- 1. 使用場景
- 1.1 傳統部署方式痛點
- 1.2 自動部署方式
- 2. 功能概覽
- 2.1 部署工具面向的人員
- 2.2 部署工具功能
- 3. 部署工具運行流程
- 3.1 部署工具從制作到使用
- 3.2 部署工具目錄結構
- 3.3 運行流程
- 3.4 配置文件概述
- 3.4.1 全局屬性配置文件global_config
- 3.4.2 用戶屬性配置文件custom_config
- 3.4.3 其它屬性配置文件
- 3.4.4 流程配置文件
- 3.4.5 占位符
- 4. 部署工具使用詳解
- 4.1 流程配置文件簡單示例
- 4.2 流程配置文件結構
- 4.2.1 首行及根元素
- 4.2.2 xml文件結構
- 4.2.3 properties/property元素
- 4.2.4 executions/group元素
- 4.2.5 execution元素
- 4.2.6 configuration元素
- 4.2.7 dependencies元素
- 4.2.8 sub-execution元素
- 4.2.9 commands元素
- 4.2.10 replace-files元素
- 4.2.11 datasourse/statements元素
- 4.2.12 args元素
- 4.3 流程配置文件功能示例
- 4.3.1 分析安裝及卸載mariadb需要的模塊
- 4.3.2 確定用戶統一配置
- 4.3.3 編寫流程配置文件
- 4.4 部署腳本編寫
- 5. 完整db(mariadb及redis)部署示例
- 5.1 mariadb及redis部署結構分析
- 5.1.1 模塊劃分
- 5.1.2 部署環境包制作
- 5.1.3 項目實施人員使用流程
- 5.2 db部署包示例及腳本
- 5.3 部署環境升級
- 6. 問題與反饋