Automatically building if dependency changes

nodejs

#1

Hi. I have a bunch of node modules that all depend upon a library we’ve created (also packaged as a node module). What I’d like to do is kick off a rebuild of all of my modules if the library that they depend upon changes. Is there a good way to do this?

Cheers,
Eric


#2

Calling the ‘trigger a new build’ API call for each of the packages is probably the best way

https://circleci.com/docs/api/#new-build

You can set it to call from the https://circleci.com/docs/configuration/#deployment section of the library’s circle.yml file, passing the API token for the other projects in as an env variable via the project settings.


#3

We solved a similar problem at my company with https://github.com/paperg/cinderblock. It essentially uses the circle API to allow one project to trigger another’s build, and also let it update the commit status on the original triggering commit so you can see that the build will pass before merging through GitHub.

It’s not exactly your scenario but feel free to use/reuse parts of this project to get things done =)


#4

Thanks for the input, everyone. This is a big help.

Cheers,
Eric


#5