You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Dave Brondsema <da...@brondsema.net> on 2004/04/13 14:41:41 UTC

ant tasks to do cvs add and cvs commit?

I'm working on the deploy.cvs workstage for forrestbot.  This basically
checks out a site from CVS, copies the new pages into that directory, adds
any new files, and commits it all to CVS.  The old forrestbot does this
with shell scripting in forrestbot/scripts/publish_livesite

The difficulty I'm having is adding new pages to CVS.  I can use the ant
cvs task to do the 'add', but I don't know how to get the list of new
files.  Also, we have to determine if the file should be added as text or
binary.

Right now I can think of 2 options:

1) get the results from a 'cvs update' and parse them looking for new
files.  then do an add for each one.   problem: ant is not good for
parsing strings

2) get a recursive list of all the files (except from the 'CVS'
directories) and add all of them.  cvs will ignore ones that are already
in the repository.  how can I loop through a list of all the files?

And then there still is the issue of text/binary.

Any ideas or suggestions?

Thanks

-- 
Dave Brondsema : dave@brondsema.net
http://www.brondsema.net : personal
http://www.splike.com : programming
http://csx.calvin.edu : student org

Re: ant tasks to do cvs add and cvs commit?

Posted by David Crossley <cr...@apache.org>.
Dave Brondsema wrote:
> David Crossley wrote:
> 
> > We obviously need control over the add/commit, e.g. the bin/text
> > thing. I read that someone was horrified that Ant was turning
> > into a scripting tool. Is there a way that Ant calls a shell
> > script - i would be much happier with that.
> 
> Yes I agree Ant isn't designed to be a scripting language so when we try 
> to do such things it gets ugly.  somebody needs to create a simple, 
> cross-platform shell scripting language..

Perl?

> We could call a shell script from Ant, however that would not work in 
> Windows.  It would be nice to support Windows, but realistically there 
> are probably very few people who will use forrestbot to deploy their 
> website from windows to a cvs repository.

Could we have separate scripts from UNIX and Windows?

> As soon as I have time I will make a few attempts at doing this all in 
> Ant  But if it becomes impossible or very ugly, I guess we can just go 
> with a shell script.

:-)

--David



Re: ant tasks to do cvs add and cvs commit?

Posted by Dave Brondsema <da...@brondsema.net>.
David Crossley wrote:
> Dave Brondsema wrote:
> 
>>><snip/>
>>
>>No, unfortunately you have to 'cvs add' all new files before 'cvs commit'.
>>
>>Perhaps we could just create and use a deploy.scp and not host our 
>>website in CVS at all.
> 
> 
> For the Apache sites, they *must* be held in CVS.
> There is various past discussion on the infrastructure@a.o
> list about that.
> 

Ok

> We obviously need control over the add/commit, e.g. the bin/text
> thing. I read that someone was horrified that Ant was turning
> into a scripting tool. Is there a way that Ant calls a shell
> script - i would be much happier with that.
> 

Yes I agree Ant isn't designed to be a scripting language so when we try 
to do such things it gets ugly.  somebody needs to create a simple, 
cross-platform shell scripting language..

We could call a shell script from Ant, however that would not work in 
Windows.  It would be nice to support Windows, but realistically there 
are probably very few people who will use forrestbot to deploy their 
website from windows to a cvs repository.

As soon as I have time I will make a few attempts at doing this all in 
Ant  But if it becomes impossible or very ugly, I guess we can just go 
with a shell script.

-- 
Dave Brondsema : dave@brondsema.net
http://www.splike.com : programming
http://csx.calvin.edu : student org
http://www.brondsema.net : personal

Re: ant tasks to do cvs add and cvs commit?

Posted by David Crossley <cr...@apache.org>.
Dave Brondsema wrote:
> > <snip/>
> 
> No, unfortunately you have to 'cvs add' all new files before 'cvs commit'.
> 
> Perhaps we could just create and use a deploy.scp and not host our 
> website in CVS at all.

For the Apache sites, they *must* be held in CVS.
There is various past discussion on the infrastructure@a.o
list about that.

We obviously need control over the add/commit, e.g. the bin/text
thing. I read that someone was horrified that Ant was turning
into a scripting tool. Is there a way that Ant calls a shell
script - i would be much happier with that.

--David


Re: ant tasks to do cvs add and cvs commit?

Posted by Dave Brondsema <da...@brondsema.net>.
Juan Jose Pablos wrote:
> Dave,
> 
>>
>> The difficulty I'm having is adding new pages to CVS.  I can use the ant
>> cvs task to do the 'add', but I don't know how to get the list of new
>> files.
> 
> 
> would CvsTagDiff do the trick for you?
> 
>   <cvstagdiff
>                 destfile="tagdiff.xml"
>                 package="module"
>                 startDate="${last_run}"
>                 endDate="${today}"
>   />
> 
> 

I'll check, but I'm pretty sure this does a comparison on the server, so 
it will only work for files that have been checked in.  It won't know 
about the new files that we need to add.

>>
>> 2) get a recursive list of all the files (except from the 'CVS'
>> directories) and add all of them.  cvs will ignore ones that are already
>> in the repository.  how can I loop through a list of all the files?
>>
> 
> cvs commit does not do that logic by itself?
> 

No, unfortunately you have to 'cvs add' all new files before 'cvs commit'.

Perhaps we could just create and use a deploy.scp and not host our 
website in CVS at all.

-- 
Dave Brondsema : dave@brondsema.net
http://www.splike.com : programming
http://csx.calvin.edu : student org
http://www.brondsema.net : personal

Re: ant tasks to do cvs add and cvs commit?

Posted by Juan Jose Pablos <ch...@che-che.com>.
Dave,
> 
> The difficulty I'm having is adding new pages to CVS.  I can use the ant
> cvs task to do the 'add', but I don't know how to get the list of new
> files.

would CvsTagDiff do the trick for you?

   <cvstagdiff
                 destfile="tagdiff.xml"
                 package="module"
                 startDate="${last_run}"
                 endDate="${today}"
   />


> 
> 2) get a recursive list of all the files (except from the 'CVS'
> directories) and add all of them.  cvs will ignore ones that are already
> in the repository.  how can I loop through a list of all the files?
> 

cvs commit does not do that logic by itself?

Cheers,
Cheche