github kimdre/doco-cd v0.135.0

one hour ago

What's Changed

Note

Stacks with job services scaled to zero (for example Swarm jobs with deploy.replicas: 0) redeploy once after the upgrade, because their project hash now includes the job labels.

Swarm self-updates are no longer recorded as failed deployments

When doco-cd deployed the Swarm stack that contains itself, the rolling update stopped the old instance while it still waited for convergence. The update worked, but the deployment was recorded as failed, counted as a deployment error, and the next deployment of the stack started with a retry.

doco-cd now updates its own service last and treats the expected shutdown as a handover:

  • The new instance completes the original commit status or GitHub Check after the stack converges and the new instance is healthy.
  • Rollbacks, paused updates, and confirmation timeouts are still reported as failures.
  • Pending reports are stored in a Docker config, so reporting survives task replacement, rollback, and relocation to another node.

Confirmation requires a compatible doco-cd instance with Swarm manager access. Until one runs, the report waits. Compose handovers now also retry the final status report without blocking startup.

See Self-Updating -> Failure handling.

Fewer Compose self-updates

A deployment of the stack that contains doco-cd always replaced the doco-cd container, even when the commit only changed another service. doco-cd now hands over only when its own service must be recreated:

  • The Compose config hash changed or is missing.
  • The image digest changed.
  • The scale is not 1.
  • An attached network must be recreated.
  • Recreation is forced.

Custom labels, such as a commit SHA, are not part of the config hash and do not cause a handover on their own.

A deployment that collides with an active handover of the same stack also no longer opens a second GitHub Check that hides the result of the new instance. A check that this run already opened is closed as skipped.

Swarm image pruning removes unused digest-only images

With the containerd image store (the default for new Docker 29 installations), Swarm pulls service images by digest. These images keep a repo@digest name and are never dangling, so prune_images left every replaced image on the nodes.

The prune job now also removes unused images whose only name is a digest reference. It keeps images that:

  • Any container uses, running or stopped.
  • Were pulled within the last hour.
  • Also have a tag or a digest reference in another repository.

Swarm keeps replaced tasks as task history for rollbacks, and those tasks keep their images in use. To free these images on the next prune, lower the task history limit on a manager node:

docker swarm update --task-history-limit 1

See Swarm Mode -> Image pruning.

Job label changes on scaled-to-zero services trigger a redeployment

Label-only changes to cd.doco.job.* on a job service scaled to zero were skipped with deployment skipped. The scheduler kept the old job configuration, so a new setting such as cd.doco.job.timeout was never applied. These changes now trigger a redeployment that updates the scheduler without starting the job. Services scaled to zero without job labels are still ignored for change detection.

🌟 Improvements

  • fix(selfupdate): confirm Swarm rolling-update handovers by @kimdre in #2197
  • fix(docker): skip self-update when the doco-cd service is unchanged by @casperbiering in #2182
  • fix(swarm): remove unused digest-only images when pruning by @somaz94 in #2175
  • fix(self-update): avoid a second handover check by @casperbiering in #2186

🐛 Bug Fixes

  • fix(docker): include scale-zero job services in project hash by @kimdre in #2200

📦 Dependencies

  • fix(deps): update module github.com/moby/moby/client to v0.6.3 by @renovate[bot] in #2195
  • fix(deps): update module github.com/aws/aws-sdk-go-v2/service/secretsmanager to v1.51.0 by @renovate[bot] in #2196
  • fix(deps): update module github.com/prometheus/common to v0.74.0 by @renovate[bot] in #2198
  • fix(deps): update aws-sdk-go-v2 monorepo by @renovate[bot] in #2201
  • fix(deps): update module github.com/docker/cli to v29.10.0+incompatible by @renovate[bot] in #2202
  • chore(config): migrate Renovate config by @renovate[bot] in #2203
  • chore(deps): update docker:29-dind docker digest to 4bbc722 by @renovate[bot] in #2204
  • chore(deps): update dependency zensical to v0.1.2 by @renovate[bot] in #2205
  • chore(deps): update actions/setup-go action to v7.1.0 by @renovate[bot] in #2207
  • fix(deps): update module github.com/docker/compose/v5 to v5.7.2 by @renovate[bot] in #2206
  • fix(deps): update module github.com/compose-spec/compose-go/v2 to v2.17.0 - abandoned by @renovate[bot] in #2208

New Contributors

Full Changelog: v0.134.0...v0.135.0

Don't miss a new doco-cd release

NewReleases is sending notifications on new releases.