Below is simple example of deploying the list of WARs from a props file and deploy into JBOSS.
---------Script 1 invokes script 2 and creates a log file---------
#!/bin/sh
datestr=$(date +%Y%m%d_%H%M%S)
./connectToCLLI.sh > AsocDeploymentLog_$datestr
-----------------------------------------------------------------------
----------SCRIPT 2 , reads props file and get the WAR file and Group information-------
#!/bin/ksh
echo "Setting JBOSS Env"
export JBOSS_HOME=/export/opt/jboss/jboss-eap-6.3
export JAVA_HOME=/opt/app/java/jdk/jdk160
export PATH=$PATH:$JBOSS_HOME/bin:$JAVA_HOME/bin
export JB_CLI=$JBOSS_HOME/bin/jboss-cli.sh
DEPLOYMENT_HOST=`nslookup \`hostname\` |grep Name | awk '/:/{print $2}'`
export HOME_DIR=/pbcf/ctfr1603/
echo "JBOSS Environment is ready and connecting to CLLI"
allDeployed=0
for LINE in `cat deploymentDescABC.props | grep -v "#"`
{
VAL1=`echo $LINE |cut -d '|' -f1 `
GROUPS=`echo $LINE |cut -d '|' -f2 `
export WAR_FILE=$HOME_DIR$VAL1
echo "Deploying $WAR_FILE now"
#export COMMANDS="connect,deploy $WAR_FILE --force,quit"
export COMMANDS="connect,deploy $WAR_FILE --server-groups=$GROUPS,quit"
echo "COMMANDS is $COMMANDS"
if $JB_CLI -c --controller=$DEPLOYMENT_HOST:9999 --commands="$COMMANDS"
then
echo "Deployment successful for $WAR_FILE !!"
else
echo "Deployment failed for $WAR_FILE "
allDeployed=1
break
fi
}
if [ $allDeployed = "0" ]
then
echo "Overall deployment of all WARs is successful"
else
echo "Overall deployment FAILED !!"
fi
---------------------------------------------------------------------------------------------------------
----------Sample Props file -------------
# list of WARs for ASOC Module
/abc/def/MyTestwar|G2
/abc/def/YourTestwar|G2
All WARs done#
----------------------------------------------
Sample Deploy and undeploy commands :
[jboss@hex0015 bin]$ ./jboss-cli.sh --controller=hex0015.abc.com:9999
You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.
----------------------------
[disconnected /] connect
[domain@hex0015.abc.com:9999 /] deploy /ssd/etc/jboss_config/atp/csac/PressQuery.war --all-server-groups
[domain@hex0015.abc.com:9999 /] undeploy PressQuery.war --all-relevant-server-groups
---------Script 1 invokes script 2 and creates a log file---------
#!/bin/sh
datestr=$(date +%Y%m%d_%H%M%S)
./connectToCLLI.sh > AsocDeploymentLog_$datestr
-----------------------------------------------------------------------
----------SCRIPT 2 , reads props file and get the WAR file and Group information-------
#!/bin/ksh
echo "Setting JBOSS Env"
export JBOSS_HOME=/export/opt/jboss/jboss-eap-6.3
export JAVA_HOME=/opt/app/java/jdk/jdk160
export PATH=$PATH:$JBOSS_HOME/bin:$JAVA_HOME/bin
export JB_CLI=$JBOSS_HOME/bin/jboss-cli.sh
DEPLOYMENT_HOST=`nslookup \`hostname\` |grep Name | awk '/:/{print $2}'`
export HOME_DIR=/pbcf/ctfr1603/
echo "JBOSS Environment is ready and connecting to CLLI"
allDeployed=0
for LINE in `cat deploymentDescABC.props | grep -v "#"`
{
VAL1=`echo $LINE |cut -d '|' -f1 `
GROUPS=`echo $LINE |cut -d '|' -f2 `
export WAR_FILE=$HOME_DIR$VAL1
echo "Deploying $WAR_FILE now"
#export COMMANDS="connect,deploy $WAR_FILE --force,quit"
export COMMANDS="connect,deploy $WAR_FILE --server-groups=$GROUPS,quit"
echo "COMMANDS is $COMMANDS"
if $JB_CLI -c --controller=$DEPLOYMENT_HOST:9999 --commands="$COMMANDS"
then
echo "Deployment successful for $WAR_FILE !!"
else
echo "Deployment failed for $WAR_FILE "
allDeployed=1
break
fi
}
if [ $allDeployed = "0" ]
then
echo "Overall deployment of all WARs is successful"
else
echo "Overall deployment FAILED !!"
fi
---------------------------------------------------------------------------------------------------------
----------Sample Props file -------------
# list of WARs for ASOC Module
/abc/def/MyTestwar|G2
/abc/def/YourTestwar|G2
All WARs done#
----------------------------------------------
Sample Deploy and undeploy commands :
[jboss@hex0015 bin]$ ./jboss-cli.sh --controller=hex0015.abc.com:9999
You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.
----------------------------
[disconnected /] connect
[domain@hex0015.abc.com:9999 /] deploy /ssd/etc/jboss_config/atp/csac/PressQuery.war --all-server-groups
[domain@hex0015.abc.com:9999 /] undeploy PressQuery.war --all-relevant-server-groups
0 comments to "JBOSS : WARs deployment shell script"
Popular Posts
-
The best solution to know about these init levels is to understand the " man init " command output on Unix. There are basically 8...
-
How to Unlock BSNL 3G data card to use it with Airtel and Vodafone Model no : LW272 ? How to unlock BSNL 3G data card( Model no : LW272 )us...
-
How to transfer bike registration from one State to other (Karnataka to Andhra)?? Most of us having two wheelers purchased and registered in...
-
ఓం శ్రీ స్వామియే శరణం ఆయ్యప్ప!! Related posts : Trip to Sabarimala - Part 1 Trip to Sabarimala - Part 2 Ayappa Deeksha required things...
-
Following are some of interesting blogs I found till now ...please comment to add your blog here. Blogs in English : http://nitawriter.word...
Popular posts
- Airtel and vodafone GPRS settings for pocket PC phones
- Andhra 2 America
- Ayyappa Deeksha required things
- Blogs I watch !
- Captions for your bike
- DB2 FAQs
- Deepavali Vs The Goddes of sleep
- ETV - Dhee D2 D3
- Evolution of smoking in India Women
- How to make credit card payments?
- init 0, init 1, init 2 ..
- Java-J2EE interview preparation
- mCheck Application jar or jad download
- My SQL FAQs
- My Travelogues
- Old is blod - New is italic
- Online pay methids for credit cards
- Oracle FAQs
- Pilgrimages
- Smoking in Indian Women
- Technology Vs Humans
- Twitter feeds for all Telugu stars on single page.
- Unix best practices
- Unix FAQs
Buffs ...
Tags
Powered by WidgetsForFree
Archives
-
▼
2015
(7)
-
▼
September
(7)
- JBOSS - Profiles - socket binding - offset - Group...
- Caused by: org.jboss.modules.xml.XmlPullParserExce...
- JBOSS : WARs deployment shell script
- JBOSS - Global modules - profiles modules.xml
- ERROR [org.jboss.modcluster] (ContainerBackgroundP...
- How to print request and response XML data (HTTP c...
- Webservice HTTPS client running - SSL handshake co...
-
▼
September
(7)
Post a Comment
Whoever writes Inappropriate/Vulgar comments to context, generally want to be anonymous …So I hope U r not the one like that?
For lazy logs, u can at least use Name/URL option which doesn’t even require any sign-in, The good thing is that it can accept your lovely nick name also and the URL is not mandatory too.
Thanks for your patience
~Krishna(I love "Transparency")