diff --git a/GitDownloader/GitDownloader.ps1 b/GitDownloader/GitDownloader.ps1 index e10d3a3..9dba50b 100644 --- a/GitDownloader/GitDownloader.ps1 +++ b/GitDownloader/GitDownloader.ps1 @@ -93,10 +93,14 @@ Function Update-GitRepository { git clean -fdx } } + # get current fetch uri + $remoteUris = git remote -v + $match = [regex]::Match($remoteUris, '^(origin)\s(?.+)\s\(fetch\)\W') + $fetchUri = $match.Groups['url'].Value Write-Host "Pulling update from branch/tag $BranchTag" Invoke-VerboseCommand -Command { git config credential.interactive never } # try to use token provided by TFS server - If (Test-SameTfsServer -Uri $Uri) { + If (Test-SameTfsServer -Uri $fetchUri) { $AuthHeader = "Authorization: bearer $($Env:SYSTEM_ACCESSTOKEN)" Invoke-VerboseCommand -Command { git -c http.extraheader="$AuthHeader" pull origin $BranchTag } } diff --git a/GitDownloader/task.json b/GitDownloader/task.json index 6aa71ba..4d9b31b 100644 --- a/GitDownloader/task.json +++ b/GitDownloader/task.json @@ -3,7 +3,7 @@ "name": "GitDownloader", "friendlyName": "Git Repository Downloader", "description": "Download additional git repository from public repository or this TFS", - "helpMarkDown": "This task will download git repository as an addition to default source. Consider this task as workaround where TFS build with git repository can only download 1 repository. This task assumes that git is already installed in %ProgramFiles%\\Git within TFS build agent's machine.", + "helpMarkDown": "[More information](https://github.com/fakhrulhilal/TFSGitDownloader/blob/master/README.md)", "category": "Utility", "visibility": [ "Build", @@ -14,7 +14,7 @@ "version": { "Major": 0, "Minor": 2, - "Patch": 11 + "Patch": 12 }, "instanceNameFormat": "Fetch git: $(Repository)", "groups": [ diff --git a/README.md b/README.md index 36b53da..4651fb7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Git Downloader -This task will download git repository as an addition to default source. Consider this task as workaround where TFS build with git repository can only download 1 repository. Then this task will download another git repository required by your TFS build definition. This task assumes that git is already installed in %ProgramFiles%\\Git within TFS build agent's machine. +This task will download git repository as an addition to default source. Consider this task as workaround where TFS build with git repository can only download 1 repository. Then this task will download another git repository required by your TFS build definition. This task assumes that git is already installed in PATH environment variable or %ProgramFiles%\\Git within TFS build agent's machine. ## Parameters diff --git a/images/logo.png b/images/logo.png index 794777f..833dae5 100644 Binary files a/images/logo.png and b/images/logo.png differ diff --git a/vss-extension.json b/vss-extension.json index 7e5e883..9b849e2 100644 --- a/vss-extension.json +++ b/vss-extension.json @@ -2,7 +2,7 @@ "manifestVersion": 1, "id": "GitDownloader", "name": "Git Repository Downloader", - "version": "0.2.11", + "version": "0.2.12", "publisher": "fakhrulhilal-maktum", "targets": [ { @@ -10,6 +10,9 @@ } ], "description": "Download additional git repository from public repository or this TFS", + "galleryFlags": [ + "Public" + ], "categories": [ "Build and release" ], @@ -21,7 +24,12 @@ "default": "images/logo.png" }, "content": { - "details": { "path": "README.md"} + "details": { + "path": "README.md" + }, + "license": { + "path": "LICENSE" + } }, "files": [ { @@ -43,5 +51,23 @@ "name": "GitDownloader" } } - ] + ], + "links": { + "learn": { + "uri": "https://github.com/fakhrulhilal/TFSGitDownloader/blob/master/README.md" + }, + "repository": { + "uri": "https://github.com/fakhrulhilal/TFSGitDownloader.git" + }, + "license": { + "uri": "https://github.com/fakhrulhilal/TFSGitDownloader/blob/master/LICENSE" + }, + "issues": { + "uri": "https://github.com/fakhrulhilal/TFSGitDownloader/issues" + } + }, + "repository": { + "type": "git", + "uri": "https://github.com/fakhrulhilal/TFSGitDownloader.git" + } } \ No newline at end of file