For the demo purposes we’re providing Docker Compose setup with Artifactory and Concourse / Jenkins tools. Regardless of the picked CD application for the pipeline to pass one needs either
Eureka
for Service DiscoveryStub Runner Boot
for running Spring Cloud Contract stubs.Tip | |
---|---|
In the demos we’re showing you how to first build the |
In this step we’re generating a version of the pipeline, next we’re running unit, integration and contract tests. Finally we’re:
During this phase we’re executing a Maven
build using Maven Wrapper or a Gradle
build using Gradle Wrapper
, with unit and integration tests. We’re also tagging the repository with dev/${version}
format. That way in each
subsequent step of the pipeline we’re able to retrieve the tagged version. Also we know
exactly which version of the pipeline corresponds to which Git hash.
Once the artifact got built we’re running API compatibility check.
Here we’re
Eureka
infrastructure application to PaaSTip | |
---|---|
Currently due to port constraints in Cloud Foundry
we cannot run multiple stubbed HTTP services in the cloud so to fix this issue we’re running
the application with |
stubrunner.ids
property that contains
all the groupId:artifactId:version:classifier
notation of dependant projects for which
the stubs should be downloaded.Stub Runner Boot
and pass the extracted stubrunner.ids
to it. That way
we’ll have a running application in Cloud Foundry that will download all the necessary stubs
of our applicationsmoke
profile. In the
case of GitHub Analytics
application we’re triggering a message from the GitHub Webhook
application’s stub, that is sent via RabbitMQ to GitHub Analytics. Then we’re checking if
message count has increased.prod/${version}
tag. If there is no such tag
(there was no production release) there will be no rollback tests executed. If there was
a production release the tests will get executed.smoke
tests against the freshly deployed application surrounded by stubs.
If those tests pass then we have a high probability that the application is backwards compatibleHere we’re
Eureka
infrastructure application to PaaSNext we have a manual step in which:
e2e
profile. In the
case of GitHub Analytics
application we’re sending a HTTP message to GitHub Analytic’s endpoint. Then we’re checking if
the received message count has increased.The step is manual by default due to the fact that stage environment is often shared between teams and some preparations on databases / infrastructure have to take place before running the tests. Ideally these step should be fully automatic.
The step to deploy to production is manual but ideally it should be automatic.
Important | |
---|---|
This step does deployment to production. On production you would assume
that you have the infrastructure running. That’s why before you run this step you
must execute a script that will provision the services on the production environment.
For |
Here we’re
prod/${version}
tagfor Cloud Foundry
fooService
to fooService-venerable
fooService
namefor Kubernetes
fooService
fooService-1-0-0-M1-123-456-VERSION
name
equal to app name e.g. fooService
name
label selectorin the Complete switch over
which is a manual step
in the Rollback
which is a manual step
we’re routing all the traffic to the old instance