Jenkins: Access global passwords in powershell

前端 未结 2 520
有刺的猬
有刺的猬 2020-12-08 08:40

I am having trouble accessing the jenkins global password as an environment variable in powershell. I have done the following. Not sure what else I am missing.

    <
2条回答
  •  爱一瞬间的悲伤
    2020-12-08 09:15

    In our build we use it the following way (actual code):

    $deploymentdir = $env:VC_RES + "\azure"
    . ".\src\Extensions\Setup\VirtoCommerce.PowerShell\deploy-tfs.ps1" -deployment $deploymentdir -solutiondir $env:WORKSPACE
    

    and then pass $deploymentdir as a parameter to ps1, works fine.

    The environment variable VC_RES is configured under "Manage Jenkins"->Global Properties. There is a checkbox next to "Environment Variables" and we set those in there. The WORKSPACE variable is set by jenkins itself.

提交回复
热议问题