[英]Azure DevOps Release Pipeline - How to Automate Registration of Deployment Group targets
Currently the Deployment Group 'Register' script needs to be run interactively by providing information like tags, Token, account credentials etc.目前,部署组“注册”脚本需要通过提供标签、令牌、帐户凭据等信息以交互方式运行。
It becomes a tedious task to run this interactive script on hundreds of machines to register them into Azure Pipeline Deployment Group.在数百台机器上运行此交互式脚本以将它们注册到 Azure Pipeline 部署组成为一项繁琐的任务。
Is there a way, where we can run in non-interactive mode by passing the required information as a parameter to script?有没有办法通过将所需信息作为参数传递给脚本来在非交互模式下运行?
For eg .\\scriptToAddToDeploymentGroup.ps1 <--tags appServer, domainController, etc> <--token 43875783457834545>例如 .\\scriptToAddToDeploymentGroup.ps1 <--tags appServer, domainController, etc> <--token 43875783457834545>
Can we automate this task from command line by passing parameter values?
我们可以通过传递参数值从命令行自动执行此任务吗?
For this issue , the answer is yes.对于这个问题,答案是肯定的。 You could add tags and token as parameters to the Registration script.
您可以将标签和令牌作为参数添加到注册脚本中。 For details ,please refer to this document .
有关详细信息,请参阅此文档。
If you chose --auth pat
: --token <token>
- specifies your personal access token如果您选择
--auth pat
: --token <token>
- 指定您的个人访问令牌
--deploymentGroupTags <tags>
- used with --addDeploymentGroupTags
to specify the comma separated list of tags for the deployment group agent - for example "web, db" --deploymentGroupTags <tags>
- 与--addDeploymentGroupTags
一起使用,为部署组代理指定逗号分隔的标签列表 - 例如“web, db”
For example:例如:
\config.cmd --deploymentgroup --deploymentgroupname "xxx" --agent $env:COMPUTERNAME --runasservice --work '_work' --url 'https://dev.azure.com/xx/' --projectname 'xxx'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.