Deploy jars to easerver

Our CI server right now can deploy component to local/dev easerver, and export it as the jar file to be deploy to acceptance or production later. We don’t want use Nant to do production depoy, basic dos command should be used instead.

Result we try to achieve : One click deploy command to target server.

Tricks:

  1. Use “start /wait /min ” syntax to call jagtool to enable waiting for the deploy process.
  2. Add an exit command in jagtool.bat, to allow this separated window to close after it finished.
  3. Merge the log result into a single log file, jagtool by default always overwrite the existing file, not append.
  4. Loop through the jar folder.

Here is the dos command I end up with.


@echo off
@echo #########################################################
@echo   You must logon to target server to run this command
@echo #########################################################

if NOT Exist deploy.log (
  echo > deploy.log
)

for /f %%a IN ('dir /b *.jar') do (
  echo "Deploying %%a"   >deploy.log
  start /WAIT /MIN jagtool2  -local -logfile tmp.log deploy -type jagjar -jagjartype Package %%a
  copy deploy.log+tmp.log
)

del tmp.log

@echo on
pause

R8603284386
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s