gpt4 book ai didi

azure - 将 Azure 发布项目默认目录配置为 C(使用 "GetHostByName"参数调用 "1": "No such host is known")

转载 作者:行者123 更新时间:2023-12-03 02:45:52 25 4
gpt4 key购买 nike

我有两个 DevOps Azure 发布阶段(DEV 和 TT)。 Dev 能够从构建源 CI 管道检索工件并复制到 C 驱动器(看起来不错),其中 TT 复制到 D 驱动器,我无法在构建服务器上找到路径,例如 D:\a\r1\a.. ..并抛出异常,如下所示。

[error]使用“1”个参数调用“GetHostByName”时出现异常:“没有已知的主机”

如何将 TT 的默认复制驱动器设置为 C?

enter image description here

最佳答案

更新

如果您看不到在构建代理上创建的任何文件夹。那么一种可能性是,两个阶段可能无法在同一个构建代理中运行。请仔细检查此信息。

如果您仍然遇到类似错误,请设置debug=true并在此处分享相关日志以进行故障排除。

OP 验证问题已解决:为 Dev 和 TT 使用不同的脱模剂。将两个代理更改为单一代理已成功。

<小时/>

根据您的错误信息,猜测您正在使用主机代理。

这与您使用的驱动器无关。

Avoid hard-coded references

When you use a Microsoft-hosted agent, always use variables to refer to the build environment and agent resources. For example, don't hard-code the drive letter or folder that contains the repository. The precise layout of the hosted agents is subject to change without warning.

Source Link

<小时/>

如果您使用的是自托管代理。它与您的默认代理安装路径有关。有相关的预定义变量

Agent.ReleaseDirectory

The directory to which artifacts are downloaded during deployment of a release. The directory is cleared before every deployment if it requires artifacts to be downloaded to the agent. Same as System.ArtifactsDirectory and System.DefaultWorkingDirectory.

更多详情请引用Agent variables

如果要更改路径,需要确保代理安装在 C:\ 下,而不是 D:\ 下。此外,您还可以选择使用Copy Files task在发布管道中根据您的需要将文件从源文件夹复制到目标文件夹。

关于azure - 将 Azure 发布项目默认目录配置为 C(使用 "GetHostByName"参数调用 "1": "No such host is known"),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58924966/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com