- WildFly Cookbook
- Luigi Fugaro
- 294字
- 2021-07-16 13:38:16
Executing commands in batch mode via the CLI
In this recipe, we will learn how to invoke commands in the batch mode. Actually, you can declare and prepare a list of commands to execute, and execute them sequentially at once. The batch mode gives you consistency among your operations and configuration.
Getting ready
Get our WildFly instance up and running; from the folder where we downloaded the GitHub repository, WFC/github/wildfly-cookbook
, copy the example.war
and simple.war
applications into the $JBOSS_HOME
folder and connect to the CLI.
If you can find the applications, you probably need to compile the projects. I'll show you how to do it for the simple
application, and the same applies to the others. Open a terminal and do as follows:
$ cd ~/WFC/github/wildfly-cookbook $ cd simple $ mvn -e clean package $ cp target/simple.war ~/WFC/wildfly/
How to do it…
We are going to do the following operation in sequence:
- Deploy
example.war
. - Deploy
simple.war
. - Let's go to the CLI:
$ cd ~/WFC/wildfly $ ./bin/jboss-cli.sh --connect [standalone@localhost:9990 /] batch [standalone@localhost:9990 / #] deploy example.war [standalone@localhost:9990 / #] deploy simple.war [standalone@localhost:9990 / #] run-batch The batch executed successfully [standalone@localhost:9990 /]
- And the
server.log
logs the following:... 07:33:02,191 INFO [org.jboss.as.repository] (management-handler-thread - 4) JBAS014900: Content added at location /home/lfugaro/wildfly/standalone/data/content/7a/a7c67cb54e0affa9d60cf98230e0c17efd1119/content 07:33:02,205 INFO [org.jboss.as.repository] (management-handler-thread - 4) JBAS014900: Content added at location /home/lfugaro/wildfly/standalone/data/content/e0/2abb62b1b29f97f532ef1501910d64af194b21/content 07:33:02,227 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "simple.war" (runtime-name: "simple.war") 07:33:02,227 INFO [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015876: Starting deployment of "example.war" (runtime-name: "example.war") 07:33:02,689 INFO [org.wildfly.extension.undertow] (MSC service thread 1-1) JBAS017534: Registered web context: /simple 07:33:02,689 INFO [org.wildfly.extension.undertow] (MSC service thread 1-6) JBAS017534: Registered web context: /example 07:33:02,746 INFO [org.jboss.as.server] (management-handler-thread - 4) JBAS018559: Deployed "simple.war" (runtime-name : "simple.war") 07:33:02,746 INFO [org.jboss.as.server] (management-handler-thread - 4) JBAS018559: Deployed "example.war" (runtime-name : "example.war")
推薦閱讀
- C語言程序設(shè)計教程
- 移動UI設(shè)計(微課版)
- C#程序設(shè)計(慕課版)
- Spring Cloud、Nginx高并發(fā)核心編程
- 小程序,巧運營:微信小程序運營招式大全
- Big Data Analytics
- Mastering Google App Engine
- Unity 5.x By Example
- PHP編程基礎(chǔ)與實例教程
- 零基礎(chǔ)學(xué)C語言程序設(shè)計
- Python語言科研繪圖與學(xué)術(shù)圖表繪制從入門到精通
- 微信小程序開發(fā)實戰(zhàn):設(shè)計·運營·變現(xiàn)(圖解案例版)
- OpenCV 3計算機視覺:Python語言實現(xiàn)(原書第2版)
- 零基礎(chǔ)學(xué)C語言(升級版)
- 從零開始學(xué)UI:概念解析、實戰(zhàn)提高、突破規(guī)則