Search code examples
javagitjenkinsazure-devopsivy

Refer a folder in VSTS which houses a local ivy repository from my project build file


I am new to VSTS and so this question may seem trivial. I have a java project that is built on ant with apache ivy being used for dependency resolution. Most of the jar dependencies are resolved from public repositories e.g. Maven etc. There are a few dependencies that are not available easily and therefore I set up a local ivy repository for such instances.

I am thinking of moving my entire code base to VSTS Git repository and build my application using Jenkins. This should be straight forward, the only roadblock that I seem to have as of now is that for my local repository that is based out of my local file system, how do I maintain the same in VSTS ?

Can I create a folder in VSTS and house all my local ivy repository contents there and somehow refer to that VSTS location from my code (ivy settings file)? OR is there a more elegant way to do this.

I can place the local repo folder into by code base and upload the folder into VSTS Git but I am looking for a solution where in the local repo contents should not be cloned and downloaded every time when someone clones my VSTS Git code base.

Can someone help ?


Solution

  • To manage the local ivy repo into VSTS git repo, you just need to commit all the files in local repo and push to VSTS git repo (no need to upload and download manually).

    Detail steps for different situations as below, you can follow any of the situations you meet:

    Situation 1: the local ivy repo is also a git repo and you want to manage it in VSTS git repo

    Since the ivy repo is already a local git repo, you just need to add VSTS repo as a remote for the local repo, and then commit and push changes to the remote repo (VSTS git repo):

    # In you local ivy repo
    git remote add origin <URL for VSTS git repo> -f
    # make sure all the changes are committed 
    git push origin --all -f
    

    Situation 2: if there has other files managed in VSTS git repo, you want to add files from local ivy repo into VSTS git repo

    If files in local ivy repo are just part of the files in your VSTS git repo (you need to keep commit history of the VSTS git repo), you should clone your VSTS git repo locally at first, and then copy the files from the ivy repo to the cloned local repo, and then commit and push. Detail commands as below:

    # In a directory
    git clone <URL for VSTS git repo>
    cd reponame
    # copy all the files from local ivy repo here
    git add .
    git commit -m 'add all the files from ivy repo to VSTS git repo'
    git push
    

    After that, when you need to make changes on the for the local files, just need to modify the file in the local repo, and then commit and push to the remote repo (VSTS git repo).