Today GoCD doesn't know about build dependencies being within the project
root or not. Some ways we can workaround the problem I can think of

   1. For an existing project we can expose the entire .node_modules/
   folder as an artifact and fetch it in the same pipeline of a different run.
   This is very similar to what you've also suggested. The disadvantage with
   this approach is that you'll end consuming too much disk space for
   artifacts especially if you've a lot of dependencies which might be major
   cause of this question in the first place. - NOT A RECOMMENDED APPROACH.

   2. Today unlike other CI tools out there, GoCD doesn't have a notion of
   CACHE directory for the build pipelines. Now, if you can maintain a
   directory (or a separate partition say /data/go-cache) and create a symlink
   to /data/go-cache/<pipeline>/<stage>/<job> in the current working directory
   for each pipeline run. You will have your artifacts cached across runs, and
   you can clear them anytime since the cache would be re-build from scratch
   again next time the build runs. The major advantage of this approach is
   that you'll always have 1 copy of the dependencies that get's reused across
   multiple runs.

   This can be automated using an SCM plugin, I guess. Any takers? :)

   PS: This assumes that all go-agents run on the same machine. If they're
   not, you'll end up creating a CACHE directory for every VM / bare metal
   that runs your go-agents. Which may / may not be ideal depending on your
   infrastructure setup. There're some consequences you should be aware of if
   you're running go-agents in a container.

I guess the same analogy can be applied to any language and their
respective type of artifacts.

On Wed, May 24, 2017 at 3:12 AM, Hugh Acland <[email protected]> wrote:

> Hi
>
> I am building a Node app in a pipeline using "npm install". This fetches
> all dependencies listed in the package.json file and stores them relative
> to the project base.
>
> Is there a way to clean a pipeline directory and re-use so that the build
> job does not have to run npm install each time?
>
> I guess one way would be to have a previous pipeline do the "npm install"
> and only run it when the package.json is changed, and then have the main
> pipeline just copy across the whole directory containing dependencies.
>
> Is there a more canonical way to deal with dependencies? NB, I guess this
> also goes for other languages such as JAR files etc.
>
> Many thanks
> regards
> Hugh
>
> --
> 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 [email protected].
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Ashwanth Kumar / ashwanthkumar.in

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to