jobs.deployment.strategy definition

A deployment strategy enables you to configure how the update is delivered.

Properties that use this definition: jobs.deployment.strategy

Properties that use this definition: jobs.deployment.strategy

Properties that use this definition: jobs.deployment.strategy

Properties that use this definition: jobs.deployment.strategy

Overloads

Overload Description
strategy: runOnce Run once deployment strategy.
strategy: rolling Rolling deployment strategy.
strategy: canary Canary deployment strategy.
Overload Description
strategy: runOnce Run once deployment strategy.
strategy: rolling Rolling deployment strategy.
strategy: canary Canary deployment strategy.
Overload Description
strategy: runOnce Run once deployment strategy.
strategy: rolling Rolling deployment strategy.
strategy: canary Canary deployment strategy.
Overload Description
strategy: runOnce Run once deployment strategy.
strategy: rolling Rolling deployment strategy.
strategy: canary Canary deployment strategy.

Remarks

When you're deploying application updates, it's important that the technique you use to deliver the update will:

  • Enable initialization.
  • Deploy the update.
  • Route traffic to the updated version.
  • Test the updated version after routing traffic.
  • In case of failure, run steps to restore to the last known good version.

We achieve this by using lifecycle hooks that can run steps during deployment. Each of the lifecycle hooks resolves into an agent job or a server job (or a container or validation job in the future), depending on the pool attribute. By default, the lifecycle hooks will inherit the pool specified by the deployment job.

Deployment jobs use the $(Pipeline.Workspace) system variable.

If you are using self-hosted agents, you can use the workspace clean options to clean your deployment workspace.

  jobs:
  - deployment: deploy
    pool:
      vmImage: ubuntu-latest
      workspace:
        clean: all
    environment: staging

strategy: runOnce

The runOnce deployment strategy rolls out changes by executing each of its steps one time.

strategy:
  runOnce:  # RunOnce Deployment strategy

Properties

runOnce

jobs.deployment.strategy.runOnce

RunOnce Deployment strategy.

strategy:
  runOnce:  # RunOnce Deployment strategy

Properties

runOnce

jobs.deployment.strategy.runOnce

RunOnce Deployment strategy.

strategy:
  runOnce:  # RunOnce Deployment strategy

Properties

runOnce

jobs.deployment.strategy.runOnce

RunOnce Deployment strategy.

strategy:
  runOnce:  # RunOnce Deployment strategy

Properties

runOnce

jobs.deployment.strategy.runOnce

RunOnce Deployment strategy.

Remarks

runOnce is the simplest deployment strategy wherein all the lifecycle hooks, namely preDeploy deploy, routeTraffic, and postRouteTraffic, are executed once. Then, either on: success or on: failure is executed.

strategy: rolling

A rolling deployment replaces instances of the previous version of an application with instances of the new version of the application on a fixed set of virtual machines (rolling set) in each iteration.

strategy:
  rolling:  # Rolling Deployment strategy

Properties

rolling

jobs.deployment.strategy.rolling

Rolling Deployment strategy.

strategy:
  rolling:  # Rolling Deployment strategy

Properties

rolling

jobs.deployment.strategy.rolling

Rolling Deployment strategy.

strategy:
  rolling:  # Rolling Deployment strategy

Properties

rolling

jobs.deployment.strategy.rolling

Rolling Deployment strategy.

strategy:
  rolling:  # Rolling Deployment strategy

Properties

rolling

jobs.deployment.strategy.rolling

Rolling Deployment strategy.

strategy: canary

Canary deployment strategy rolls out changes to a small subset of servers.

strategy:
  canary:  # Canary Deployment strategy

Properties

canary

jobs.deployment.strategy.canary

Canary Deployment strategy.

strategy:
  canary:  # Canary Deployment strategy

Properties

canary

jobs.deployment.strategy.canary

Canary Deployment strategy.

strategy:
  canary:  # Canary Deployment strategy

Properties

canary

jobs.deployment.strategy.canary

Canary Deployment strategy.

strategy:
  canary:  # Canary Deployment strategy

Properties

canary

jobs.deployment.strategy.canary

Canary Deployment strategy.

Remarks

Canary deployment strategy is an advanced deployment strategy that helps mitigate the risk involved in rolling out new versions of applications. By using this strategy, you can roll out the changes to a small subset of servers first. As you gain more confidence in the new version, you can release it to more servers in your infrastructure and route more traffic to it.

See also