Thursday, June 28, 2012

Deployment of Applications Manually(In Unix Boxes):

Steps involved in doing manual deployment:
Step 1 : Navigate to the application deployment directory.
Step 2 : Take backup of the application before doing the new deployment
Step 3 : Download the bundled tar file from the given link using wget[Non-interactive network downloader].
Step 4 : Cache and temporary file Clearance.



A Bash script to do the manual deployment:

# FileName: Manual_Deployment.sh
#!/bin/bash
#Script is used to perform the maual deployment
#Input : Application Package Link
#Steps Involved:
#1->Navigate to the application directory.(/opt/google/Development/app/IndustryVertical//)
#2->Take the backup of the old application folder.(IndustryVertical-today's date)
#3->Create new IndustryVertical Directory and navigate to it.(IndustryVertical)
#4->Using wget download the package from the given URL.
#5->Perform Cache Clearance.
clear
#step 1
APP_DIR=/opt/google/Development/app/IndustryVertical
cd ${APP_DIR}
#step 2
TODAY_DATE=`date +%d%B`
mv IndustryVertical IndustryVertical-$TODAY_DATE
#step 3
mkdir IndustryVertical
cd IndustryVertical
#step 4
wget $1
mv IndustryVertical.tar.zip IndustryVertical.tar
tar -xvf IndustryVertical.tar
sleep 30
#step 5
DOMAIN_HOME=/opt/google/Oracle/Middleware/user_projects/domains/
DOMAIN_NAME=IndustryVertical
SERVER_DIR=${DOMAIN_HOME}/${DOMAIN_NAME}/servers
cd ${SERVER_DIR}
NO_OF_SERVERS=$(cat /home/google/test_scripts/servers.txt|wc -l)
i=1
 while [ $i -le $NO_OF_SERVERS ]
  do
        SERVER_NAME=$(cat /home/google/test_scripts/servers.txt|tr '\n' ':'|cut -d":" -f$i)
         echo "Cache and Temp Clearance is in Progress for ${SERVER_NAME}"
         rm -r ${SERVER_NAME}/cache/diagnostics
         rm -r ${SERVER_NAME}/cache/EJBCompilerCache
         rm -r ${SERVER_NAME}/tmp/${SERVER_NAME}.lok
         rm -r ${SERVER_NAME}/tmp/WebServiceUtils.ser
         rm -r ${SERVER_NAME}/tmp/_WL_internal
         rm -r ${SERVER_NAME}/tmp/_WL_user
         i=`expr $i + 1`
 done

exit 1

Deployment of Applications Manually(In Unix Boxes):

Steps involved in doing manual deployment:

Step 1 : Navigate to the application deployment directory.
Step 2 : Take backup of the application before doing the new deployment
Step 3 : Download the bundled tar file from the given link using wget[Non-interactive network downloader].
Step 4 : Cache and temporary file Clearance.




Step 1: Navigate to the application deployment directory

Application deployment directory location:  /opt/google/application/IndustryVertical

So navigate into your application deployment directory.

cd /opt/google/application/IndustryVertical

 Step 2 : Take backup of the application before doing the new deployment

Take the backup of the application directory,before starting to do the new deployment.That will help us to revert back, when something goes wrong with the new application code.

mv <<ApplicationDirectory>> <<BackupDirectory>>-<<Today'sdate>> 

mv  IndustryVertical IndustryVertical-28June

 Step 3 : Download the bundled tar file from the given link using wget:

Create new Application directory and Navigate to the new application directory:

 mkdir IndustryVertical
  cd   IndustryVertical
  wget http://industryvertical.co.in/deployment/Industryvertical.tar.zip
  mv Industryvertical.tar.zip Industryvertical.tar
  tar -xvf Industryvertical.tar

Step 4 : Cache and Temp Clearance

After deployment,before starting servers do the cache and temporary file clearances inorder to avoid the version match of the application.

rm /opt/google/Oracle/Middleware/userprojects/domains/IndustryVertical/servers/server1/tmp/*
rm /opt/google/Oracle/Middleware/userprojects/domains/IndustryVertical/servers/server1/cache/*