Aseem Kishore
Aseem Kishore

Reputation: 10868

Continuous integration + "deployment" of npm modules?

Scenario:

I want to similarly continuously integrate + "deploy" (i.e. make available to the app) these modules, on every commit to their master (or w/e branch):

I've investigated a number of options, but can't find any simple way to achieve all three of these goals!

Is there any way? Thanks!

Upvotes: 2

Views: 941

Answers (1)

Aseem Kishore
Aseem Kishore

Reputation: 10868

One option that comes to mind, though it would need to be manually implemented, would be to update a branch (named e.g. stable or tested or w/e) on Travis after_success (sort of like a manual deploy hook).

Then, you could freely commit to master, but this other branch would only contain commits that passed CI. This'd allow you to point npm at this branch, e.g. foo.git#stable. And if you updated via a non-force git push, you're guaranteed that this branch would only contain ffwd commits.

You'd need to make GitHub user creds available to the script, e.g. via secure env vars, but they can be the same ones that Travis itself uses. I'm not sure if there'll be any other gotchas though. E.g. I assume git is available to Travis scripts.

Upvotes: 1

Related Questions