I have a fairly simple terraform deployment pipeline with 4 jobs. 2 of them run terraform apply
on commits to UAT
and master
branches respectively. 2 of them run terraform plan
on PR's that target those branches.
Is there a way to configure groups of jobs to run in serial? I know I can enforce serial execution of a single job, but I want to group the commit to branch and PR to branch jobs and enforce serial execution.
Yes, there's a feature called serial_groups that does this. You can tag your jobs with a list of groups, and inside the pipeline, only one job with a given tag can run at a time.