powershell - Git tag at the end of build on Visual Studio Online (Build vNext, hosted pool) -
i'd automatically tag commit when build successful on vso build vnext. i've read doc including page https://msdn.microsoft.com/library/vs/alm/build/scripts/variables , i've setup small powershell script. first of all, seems build_repository_auth_username variable (and friend password) empty. guess they're available external gits ? second of all, seems checkout build done via tasks runs libgit2sharp, therefore credentials not stored in helper.
this powershell script :
git tag $env:build_buildnumber git status git config -l git push --progress https://$env:gituser:$env:gitpassword@myrepo.visualstudio.com/defaultcollection/_git/myproject tag $env:build_buildnumber git status exit
it works on machine on agent (hosted pool) seems hang on agent @ push command (after 1h, got automatically killed controller).
here log:
****************************************************************************** starting task: powershell: tools/gitcommands.ps1 ****************************************************************************** head detached @ 819e778 nothing commit, working directory clean core.symlinks=false core.autocrlf=true color.diff=auto color.status=auto color.branch=auto color.interactive=true pack.packsizelimit=2g help.format=html http.sslcainfo=/bin/curl-ca-bundle.crt sendemail.smtpserver=/bin/msmtp.exe diff.astextplain.textconv=astextplain rebase.autosquash=true core.bare=false core.filemode=false core.symlinks=false core.ignorecase=true core.logallrefupdates=true core.repositoryformatversion=0 remote.origin.url=https://myrepo.visualstudio.com/defaultcollection/_git/myproject remote.origin.fetch=+refs/heads/*:refs/remotes/origin/* branch.master.remote=origin branch.master.merge=refs/heads/master ****************************************************************************** finishing task: powershell ******************************************************************************
as can see, no log push nor status command. idea on how achieve ?
to answer question (or better title of question). let vnext build it.
as mentioned in comments, not available external git repositories.
Comments
Post a Comment