user2793390
user2793390

Reputation: 771

JBoss CLI - undeploy by pattern matching

I'm trying to write a script that would automatically deploy apps to JBoss. The problme is that my ear files have version in them. For example, myApp-1.0.1.ear or myApp-1.0.2.ear. Therefore, I'd like to be able to undeploy by pattern matching - 'myApp-.*.ear' Is it possible using JBoss CLI?

Upvotes: 0

Views: 1220

Answers (2)

Michal Sipek
Michal Sipek

Reputation: 474

I have implemented the following solution on my project:

$JBOSS_HOME/bin/jboss-cli.sh --connect --command="undeploy $(echo /tmp/myApp*)"

This command takes application for example myApp-1.13.war from /tmp directory and does deploy to JBoss.

You will be also able to apply this solution for deploy command.

Upvotes: 0

VoiD
VoiD

Reputation: 31

jboss-cli.sh -command=undeploy | grep <your regexp> | xargs ...

-

jboss-cli.sh -command=undeploy 

will show you the list of all your deplyments

Upvotes: 2

Related Questions