Pipeline sequentially per repository

How can we have running one pipeline at the same time per repository ?
For example if I push one commit quickly after another to my repository, pipeline starts for each of those commits and its not good for my case.
I used resource_group but it just work with jobs i think and didn’t resolved my issue.

.gitlab-ci.yml:

stages:
  - test1
  - test2
  - test3

test 1job :
  resource_group: $CI_PROJECT_NAME
  stage: test1
    - echo test1
  only:
      - master
  tags:
    - build

test2job :
  resource_group: $CI_PROJECT_NAME

  stage: test2
  needs:
    - test 1job
  script:
    - echo test2
    - sleep 150s
  only:
      - master
  tags:
    - build

test3job :
  resource_group: $CI_PROJECT_NAME
  stage: test3
  needs:
    - test2job
  script:
    - sleep 150s
  only:
      - master
  tags:
    - build



Gitlab-runner config.toml:

concurrent = 10
check_interval = 1
[[runners]]
  name = "xxxxxxxxxxxxxxxx"
  url = "https://gitlab.com/"
  token = "xxxxxxxxxxxxxxxxxxxxx"
  executor = "shell"
  [runners.cache]

Many repository are using with this runner. so i think can’t change concurrent to 0.
thanks.

I don’t see much either in the documentation, but if your first started pipeline becomes obsolete, you might be able to use the interruptible setting: https://docs.gitlab.com/ee/ci/yaml/#interruptible.

Or, if it’s specifically for this project, you can add another runner with a tag (and maybe let it run only tagged pipelines, that’s up to you), add the tag to your pipeline and set the concurrency of that runner to 1.