Solved

Sample Build & Deployment script for Ant

Posted on 2003-11-10
9
727 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

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 250 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
The viewer will learn how to implement Singleton Design Pattern in Java.

718 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