Gitlab CI: Is it possible to have sequential builds?

Let’s assume we have below settings:

  • 4 stages defined in .gitlab.-ci.yml
  • concurrent = 1 in config.toml

Then we trigger CI by commit 1, the pipeline looks like:

[Commit 1] Running (stage1) - Pending (stage2) - Pending (stage3) - Pending (stage4)

Then we trigger CI by commit 2 while commit 1 build is still running:

[Commit 2] Pending (stage1) - Pending (stage2) - Pending (stage3) - Pending (stage4)
[Commit 1] Running (stage1) - Pending (stage2) - Pending (stage3) - Pending (stage4)

Originally I was expecting Commit 1 - stage2 will be next job to executed. However the pipeline becomes:

[Commit 2]  Running (stage1) - Pending (stage2) - Pending (stage3) - Pending (stage4)
[Commit 1]  Pass    (stage1) - Pending (stage2) - Pending (stage3) - Pending (stage4)

The Commit 2 - stage1 is executed instead of Commit 1 - stage2!
But what I expected is to wait all the stage (job) completed in one build, then start next build.

Does anyone know how to setup sequential builds?