Home
TeamSite
How to create war file using OD
sandy_893
Hi,
Wanted to know if its possible to create a .war file from OpenDeploy, which is transferred to the server.
I am using OD 5.6.0 and Weblogic 8.1.
sandy
Find more posts tagged with
Comments
Migrateduser
Not sure I understand exactly what you are trying to do. Do you have a directory of files that you want to package into a war? You can write a DNR (deploy and run) script that would call the appropriate java utils to create the archive.
Mariam
sandy_893
Hi,
I have application that is updated from teamsite. Every time a change is made i want to create its war file and then deploy that on the production server. So i wanted to know how can i call the scripts to create war and to deploy the war from OD.
Lozza
As part of a deployment, you can run DNR scripts. These can be run on the source or target server, before or after deployment, on success or failure etc. In your case one option would be to run a DNR script before deployment on the source to create the WAR.
Instead as another option I would consider a simple workflow. The developer makes their change to the application files, and starts a workflow job. The first step of the workflow could be an external task to create the WAR. Remember that this could fail, so you need to provide a call back to start a user task to inform of failure. If it succeeds, it calls back to start an external task for deployment. I'd consider a file list deployment, deploying just the WAR file to the target. Depending on your environment you could also use DNR scripts, running before/after the deployment to stop/start the application server, or any other action as required.
sandy_893
interesting idea ... but how would i call the script (DNR script) on successful transfer of the war file from OD.
sandy
Lozza
It's standard OD functionality; check the Deploy and Run section of the OD admin manual. It's fairly interesting reading (comparatively!)
E.g. you may use something like this in your deployment configuration:
<dnrFile location="target" when="after" state="success">
<script cmd="/path/to/script/startservice.sh" as="webmaster" where="/path/where/to/execute" async="no"/>
</dnrFile>
Adam Stoller
I don't think you want dnrFile here - my guess would be dnrDeploymentJob - running *before* on the *source* server to create the war file and then ensure that the war file is included (either via filelist or comparison) in the deployment. Stopping and restarting the application which is going to use the war file is another issue - there you'd probably use a dnrDeployment on the *target* server and you'd have to find the right combination of trigger-point and before or after in order to get things to work right -- and the values chosen will probably differ if you are using a transactional deployment versus a non-transactional deployment.
However - yes - read the manual first.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com