Spring Team
Marcin Grzejszczak

Marcin Grzejszczak

Spring Cloud Sleuth / Contract / Pipelines

Warsaw, Poland

Author of "Mockito Instant" and "Mockito Cookbook" books. Contributor to several open source projects (including Rest-assured, Drools, Moco, Mockito). Co-author of the Groovy @Builder, "micro-infra-spring", "AccuREST" open source solutions. Author of Uptodate Gradle plugin, Spock subjects-collaborators extension and gradle-test-profiler open source projects. Co-founder of the Warsaw Groovy User Group. Currently working on the Spring Cloud project.
Blog Posts by Marcin Grzejszczak

Spring Cloud Pipelines to Cloud Pipelines Migration

Spring Cloud Pipelines is a GitHub project that tries to solve the following problems:

  • Creation of a common deployment pipeline

  • Propagation of good testing and deployment practices

  • Reducing the time required to deploy a feature to production.

The first commit took place on 31-08-2016. Since then, we have gotten a lot of feedback from the community related to the suggested deployment pipeline and its concrete visualisations. Over those two years, the most important features we have managed to build are:

  • Opinionated deployment pipeline setup

  • Scripts for the pipeline, to verify backward compatibility of your project and allow zero-downtime deployment

  • Support for PHP, .NET, NodeJS, and JVM (Maven & Gradle) projects

  • Deployment option for Cloud Foundry

  • Deployment option for Kubernetes

  • Deployment option via Ansible

  • Pipeline visualisation in Jenkins by using Jenkins Job DSL

  • Pipeline visualisation in Jenkins by using Jenkinsfile

  • Pipeline visualisation in Concourse

We would like to announce the next 1.0.0.M9 release of Spring Cloud Pipelines, which will also be its last in the current form.

Read more...

Spring Cloud Pipelines 1.0.0.M8 Released

On behalf of the Spring Cloud team, it is my pleasure to announce a new milestone release of Spring Cloud Pipelines - 1.0.0.M8.

What’s new?

This release adds a lot of new features and quality and testing improvements. As for main features, we’ve added support for a project with multiple modules, and for mono-repos (projects with standalone application sources in it). As for quality and testing, we’re approaching 200 Bash tests (we’ve written missing tests for the Concourse pipeline). We’ve started publishing the project’s sources as a downloadable artifact. That way instead of cloning the repo or downloading the ~25mb archive, you can fetch around 150kb of sources. The docs for 1.0.0.M8 are available here

From now on, we’re attaching the distributions in tar.gz and zip formats, with sources only to each release.

Thanks

Super special thanks go to the one and only @ciberkleid for all her hard work on the project (look at that!!! - #130) and to @jugglinhats (#148) Kudos Cora and Oleg and everybody involved in the project!

Read more...

Spring Cloud Contract in a polyglot world

This article contains a short reminder of what Contract Testing is, how Spring Cloud Contract implements it, and how Spring Cloud Contract can be used in a polyglot world.

What is Contract Testing

In order to increase the certainty that our systems behave properly, we write different types of tests. According to the test pyramid the main types of tests are unit, integration, and UI. The more complex the tests, the more time and effort they require and the more brittle they become.

In a distributed system, one of the most frequent problems is testing integrations between applications. Let’s assume that your service sends a REST request to another application. When using Spring Boot, you can write a @SpringBootTest in which you test that behavior. You set up a Spring context, you prepare a request to be sent…​ and where do you send it? You haven’t started the other application, so you get a Connection Refused exception. You can try mocking the real HTTP call and returning a fake response. However, if you do that, you do not test any real HTTP integration, serialization and deserialization mechanisms, and so on. You could also start a fake HTTP server (for example, WireMock) and simulate how it should behave. The problem here is that you, as a client of an API, define how the server behaves. In other words, if you tell the fake server to return text testText when a request is sent to endpoint /myEndpoint, it does just that, even if the real server does not have such an endpoint. In short, the problem is that the stubs might not be reliable.

Read more...

Spring Cloud Pipelines 1.0.0.M7 Released

On behalf of the Spring Cloud team, it is my pleasure to announce a new milestone release of Spring Cloud Pipelines - 1.0.0.M7.

What’s new?

This release adds a lot of new features and quality and testing improvements. As for main features, we’ve added Kubernetes support for Jenkins and Concourse. As for quality and testing, we’ve written over 150 Bash tests, added Shellcheck, EditorConfig and written more Jenkins tests. We’ve also unified the project’s documentation that now can be available for each milestone under Spring Cloud Static gh-pages. The docs for 1.0.0.M7 are available here - http://cloud.spring.io/spring-cloud-static/spring-cloud-pipelines/1.0.0.M7/

Read more...

Spring Cloud Pipelines 1.0.0.M6 Released

On behalf of the Spring Cloud team it is my pleasure to announce a new milestone release of Spring Cloud Pipelines - 1.0.0.M6.

What’s new?

Pipeline descriptor

Each application can contain a file called pipeline.yml with the following structure:

lowercaseEnvironmentName1:
    services:
        - type: service1Type
          name: service1Name
          coordinates: value
        - type: service2Type
          name: service2Name
          key: value
lowercaseEnvironmentName2:
    services:
        - type: service3Type
          name: service3Name
          coordinates: value
        - type: service4Type
          name: service4Name
          key: value

For a given environment we declare a list of infrastructure services that we want to have deployed. Services have

  • type (example: eureka, mysql, rabbitmq, stubrunner) - this value gets then applied to the deployService Bash function

  • name - name of the service to get deployed

  • coordinates - coordinate that allows you to fetch the binary of the service. Examples: It can be a maven coordinate groupid:artifactid:version, docker image organization/nameOfImage, etc.

  • arbitrary key value pairs - you can customize the services as you wish

The stubrunner type can also have the useClasspath flag turned on to true or false.

Example:

test:
  services:
    - type: rabbitmq
      name: rabbitmq-github-webhook
    - type: mysql
      name: mysql-github-webhook
    - type: eureka
      name: eureka-github-webhook
      coordinates: com.example.eureka:github-eureka:0.0.1.M1
    - type: stubrunner
      name: stubrunner-github-webhook
      coordinates: com.example.eureka:github-analytics-stub-runner-boot-classpath-stubs:0.0.1.M1
      useClasspath: true
stage:
  services:
    - type: rabbitmq
      name: rabbitmq-github
    - type: mysql
      name: mysql-github
    - type: eureka
      name: github-eureka
      coordinates: com.example.eureka:github-eureka:0.0.1.M1

When the deployment to test or deployment to stage occurs, Spring Cloud Pipelines will:

  • for test environment, delete existing services and redeploy the ones from the list

  • for stage environment, if the service is not available it will get deployed. Otherwise nothing will happen

Release Notes

You can click here to see the Release Notes for more information about what’s been done for this milestone.

Read more...

Spring Cloud Pipelines 1.0.0.M5 Released

On behalf of the Spring Cloud team it is my pleasure to announce a new milestone release of Spring Cloud Pipelines - 1.0.0.M5.

What’s new?

With 1.0.0.M5 we’ve added a new step in the Build stage called API Compatibility check. Now, your pipeline can break when, as a HTTP / messaging producer, you’re doing a backward incompatible change. We’re checking what were the latest contracts you’ve defined for your most recent production deployment and from those contracts we’re generating tests to your current application.

API Compatibility check

You can read more about this feature in Spring Cloud Pipelines Docs

Also, the one and only Ryan Baxter, has added support for GPG keys in Jenkins.

Read more...

Spring Cloud Pipelines 1.0.0.M4 Released

On behalf of the Spring Cloud team it is my pleasure to announce a new milestone release of Spring Cloud Pipelines - 1.0.0.M4.

What’s new?

Apart from some bug and documentation fixes it contains a community feature done by Łukasz Szczęsny with support for Jenkins Declarative Pipeline with Blue Ocean. This is how it looks like

Production deployment

You can read more about this feature in Spring Cloud Pipelines Docs

Read more...

Spring Cloud Pipelines 1.0.0.M3 Released

On behalf of the Spring Cloud team it is my pleasure to announce a new milestone release of Spring Cloud Pipelines - 1.0.0.M3.

What’s new?

Apart from some bug and documentation fixes it’s providing an out of the box support for blue green deployment on Cloud Foundry (both for Concourse and Jenkins)! This is how we do it.

Production deployment

When you click deploy to prod

  • we’re renaming the current instance of the app e.g. fooService to fooService-venerable

  • we’re deploying the new instance of the app under the fooService name

  • now two instances of the same application are running on production

When you click on the Complete switch over step:

  • we’re deleting the old instance (fooService-venerable)

Important
Remember to run this step only after you have confirmed that both instances are working fine!
Read more...

Spring Cloud Camden.SR5 is available

On behalf of the team, I am pleased to announce that Service Release 5 of the Spring Cloud Camden Release Train is available today. The release can be found in our Spring Release repository and Maven Central. The documentation can be found here.

Included in this release is the Spring Boot 1.5 compatibility of all the Spring Cloud projects. Other than the addition of Spring Cloud Task, this release includes primarily bug fixes.

NOTE: This release is not compatible with Spring Boot 1.3. In other words your Spring Boot 1.3 application will not work with Camden.SR5.

Read more...

Spring Cloud Pipelines 1.0.0.M2 Released

On behalf of the Spring Cloud team it is my pleasure to announce a new milestone release of Spring Cloud Pipelines - 1.0.0.M2. Apart from some bug fixes it’s providing an out of the box support for Gradle projects.

In order for the Gradle project to work out of the box the following opinionated decisions were taken:

  • usage of Gradlew Wrapper

  • custom deploy task is used for artifacts deployment

  • running smoke tests on a deployed app via the custom smoke task

  • running end to end tests on a deployed app via the custom e2e task

  • custom groupId task to retrieve group id

  • custom artifactId task to retrieve artifact id

  • custom currentVersion task to retrieve the current version

  • custom stubIds task to retrieve list of collaborators for which stubs should be downloaded

Read more...