balteo balteo - 4 months ago 39
Node.js Question

Multiple CircleCI machines/builds (nodejs + java/gradle)

I have a java application built with Gradle on CircleCI.

I need to be able to build and test a nodejs client module before it is packaged as a jar bundled with the main java app.

The client module is located within a sub-directory i.e.

/myapp-client
.

Here are roughly the steps I currently have in my bash shell:


  • Changes directory into the sub-directory and downloads the npm dependencies:



cd ./myapp-client && npm install



  • Changes directory and test the module:



cd ./myapp-client && node_modules/.bin/ng test



  • Changes directory and builds the module:



cd ./myapp-client && node_modules/.bin/ng build -prod


Can you please provide guidelines as to how to achieve that with CircleCI?

Can I have a CircleCI machine/build based upon both java and nodejs?

Answer

All of those commands you've mentioned you can run from circle.yml: https://circleci.com/docs/configuration/

A build on CircleCI happens within a container. Both Java, NodeJS, and other languages are already pre-installed for your use.

Depending on your needs, you can also build the client module as a separate project.

Comments