Reputation: 3842
I need as a part of the build process to download contents from external github repository. I set up repository under "services" but I can not find a task which will download artifacts from that repo.
I use TFS 2017 on prem. My repository is already set to Git repo and I need to have one of build steps to pull data from yet another Git repo. How do i do that?
Upvotes: 0
Views: 3464
Reputation: 38136
copy files task
in your build definition.Get source: select Github and use github token to authoize. If you want CI build, set in Triggers Tab.
Copy Files: set $(Build.SourcesDirectory)
as Source Folder, specify the file you want to download in Contents, set a local path as Target Folder.
copy files task
and publish build artifacts task
in you build defnition.Get source: select from github.
Copy Files: set $(Build.SourcesDirectory)
as Source Folder, specify the file you want to download in Contents, set $(build.artifactstagingdirectory)
as Target Folder.
Publish Build Artifacts: set $(build.artifactstagingdirectory)
as Path to Publish, select the type you want to publish.
The way to connect github repo for TFS build:
In TFS build definition -> Repository Tab -> select External Git -> click Manage to add an External Git Service Endpoint -> input your github repo URL, username and password -> OK -> Then select the endpoint as connection.
You can use Command Line task to clone the github repo to your $(Build.SourcesDirectory)
folder.
Tool: git
Arguments: clone https://github.com/username/repo
Now the code of the github repo is cloned in $(Build.SourcesDirectory)\repo
.
Upvotes: 1