Best way to pull source from Stash using Ant

Jan Swaelens
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 7, 2013

Hello,

We are listing our options to migrate from SVN to Stash. One of the biggest challenges is to cover all the ways that we are using the SVN repository and make sure that they are still possible after the migration.

One of these potentially problematic usages is a set of Ant scripts which dont run on our CI server (Bamboo) and thus need to obtain the sources 'manually'.

We where wondering what the best practice would be here, is there some API available to facilitate this or would we be needing to execute the git commands by means of the Ant 'exec' task.

All thoughts are very welcome.

1 answer

1 accepted

0 votes
Answer accepted
seb
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 7, 2013

I guess it depends on what your ant tasks do. If you want to retrieve "information" about your Git repositories, then you can use the Stash REST apis to retrieve changeset history etc. You will only be able to use the Stash Java APIs in the process of a Stash instance (as a plugin in the app), but I don't think this would be useful to you if you are in an Ant task.

Alternatively, you can of course use Ant's exec task to run arbitrary git commands, but you will need to first clone the repository which may not be necessary, depending on your requirements.

If you could provide more information on what your Ant tasks do or what they are used for, we might be able to provide a more relevant set of suggestions!

Jan Swaelens
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 7, 2013

Sure, I ran trough the scripts and we would basically need a replacement for the following SVN operations available used as Ant task today:

  • checkout
  • revert
  • export
  • switch
  • info
  • update

It looks like my best bet would be invoking the git command directly, I assume that the Bamboo Git integration does someting similar?

seb
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 8, 2013

Bamboo's git integration only clones repositories so that it can run tests against the source. If you need to perform repository modifications, then you'd need to execute your own git commands.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events