Node.js client-server deployment pipelines on Bluemix

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

On the road learning node.js I stumbled upon the awkwardness of having two engines serving http requests on different paths, say, for example, having calls to /html served by Express and to /api served by hapi.js

Since I’m just testing these frameworks out, I didn’t want to completely separate the source tree into independent repositories, especially because I’d need them to update in lockstep for as long as the client/server API is not stable.

Turns out the Bluemix deployment pipelines offered by hub.jazz.net  are quite flexible, allowing for custom commands to be configured, so I set out to create a split pipeline configuration out of a twin project folder setup.

I started with creating an additional node for the client code:

 

The Server and Client nodes

 

Then I moved all the existing code under a server folder and created a client folder for the client project:

 

The two separate node.js apps
The two separate node.js apps

 

The deployment pipeline allows up to two stages for free, exactly what I needed. I reconfigured the first stage to deploy from the freshly created server folder:

 

Notice the added 'cd server' command in the script
Notice the added ‘cd server’ command in the script

 

And I created a second stage to deploy the client:

 

The added second stage, pushing the client code
The added second stage, pushing the client code

 

Quite simple indeed!

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

Leave a Reply

Your email address will not be published. Required fields are marked *