?
Solved

Sample Build & Deployment script for Ant

Posted on 2003-11-10
9
Medium Priority
?
729 Views
Last Modified: 2013-11-22
Hi
I want to have sample build and deployment script for Ant. The build part should include activities in following sequence
1. getting the files of required version from PVCS,
2. compiling,
3. Unit test,
4. deploying java and web resources on server,
5. Stopping Websphere Application server,
6. creating JDBC connection to database and deploying Stored proc, views etc.
7. Starting Websphere Application server.
8. Generating log file.
9. E Mail log file.

If not all the activites are included, you can send the script covering as much activities as possible.
0
Comment
Question by:satishchannawar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
9 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 9715374
...and I want to have my house repainted. When can you come round and do it?
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9715475
LOL ;-)
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9715487
The usual applies.  Pos what you've done so far and we'll try to help, but we can't do the whole thing for you.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:satishchannawar
ID: 9715572
Hi CEHJ
Send me the address and return ticket, I'll come and paint it for FREE.

Man you did not read the question properly, I said SAMPLE SCRIPT. I did not expect you to write the script for you, but if you have any in your REPOSITORY to innlude these or any of the existing you can send it.
Thanks.

Hi Jimmack

I've done Build that compiles, does unit test and create zip file of the required code and dependencies including database scripts. I'd like to include Get the relavent data from PVCS of required version before what I've done and subsequently create JDBC connection to deploy sql scripts and restart webspehere. if you have tips, do send.
Thanks
0
 
LVL 15

Accepted Solution

by:
jimmack earned 1000 total points
ID: 9715644
;-)  I was also considering applying for the painting contract, but I would have charged some EE points ;-)

The Ant docs for the PVCS task seem to be quite reasonable and include a couple of examples, eg:

  <!-- =================================================================== -->
  <!-- Get the latest version                                              -->
  <!-- =================================================================== -->
  <target name="getlatest">
    <pvcs repository="/mnt/pvcs" pvcsproject="/myprj"/>
  </target>

You'll just need to make sure you've got the appropriate jakarta-ant...-optional.jar file installed.

Here's an (edited) example from one of my build.xml files that cleans a database (this is done before the script runs all the unit tests that refill the tables):

  <target name="cleandatabase">
    <sql driver="org.gjt.mm.mysql.Driver"
         classpath="/usr/java/j2sdk1.4.1_02/jre/lib/ext/mysql-connector-java-3.0.8-stable-
bin.jar"
         url="jdbc:mysql://desktop/project"
         userid="username"
         password="pwd">
      DELETE FROM clients WHERE id IS NOT NULL;
      DELETE FROM otherTable WHERE id IS NOT NULL;
      DELETE FROM thirdTable WHERE id IS NOT NULL;
      DELETE FROM lastTable WHERE id IS NOT NULL;
    </sql>
  </target>

Hope that helps ;-)
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9715658
Sorry, forgot to include the following on that last post (regarding the database access)

This is only an example to show you how I connect to my database.  Just replace the SQL as you see fit ;-)
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9717109
You probably want the <Exec> task in order to restart WebSphere.

The problem you might have here is if the WebSphere server is not on your local machine.  If it isn't, you should probably create a script/batch file that resets the server and then call that from Exec.

Not sure what you mean by "Generating log file"

The <Mail> task can be used to send an e-mail (including attachments if you want)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question