Build from external GIT repo located in networkshare - tfs-2015

I have problem to create service connection under TFS2015 Update2.
I have GIT remote REPO located in server and i access it by network share folder in this format:
\\server\GIT_REPOS\GIT_REPO_TO_BUILD_FROM\
I tried add new External GIT REPO Connection under TFS configuration as follow:
Connection name: Git repo
Server url: \\server\GIT_REPOS\GIT_REPO_TO_BUILD_FROM\
UserName: domain\username
Password: userPassword
When I try queue new build i get this error:
Failed to resolve path 'file://server/GIT_REPOS/GIT_REPO_TO_BUILD_FROM/': The filename, directory name, or volume label syntax is incorrect.
Prepare repository failed with exception.
Know someone correct way how to use it with network shared REPO ?
Thanks for help a lot.

According to website https://git-scm.com/book/ch4-1.html, Git supports Local protocol and can use the path to the repository as the URL, but in TFS build, local path isn't supported (I got the same error as you).
As an alternate, you need to publish your repo to a server. Meanwhile, you may consider submit a UserVoice at website https://visualstudio.uservoice.com/forums/121579-visual-studio-2015 to specify the requirement of supporting local git.

Related

Intellij - Unable to clone the repository "Clone Failed - Unable to access '<<repo url >> ': Recv failure: Connection was reset

I am trying to clone a repository using IntelliJ. I am very new to IntelliJ. I am able to clone the repository using eclipse though.
In eclipse (Git Repositories view), I am asked to provide credentials to access company's GIT Server but not sure where to provide these in Intelli J. I know I can login to GitHub account through IntelliJ but I am trying to access the repo which is in company's GIT server.
Please point out what wrong I am doing and guide me.
In IntelliJ, these are steps I am following.
Go for File -> New -> Project from Version Control
Select Repository URL and enter the values for fields URL and Directory. Click on Clone.
Here's the error snapshot
For future references to anyone having this same problem, copying the code url instead of ssh from github would solve this issue.

VSTS Nuget restore credentials

We are using a nuget package that requires authentication and are having issues when we try to build our project via VSTS builds. We can pull up the external nuget package feed from our authenticated browser and also via Visual Studio. The project builds locally and has no issues. However, when running through VSTS builds, we receive a 401 unauthorized messed even though we believe we have set things up properly.
Setup
Image of nuget task
Image of authentication for nuget feed
Image of personal access token that is used
Build log
Part of the log that shows that the authentication is picked up and being applied:
2018-03-30T19:38:43.2917713Z Saving NuGet.config to a temporary config file.
2018-03-30T19:38:43.3113980Z Using authentication information for the following URI: https://microsoft.pkgs.visualstudio.com/_packaging/MEE.Privacy/nuget/v3/index.json
2018-03-30T19:38:43.3123672Z [command]D:\a\_tool\NuGet\4.1.0\x64\nuget.exe sources Remove -NonInteractive -Name Privacy -ConfigFile D:\a\4\Nuget\tempNuGet_5609.config
2018-03-30T19:38:45.5301476Z Package source with Name: Privacy removed successfully.
2018-03-30T19:38:45.5348241Z [command]D:\a\_tool\NuGet\4.1.0\x64\nuget.exe sources Add -NonInteractive -Name Privacy -Source https://microsoft.pkgs.visualstudio.com/_packaging/MEE.Privacy/nuget/v3/index.json -ConfigFile D:\a\4\Nuget\tempNuGet_5609.config -Username ******** -Password ********
2018-03-30T19:38:46.0254022Z Package Source with Name: Privacy added successfully.
2018-03-30T19:38:46.0295574Z [command]D:\a\_tool\NuGet\4.1.0\x64\nuget.exe restore D:\a\4\s\msc\dev\Msc.Privacy\Msc.Privacy.sln -Verbosity Detailed -NonInteractive -ConfigFile D:\a\4\Nuget\tempNuGet_5609.config
Error that we receive when trying to find nuget package:
The nuget command failed with exit code(1) and error(Errors in packages.config projects
Unable to find version '1.1.18087.3' of package 'Microsoft.PrivacyServices.CommandFeed.Client'.
C:\Users\VssAdministrator\.nuget\packages\: Package 'Microsoft.PrivacyServices.CommandFeed.Client.1.1.18087.3' is not found on source 'C:\Users\VssAdministrator\.nuget\packages\'.
D:\a\4\Nuget\..\..\_Packages: Package 'Microsoft.PrivacyServices.CommandFeed.Client.1.1.18087.3' is not found on source 'D:\a\4\Nuget\..\..\_Packages'.
https://api.nuget.org/v3/index.json: Package 'Microsoft.PrivacyServices.CommandFeed.Client.1.1.18087.3' is not found on source 'https://api.nuget.org/v3/index.json'.
https://microsoft.pkgs.visualstudio.com/_packaging/MEE.Privacy/nuget/v3/index.json: Unable to load the service index for source https://microsoft.pkgs.visualstudio.com/_packaging/MEE.Privacy/nuget/v3/index.json.
Response status code does not indicate success: 401 (Unauthorized).
Questions
Any ideas on what we could be missing?
It turns out our personal access token was not setup properly. When creating the token, we weren't choosing the correct account. To fix our issues, we created a new token using 'All accessible [Microsoft] accounts' instead of 'myuser1'.
Image of personal access token creation

How to tag a git repo in a bamboo build

I'm trying to tag the git repo of a ruby gem in a Bamboo build. I thought doing something like this in ruby would do the job
`git tag v#{current_version}`
`git push --tags`
But the problem is that the repo does not have the origin. somehow Bamboo is getting rid of the origin
Any clue?
Yes, if you navigate to the job workspace, you will find that Bamboo does not do a straightforward git clone "under the hood", and the the remote is set to an internal file path.
Fortunately, Bamboo does store the original repository URL as ${bamboo.repository.git.repositoryUrl}, so all you need to do is set a remote pointing back at the original and push to there. This is what I've been using with both basic Git repositories and Stash, creating a tag based on the build number.
git tag -f -a ${bamboo.buildNumber} -m "${bamboo.planName} build number ${bamboo.buildNumber} passed automated acceptance testing." ${bamboo.planRepository.revision}
git remote add central ${bamboo.planRepository.repositoryUrl}
git push central ${bamboo.buildNumber}
git ls-remote --exit-code --tags central ${bamboo.buildNumber}
The final line is simply to cause the task to fail if the newly created tag cannot be read back.
EDIT: Do not be tempted to use the variable ${bamboo.repository.git.repositoryUrl}, as this will not necessarily point to the repo checked out in your job.
Also bear in mind that if you're checking out from multiple sources, ${bamboo.planRepository.repositoryUrl} points to the first repo in your "Source Code Checkout" task. The more specific URLs are referenced via:
${bamboo.planRepository.1.repositoryUrl}
${bamboo.planRepository.2.repositoryUrl}
...
and so on.
I know this is an old thread, however, I thought of adding this info.
From Bamboo version 6.7 onwards, it has the Git repository tagging feature Repository Tag.
You can add a repository tagging task to the job and the Bamboo variable as tag name.
You must have Bamboo-Bitbucket integrated via the application link.
It seems that after a checkout by the bamboo agent, the remote repository url for origin is set as file://nothing
[remote "origin"]
url = file://nothing
fetch = +refs/heads/*:refs/remotes/origin/*
That's why we can either update the url using git remote set-url or in my case I just created a new alias so it does not break the existing behavior. There must be a good reason why it is set this way.
[remote "build-origin"]
url = <remote url>
fetch = +refs/heads/*:refs/remotes/build-origin/*
I also noticed that using ${bamboo.planRepository.<position>.repositoryUrl} did not work for me since it was defined in my plan as https. Switching to ssh worked.

Unable to use egit to clone a repository with ssh

I try to clone a GIT repository with EGit using SSH. I can log on to the machine, see the available branches and choose where to put everything locally. Then when I proceed to actually do the cloning, I get an Eclipse "Problem Occured" box stating:
"Cloning from ssh://[my user name]#[my address] has encountered a problem. ssh://[my user name]#[my address]: Password:". The details for the problem only list "ssh://[my user name]#[my address]: Password:" twice.
The only possible reason I can think of, might be that on the remote compute only Git 1.6.0.x is installed - and I don't have the rights to update it.
Can you clone the repository using native git? If you can do that, just clone it using native git and then import the project into eclipse using:
File -> Import -> Projects from Git -> Local
If your eclipse runs on Windows, you will need a linux machine (virtual machine will do) and clone the repo into a NTFS or Fat32 formatted storage. Then you will be able to copy the cloned repo into your git folder on the windows machine.

New repository, production problem

I have a problem with the deployment of the project on the production server. We use Capistrano and Passenger. The problem is that we moved the project repository on GitHub to another account. I changed the repository address in the file deploy.rb, however, during the 'cap production deploy ", after authentication by the production server, Capistrano is looking for an old repository, which fails. I suspect that this is a change in the repository. git on production, but I do not know how to do it.
servers: ["85.xxx.xxx.xxx"]
Password:
[85.xxx.xxx.xx] executing command
** [85.xxx.xxx.xx:: err] ERROR: repo / repo.git does not exist. Did you enter it correctly?
** [85.xxx.xxx.xx:: err] fatal: The remote end hung up unexpectedly
command finished in 4220ms
*** [deploy: update_code] rolling back
Try editing shared/cached-copy/.git/config and modify the git repo listed there. If you're using the remote_cache method, it keeps a local git repo and updates that on the remote machine. Repoint that to your new git repo and you should be good to go.