Hi there, Have you tried using npm's --prefix parameter? I'm not very familiar with npm, but an internet search suggests this as an option for invoking npm from a different location.
Alternately you could write a script that invokes npm and does whatever else you need, check that into source control and pull it into the Agent's sandbox at runtime. This has the added advantage of having your deployment process be less dependent on GoCD. Hope this helps, Jason Smyth On Friday, 24 June 2022 at 20:11:10 UTC-4 bahun...@gmail.com wrote: > Sorry, I missing the attachment image in the previous mail. > > [image: Screen Shot 2022-06-25 at 06.58.35.png] > > On Saturday, June 25, 2022 at 7:00:19 AM UTC+7 Hung Nguyen wrote: > >> Hi, >> >> The problem is the project working dir is outside of GoCD Agent working >> dir, please check the attachment image, >> >> Thank you. >> On Saturday, June 25, 2022 at 1:58:36 AM UTC+7 jsm...@scimarketview.com >> wrote: >> >>> Hi there, >>> >>> It seems to be this should be fairly easy to do by simply following the >>> documentation: >>> >>> https://docs.gocd.org/current/configuration/admin_add_task.html >>> >>> If that is not working for you, please let us know what you have tried >>> and what errors you are encountering. >>> >>> Cheers, >>> Jason Smyth >>> >>> >>> On Friday, 24 June 2022 at 00:31:08 UTC-4 bahun...@gmail.com wrote: >>> >>>> 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. >>>> >>> -- You received this message because you are subscribed to the Google Groups "go-cd" group. To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/60889e50-45c9-40b0-aad0-dab6e39009dfn%40googlegroups.com.