You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@continuum.apache.org by Adrian Wiesmann <aw...@somap.org> on 2009/08/14 14:31:23 UTC

Automated installation after build

Hello list

I am a new user of continuum and while documentation is a little difficult
for a greenhorn at times, things are running now and I very much like what
I can do with continuum. 

Currently I am having a problem for which I am not sure how to find a
solution because I don't know what word to search for. I hope you can help
me out there.

I want to have a demo website where the latest build of a project will be
installed after every successful build. Currently I have a Project Group
with a single Ant Project. The project compiles into a xy.war file which I
would then like to automatically copy into the webapps folder of a tomcat
instance on the same machine. Afterwards I would like to restart tomcat.

I guess I am not the first trying to do so. Could please anybody supply me
with some pointers?

Thanks for your help.

Cheers,
Adrian




Re: Automated installation after build

Posted by Wendy Smoak <ws...@gmail.com>.
On Thu, Aug 20, 2009 at 1:51 PM, Adrian Wiesmann<aw...@somap.org> wrote:
> Wendy Smoak <ws...@gmail.com> wrote:

>> There has occasionally been discussion of adding pre- and post- build
>> hooks into Continuum, so you can execute things that are not part of
>> the build, but it hasn't happened yet.
>
> If I understood it correctly, you should be able to do so today already?

No.  Search the archives and you may find some previous discussions,
but no one has implemented the feature yet.  You can add an
enhancement request in JIRA if there isn't one already.

> We do have a properties.xml and a properties-local.xml. Both are
> referenced from within the build.xml file (used with Ant). The -local file
> basically overrides the "global" settings from the properties file. The
> Ant build.xml file is part of the Subversion repository. The
> properties.xml as well (-local obviously not).
>
> What I now need on the Continuum server is the properties-local.xml as
> well. I solved this with adding a properties-local.xml file to the same
> folder as the files under the repositories control (manually).

How does this work when developers build locally?  (Where do they
store the properties-local.xml file?)

Ideally the build works the same whether it's done manually by a
developer or automated with Continuum.

-- 
Wendy

Re: Automated installation after build

Posted by Adrian Wiesmann <aw...@somap.org>.
Wendy Smoak <ws...@gmail.com> wrote:

> One way to think about Continuum is "build automation".  If you look
> in the logs, you'll see it executing a command-line build like "mvn
> clean install" or "ant build" on the schedule you chose [subject to
> some conditions like whether anything has changed in source control].
> 
> So that would mean you need to make your Ant script do everything you
> want, then have Continuum execute it at the correct time.

I think I get the hang of it. But the learning curve is quite steep.

Thanks to your help I was now able to do what I wanted to. Thanks again.


> There has occasionally been discussion of adding pre- and post- build
> hooks into Continuum, so you can execute things that are not part of
> the build, but it hasn't happened yet.

If I understood it correctly, you should be able to do so today already?
Like having multiple build steps where you call a different Ant target. I
do something like that calling the install_webapp target after the build
target.

What I am wondering now is the following scenario:

We do have a properties.xml and a properties-local.xml. Both are
referenced from within the build.xml file (used with Ant). The -local file
basically overrides the "global" settings from the properties file. The
Ant build.xml file is part of the Subversion repository. The
properties.xml as well (-local obviously not). 

What I now need on the Continuum server is the properties-local.xml as
well. I solved this with adding a properties-local.xml file to the same
folder as the files under the repositories control (manually).

Is this correct, or is there some (better) way to tell Continuum (or
directly Ant) where to find such files?

Cheers and thanks,
Adrian

Re: Automated installation after build

Posted by Wendy Smoak <ws...@gmail.com>.
On Mon, Aug 17, 2009 at 2:04 AM, Adrian Wiesmann<aw...@somap.org> wrote:

> The main problem I am having is to understand where Continuum stops and
> where tools like Ant and Maven start. Which feature is part of Continuum
> and which feature is part of a third party library. When understanding
> this it becomes less complicated to find the correct source for help.

One way to think about Continuum is "build automation".  If you look
in the logs, you'll see it executing a command-line build like "mvn
clean install" or "ant build" on the schedule you chose [subject to
some conditions like whether anything has changed in source control].

So that would mean you need to make your Ant script do everything you
want, then have Continuum execute it at the correct time.

> You are right, I could use the copy task from my Ant script (there already
> is one). What I did not understand (see my problem above) was if that copy
> mechanism already is a feature of Continuum or if I should use an Ant
> script.

There has occasionally been discussion of adding pre- and post- build
hooks into Continuum, so you can execute things that are not part of
the build, but it hasn't happened yet.

I prefer to put these kind of things into a section of the build that
only gets run if the build is happening on the Continuum server.
(With Maven, I do it in a profile.)

> So just a follow up question: when using some copy task from my Ant
> script. Should I add a new Ant task to my continuum configuration, or
> should I just call a build task in my Ant script which also publishes the
> application? Whats the good practice there?

I'd probably do the former and add a separate task that's only called
by Continuum (or on demand).  The latter sounds like it would make it
part of the default build, so it would happen for a developer who's
just trying to build the project locally and work on it.

-- 
Wendy

Re: Automated installation after build

Posted by Adrian Wiesmann <aw...@somap.org>.
Wendy Smoak <ws...@gmail.com> wrote:

> Please point out areas where you had trouble with the docs, so we can
> improve them!

The main problem I am having is to understand where Continuum stops and
where tools like Ant and Maven start. Which feature is part of Continuum
and which feature is part of a third party library. When understanding
this it becomes less complicated to find the correct source for help.


> The easiest way to accomplish this is probably to make it part of your
> Ant script.  I know there is a copy task, and I'd be surprised if
> there weren't Ant tasks for Tomcat.

You are right, I could use the copy task from my Ant script (there already
is one). What I did not understand (see my problem above) was if that copy
mechanism already is a feature of Continuum or if I should use an Ant
script.

So just a follow up question: when using some copy task from my Ant
script. Should I add a new Ant task to my continuum configuration, or
should I just call a build task in my Ant script which also publishes the
application? Whats the good practice there?

Thanks for your help,
Adrian

Re: Automated installation after build

Posted by Wendy Smoak <ws...@gmail.com>.
On Fri, Aug 14, 2009 at 5:31 AM, Adrian Wiesmann<aw...@somap.org> wrote:
> I am a new user of continuum and while documentation is a little difficult
> for a greenhorn at times, things are running now and I very much like what
> I can do with continuum.

Please point out areas where you had trouble with the docs, so we can
improve them!

> I want to have a demo website where the latest build of a project will be
> installed after every successful build. Currently I have a Project Group
> with a single Ant Project. The project compiles into a xy.war file which I
> would then like to automatically copy into the webapps folder of a tomcat
> instance on the same machine. Afterwards I would like to restart tomcat.

The easiest way to accomplish this is probably to make it part of your
Ant script.  I know there is a copy task, and I'd be surprised if
there weren't Ant tasks for Tomcat.

Or you could have a separate process (cron job?) that watches for the
existence of xy.war and then does the copy and re-start.  (Or I
suppose you could have that as a separate "build" in Continuum.)

-- 
Wendy