liveBook · Manning

Deployment

As explained in Contract Testing in Action

A deployment is the act or resulting state of installing a particular software version into a runtime environment.

A deployment records a particular software version as available in a runtime environment, such as production. In Pact, recording it tells the contract-testing system which version currently occupies that environment. section 10.2.4 section 10.5

Deployment and release differ in how earlier versions are treated. A deployment marks previous versions as not deployed, so only one version is recorded as deployed. A release leaves earlier versions marked as released, which suits products such as mobile apps where multiple versions remain in use. section 10.2.4

A deployment workflow commonly:

  • Identifies the consumer or provider version with a unique value such as a GitHub commit SHA. section 10.3 section 10.5
  • Records the version against a Pact environment after the deployment completes, commonly restricting the CI step to the main branch. section 10.2.4
  • Uses the recorded deployment when selecting versions for contract verification or checking whether a subsequent version is safe to deploy. section 10.2.4 section 10.5

Recording a production deployment

A CI job can run pact-broker record-deployment for the WebConsumer and MoviesAPI, passing each participant, $GITHUB_SHA, and the production environment. The workflow records these versions after contract tests and displays them as available in production. A later can-i-deploy check can query whether a candidate version has a successful verification result with the version already deployed there. section 10.2.4 section 10.5

"scripts": {
   …
   "record:web:consumer:deployment": 
"pact-broker record-deployment 
--pacticipant WebConsumer --version $GITHUB_SHA 
--environment production",
   "record:provider:deployment": 
"pact-broker record-deployment --pacticipant MoviesAPI 
--version $GITHUB_SHA --environment production"
   …
}

Shows the package scripts that record consumer and provider versions as deployed to production. section 10.2.4

How Contract Testing in Action covers it

How deep it goes
Explains deployment state, contrasts it with release state, and demonstrates Pact commands and workflow placement without detailing runtime installation mechanics.
Examples
Uses WebConsumer, MoviesAPI, production recording scripts, GitHub Actions steps, and GraphQL deployment exercises.
What it assumes
Assumes contract testing, Pact participants, CI/CD workflows, version identifiers, and environments; teaches deployment and release tracking distinctions.
What you can do after
Operate/configure Pact deployment recording and use recorded versions in automated contract verification and can-i-deploy checks.
How it connects
Connects deployment with contract testing, CI/CD pipelines, environments, releases, versioning, branches, webhooks, and can-i-deploy.

Also explained in

Compare how 23 books explain deployment →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Contract Testing in Action. The section links point to the parts of the book it draws on.