Microservices deployment

We have few services that talk to each other. Whenever a commit happens in one of the services, we wanna

  • Run unit tests of the service
  • Build the service
  • Deploy the service in QA environment
  • Run the integration tests which test the functionality as a whole across services
  • Deploy to staging.

There’re requirements like

  • Queue the deployment to QA env, if there’s integration-tests running

It’s somewhat similar to http://arojgeorge.ghost.io/content/images/2014/Aug/Pipeline-dependency.png

With circle-ci we have workflows. But that’s tied to one repository.

What is the best way or workaround to achieve the pipeline which is generic across multiple repos I’m talking about? Thoughts?

You could do the following:

  1. Have each one of your microservices in their own workflow which does unit tests, build service, deploy to QA, THEN kick off the workflow below using this: https://circleci.com/docs/2.0/api-job-trigger/#starting-jobs-with-the-api
  2. Have ONE separate workflow for the acceptance/QA environment which runs the integration tests and then deploys to staging, etc.

General best practice of microservices is each of them should be independently deployable, so IF you used the above workflow you’d have to do some additional hacking to push the microservice which submitted the code update in step 1 to production.