Wednesday 5 December 2012

File Name :mla-app-versions.bat


@echo off
setLocal EnableDelayedExpansion

set cellnode=%1
set depserver=%2
set cruiseuser=%3
set cruisepwd=%4
set Was=%5
set Envname=%6
set Nodevalue=%7
set AppFlag=%8
set Batchpath=%9

SHIFT
SHIFT
SHIFT
SHIFT
SHIFT
SHIFT
SHIFT
SHIFT
SHIFT

set SMAppLocation=%~1

set WasServer=%Was%
Echo set %WasServer%
set Flag=%AppFlag%

set AppLocation=c:\WebSphere\AppServerV61\profiles\APPSERVER\installedApps
set
set DMSAppLocation=c:\WebSphere\AppServerV60\profiles\APPSERVER\installedApps
set "comma=,"




IF %Flag% == LF (goto :LendFast)
IF %Flag% == SM (goto :StrategyManager)
IF %Flag% == DMS (goto :DMS)
IF %Flag% == Batch (goto :Batch)
IF %Flag% == TM (goto :Training)
IF %Flag% == Stub (goto :StubVersions)


:LendFast

Echo %AppLocation%\%cellnode%\%Nodevalue%_LendFast.ear\lendfast.war\WEB-INF\classes

if exist d:\version.txt del d:\version.txt
FIND /I "currentBuild=" %AppLocation%\%cellnode%\%Nodevalue%_LendFast.ear\lendfast.war\WEB-INF\classes\version_messages_en_AU_ANZ.properties >> d:\version.txt

for /f "tokens=* delims= " %%a in (d:\version.txt) do (
Echo. >> d:\App-Version-Details.txt
set /a Q+=1
set V!Q!=%%a
)
set Release-Version=!V2!

if exist d:\LF-AppDetails.txt del d:\LF-AppDetails.txt

for /f " tokens=1,2 delims= " %%a in ("%Release-Version%") do set name=%%a&set Releaseversion=%%b

echo %Releaseversion%

Echo %AppLocation%\%cellnode%\%Nodevalue%_LendFast.ear\lendfast.war\META-INF\MANIFEST.MF

if exist d:\version.txt del d:\version.txt
FIND /I "Implementation-Version:" %AppLocation%\%cellnode%\%Nodevalue%_LendFast.ear\lendfast.war\META-INF\MANIFEST.MF >> d:\version.txt

for /f "tokens=* delims=  " %%a in (d:\version.txt) do (
Echo. >> d:\App-Version-Details.txt
set /a N+=1
set v!N!=%%a
)
set Implementation-Version=!v2!

Echo %Implementation-Version%

if exist d:\LF-AppDetails.txt del d:\LF-AppDetails.txt

for /f " tokens=1,2 delims=: " %%a in ("%Implementation-Version%") do set name=%%a&set LFVersion=%%b

Echo %AppLocation%\%cellnode%\%Nodevalue%_anzreporting.ear\anzreporting.war\META-INF\MANIFEST.MF

if exist d:\version.txt del d:\version.txt

FIND /I "Implementation-Version:" %AppLocation%\%cellnode%\%Nodevalue%_anzreporting.ear\anzreporting.war\META-INF\MANIFEST.MF >> d:\version.txt
for /f "tokens=* delims= " %%a in (d:\version.txt) do (
set /a K+=1
set v!K!=%%a
)
set Implementation-Version=!v2!

for /f " tokens=1,2 delims=: " %%a in ("%Implementation-Version%") do set name=%%a&set AnzRPTVersion=%%b


Echo %AppLocation%\%cellnode%\%Nodevalue%_InternalFraudService.ear\internalfraudservice.war\META-INF\MANIFEST.MF

if exist d:\version.txt del d:\version.txt

FIND /I "Implementation-Version:" %AppLocation%\%cellnode%\%Nodevalue%_InternalFraudService.ear\internalfraudservice.war\META-INF\MANIFEST.MF >> d:\version.txt
for /f "tokens=* delims= " %%a in (d:\version.txt) do (
set /a P+=1
set v!P!=%%a
)
set Implementation-Version=!v2!

for /f " tokens=1,2 delims=: " %%a in ("%Implementation-Version%") do set name=%%a&set InternalFraudVersion=%%b


Echo %AppLocation%\%cellnode%\MLA%Envvalue%C1_UASAdmin.ear\uasadmin.war\META-INF\MANIFEST.MF

if exist d:\version.txt del d:\version.txt

FIND /I "Implementation-Version:" %AppLocation%\%cellnode%\%Nodevalue%_UASAdmin.ear\uasadmin.war\META-INF\MANIFEST.MF >> d:\version.txt
for /f "tokens=* delims= " %%a in (d:\version.txt) do (

set /a T+=1
set v!T!=%%a
)
set Implementation-Version=!v2!


for /f " tokens=1,2 delims=: " %%a in ("%Implementation-Version%") do set name=%%a&set UasadVersion=%%b
set UasadVersion=%Implementation-Version:~24,31%


set LFAppDetails=%openversions%%Envname%%comma%%Releaseversion%%comma%%LFVersion%%comma%%AnzRPTVersion%%comma%%InternalFraudVersion%%comma%%UasadVersion%%comma%

Echo ^<^Versions^>%LFAppDetails% >>d:\LF-AppDetails.txt

goto :End


:StrategyManager

Echo Inside of Strategy Manager

Echo %SMAppLocation%\%cellnode%\%Nodevalue%_strategymanager.ear\sm-webservices.war\META-INF\MANIFEST.MF

if exist d:\version.txt del d:\version.txt

FIND /I "Implementation-Version:" %SMAppLocation%\%cellnode%\%Nodevalue%_strategymanager.ear\sm-webservices.war\META-INF\MANIFEST.MF >> d:\version.txt
for /f "tokens=* delims= " %%a in (d:\version.txt) do (


set /a N+=1
set v!N!=%%a
)

set Implementation-Version=!v2!

for /f " tokens=1,2 delims=: " %%a in ("%Implementation-Version%") do set name=%%a&set SMVersion=%%b

if exist d:\SM-AppDetails.txt del d:\SM-AppDetails.txt



Echo %SMVersion%%comma% >> d:\SM-AppDetails.txt

goto :End

:DMS


Echo "****************DMS Version  check*****************"

Echo %DMSAppLocation%\%cellnode%\%Nodevalue%_DocRetrieve.ear\META-INF\maven\com.anz.doc-retrieve\doc-retrieve-ear\pom.properties
for /f "tokens=* delims= " %%a in (%DMSAppLocation%\%cellnode%\%Nodevalue%_DocRetrieve.ear\META-INF\maven\com.anz.doc-retrieve\doc-retrieve-ear\pom.properties) do (
set /a N+=1
set v!N!=%%a
)
set version=!v3!
rem set artifactId=!v5!

if exist d:\DMS-AppDetails.txt del d:\DMS-AppDetails.txt

set DocRetriveVersion=%version:~8,15%


Echo %DMSAppLocation%\%cellnode%\%Nodevalue%_DocRetrieve.ear\META-INF\maven\com.anz.doc-retrieve\doc-retrieve-ear\pom.properties
for /f "tokens=* delims= " %%a in (%DMSAppLocation%\%cellnode%\%Nodevalue%_DocGenerate.ear\doc-gen-controller.war\META-INF\maven\com.anz.doc-gen\doc-gen-controller\pom.properties) do (
set /a K+=1
set v!K!=%%a
)
set version=!v3!
set artifactId=!v5!


set Title=%artifactId:~11,18%
set DocgenVersion=%version:~8,15%

Set DocDetails=%DocRetriveVersion%%comma%%DocgenVersion%%comma%
Echo %DocDetails% >> d:\DMS-AppDetails.txt

goto :End

:Batch

if exist d:\Batch-versions-list.txt del d:\Batch-versions-list.txt

if exist d:\version.txt del d:\version.txt

echo Batch path is %Batchpath%

FIND /I "Implementation-Version:" %Batchpath%\AON\Scripts\META-INF\MANIFEST.MF >> d:\version.txt
for /f "tokens=* delims= " %%a in (d:\version.txt) do (
set /a K+=1
set v!K!=%%a
)
set Implementation-Version=!v2!

for /f " tokens=1,2 delims=: " %%a in ("%Implementation-Version%") do set name=%%a&set AONVersion=%%b

if exist d:\version.txt del d:\version.txt

FIND /I "Implementation-Version:" %Batchpath%\ECDM\Scripts\META-INF\MANIFEST.MF >> d:\version.txt
for /f "tokens=* delims= " %%a in (d:\version.txt) do (
set /a P+=1
set v!K!=%%a
)
set Implementation-Version=!v2!

for /f " tokens=1,2 delims=: " %%a in ("%Implementation-Version%") do set name=%%a&set ECDMVersion=%%b

if exist d:\version.txt del d:\version.txt

FIND /I "Implementation-Version:" %Batchpath%\GIW\Scripts\META-INF\MANIFEST.MF >> d:\version.txt
for /f "tokens=* delims= " %%a in (d:\version.txt) do (
set /a B+=1
set v!K!=%%a
)
set Implementation-Version=!v2!

for /f " tokens=1,2 delims=: " %%a in ("%Implementation-Version%") do set name=%%a&set GIWVersion=%%b

if exist d:\version.txt del d:\version.txt

FIND /I "Implementation-Version:" %Batchpath%\MIS\Scripts\META-INF\MANIFEST.MF >> d:\version.txt
for /f "tokens=* delims= " %%a in (d:\version.txt) do (
set /a C+=1
set v!K!=%%a
)
set Implementation-Version=!v2!

for /f " tokens=1,2 delims=: " %%a in ("%Implementation-Version%") do set name=%%a&set MISVersion=%%b

if exist d:\version.txt del d:\version.txt

FIND /I "Implementation-Version:" %Batchpath%\MPI\Scripts\META-INF\MANIFEST.MF >> d:\version.txt
for /f "tokens=* delims= " %%a in (d:\version.txt) do (
set /a D+=1
set v!K!=%%a
)
set Implementation-Version=!v2!

for /f " tokens=1,2 delims=: " %%a in ("%Implementation-Version%") do set name=%%a&set MPIVersion=%%b

if exist d:\version.txt del d:\version.txt

FIND /I "Implementation-Version:" %Batchpath%\Hunter\Scripts\META-INF\MANIFEST.MF >> d:\version.txt
for /f "tokens=* delims= " %%a in (d:\version.txt) do (
set /a Z+=1
set v!Z!=%%a
)
set Implementation-Version=!v2!

for /f " tokens=1,2 delims=: " %%a in ("%Implementation-Version%") do set name=%%a&set HunterVersion=%%b

if exist d:\version.txt del d:\version.txt

FIND /I "Implementation-Version:" %Batchpath%\Integrity\Scripts\META-INF\MANIFEST.MF >> d:\version.txt
for /f "tokens=* delims= " %%a in (d:\version.txt) do (
set /a D+=1
set v!K!=%%a
)
set Implementation-Version=!v2!

for /f " tokens=1,2 delims=: " %%a in ("%Implementation-Version%") do set name=%%a&set IntegrityVersion=%%b

if exist d:\version.txt del d:\version.txt

FIND /I "Implementation-Version:" %Batchpath%\Control-D\Scripts\META-INF\MANIFEST.MF >> d:\version.txt
for /f "tokens=* delims= " %%a in (d:\version.txt) do (
set /a G+=1
set v!K!=%%a
)
set Implementation-Version=!v2!

for /f " tokens=1,2 delims=: " %%a in ("%Implementation-Version%") do set name=%%a&set ControlDVersion=%%b

set Batchversions=%AONVersion%%comma%%ECDMVersion%%comma%%GIWVersion%%comma%%MISVersion%%comma%%MPIVersion%%comma%%HunterVersion%%comma%%IntegrityVersion%%comma%%ControlDVersion%%comma%


echo %Batchversions% >> d:\Batch-versions-list.txt

goto :End

: Training

Echo %AppLocation%\%cellnode%\%Nodevalue%__trainingmodule.ear\trainingmodule.war\META-INF\MANIFEST.MF

if exist d:\version.txt del d:\version.txt
if exist d:\SM-AppDetails.txt del d:\SM-AppDetails.txt

FIND /I "Implementation-Version:" %AppLocation%\%cellnode%\%Nodevalue%_trainingmodule.ear\trainingmodule.war\META-INF\MANIFEST.MF >> d:\version.txt

for /f "tokens=* delims= " %%a in (d:\version.txt) do (
set /a N+=1
set v!N!=%%a
)
set Implementation-Version=!v2!



for /f " tokens=1,2 delims=: " %%a in ("%Implementation-Version%") do set name=%%a&set TMVersion=%%b
echo %TMVersion%%comma% >> d:\SM-AppDetails.txt
goto :End

:StubVersions

Echo D:\Apps\WSS\conf\version.txt
if exist d:\wss-version.txt del d:\wss-version.txt

for /f "tokens=* delims= " %%a in (D:\Apps\WSS\conf\version.txt) do (
set /a N+=1
set v!N!=%%a
)
set version=!v1!
set vr=%version:~10,15%
echo %vr% >>d:\wss-version.txt
goto :End



:End

No comments:

Post a Comment

Do not post irrelevant comments, please!

Browser Name:
Browser Version:
Browser Code Name:
User-Agent: