Skip to content
Latchkey

How to Deploy to Multiple Regions in Parallel in Jenkins

A parallel block deploys to each region simultaneously, so total time is the slowest region, not their sum.

Wrap one deploy branch per region in a parallel block. Each branch runs the same deploy with a different region argument, and the stage waits for all to finish.

Steps

  • Define a parallel block inside the deploy stage.
  • Add one branch per region with its region argument.
  • The stage completes when all regional deploys finish.

Pipeline

Jenkinsfile
pipeline {
  agent any
  stages {
    stage('Deploy regions') {
      parallel {
        stage('us-east-1') { steps { sh './deploy.sh --region us-east-1' } }
        stage('eu-west-1') { steps { sh './deploy.sh --region eu-west-1' } }
        stage('ap-south-1'){ steps { sh './deploy.sh --region ap-south-1' } }
      }
    }
  }
}

Gotchas

  • By default one failing branch fails the whole stage; add failFast true to stop the rest early.
  • Each parallel branch needs an available executor, so size the agent pool accordingly.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →