GOCD代理如何在不同文件夹上运行命令(在代理工作目录之外)

发布于 2025-02-10 04:34:14 字数 304 浏览 0 评论 0 原文

在我的“部署”管道中,我从上游管道中取出了构建的工件,但是问题在于我的工作目录与GOCD代理工作目录相比有所不同,因此我无法将该工件部署到我的工作dir。此外,移动工件后,我必须在工作dir上运行一些命令,例如 npm运行生产

  • 我的工作dir:/var/www/vhosts/project
  • gocd代理工作dir:/var/lib/go-agent

,我如何将工件复制到外部GOCD代理,然后运行一些其他命令?

多谢。

In my "deploy" pipeline, I have pulled the built artifact from upstream pipeline, but the problem is my working directory is different compared to the GoCD Agent working directory, so I can't deploy that artifact to my working dir. Additionally, I must run some command on my working dir after moving the artifact, e.g. npm run production.

  • My working dir: /var/www/vhosts/project
  • GoCD Agent working dir: /var/lib/go-agent

So, how can I copy the artifact to the outside of GoCD Agent and then run some additional commands?

Thanks a lot.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

掀纱窥君容 2025-02-17 04:34:14

有点晚了,但是我没有使用GO-CD很长时间。

作业中,您可以创建一个自定义命令,例如 npm 。自定义命令可以作为命令提示进行。

您可以将网络驱动器映射到 c:\ program Files(x86)\ go agent \ pipelines 文件夹之外的特定位置,然后您可以在命令中引用这些文件。请注意,您可以包含许多参数,这些参数将添加到您的自定义命令中,其中介于两者之间,作为参数。因此,最好选择不包括空格的驱动映射。

如果文件位置在C:驱动器上,则可以尝试从 c:\ 指定完整路径。工作目录在 pipelines 文件夹中,但是如果愿意,您可以忽略它。

A bit late, but I haven't been using Go-CD very long.

In a Job, you can create a custom command, such as npm. The custom command works as a command prompt would.

You can map a network drive to a specific location outside of the C:\Program Files (x86)\Go Agent\Pipelines folder, and then you can reference these in your commands. Note that you can include lots of parameters, which get added to your custom command with spaces in between, as parameters. For this reason, it would be best to choose drive mappings that don't include spaces.

If the file location is on the C: drive, you can try specifying the full path, from C:\. The working directory is in the pipelines folder, but you can ignore that if you like.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文