在我的“部署”管道中,我从上游管道中取出了构建的工件,但是问题在于我的工作目录与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.
发布评论
评论(1)
有点晚了,但是我没有使用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 asnpm
. 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 thepipelines
folder, but you can ignore that if you like.