?
Solved

Sample Build & Deployment script for Ant

Posted on 2003-11-10
9
Medium Priority
?
728 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 real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 

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

Is Your Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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 …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses
Course of the Month11 days, 8 hours left to enroll

752 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