[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Sample Build & Deployment script for Ant

Posted on 2003-11-10
9
Medium Priority
?
731 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
7 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

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

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn different types of Android Layout and some basics of an Android App.
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 …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses
Course of the Month19 days, 16 hours left to enroll

873 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