DevTest Labs - Example using 'Clone a git repository' artifact with VSTS Git source please...


hi,

please can provide example of 'clone git repository' artifact in use. ideally repo should exist within vsts. i'd copy repo root of c drive on vm.



i'm getting following error:



many thanks
phil

hi swikruti,

many getting me. actual problem turned out bug in artifacts' artifactfile.json file.

buggy line:

"commandtoexecute": "[concat('powershell.exe -executionpolicy bypass -file startchocolatey.ps1', ' -gitrepolocation ', parameters('gitrepouri'), ' -gitlocalrepolocation ''', parameters('destination'), ''' -gitbranch ', parameters('branch'), ' -personalaccesstoken ', parameters('personalaccesstoken'))]"

fixed line:

"commandtoexecute": "[concat('powershell.exe -executionpolicy bypass -file startchocolatey.ps1', ' -gitrepolocation ', parameters('gitrepouri'), ' -gitlocalrepolocation ', parameters('destination'), ' -gitbranch ', parameters('branch'), ' -personalaccesstoken ', parameters('personalaccesstoken'))]"

the gitlocalrepolocation parameter being incorrectly wrapped in single quotes, broke artifact.

a couple more things if may...

1. having found bug, what's recommended way pass fixes? update repo directly directly or maybe sent repo patch file somewhere or what?

after getting work, relatively minor issue arose. startchocolatey.ps1 throws error trying delete user files when tidying up:

exception calling "delete" "0" argument(s): "" @ c:\packages\plugins\microsoft.compute.customscriptextension\1.8\downloads\0\ crm-dev-vm92.131234157047219810\ps-windows-clon117042164\scripts\startchocolate y.ps1:74 char:81 + ...  } | foreach { $_.delete() } +                    ~~~~~~~~~~~     + categoryinfo          : notspecified: (:) [], methodinvocationexception     + fullyqualifiederrorid : dotnetmethodexception   exception calling "delete" "0" argument(s): "" @ c:\packages\plugins\microsoft.compute.customscriptextension\1.8\downloads\0\ crm-dev-vm92.131234157047219810\ps-windows-clon117042164\scripts\startchocolate y.ps1:74 char:81 + ...  } | foreach { $_.delete() } +                    ~~~~~~~~~~~     + categoryinfo          : notspecified: (:) [], methodinvocationexception     + fullyqualifiederrorid : dotnetmethodexception   

2. same file has line:

$username = "artifactinstaller"

during script debugging, user isn't deleted , when run again, script fail. great if check added ensure either unique username used or (much better) remnants removed prior creating user.

thanks

phil






Microsoft Azure  >  Azure DevTest Labs



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'