Solved

Sample Build & Deployment script for Ant

Posted on 2003-11-10
9
725 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
  • 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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 will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

856 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