In brief - use the resource_group
directive.
Example:
stages:
- build
jobA:
resource_group: jobA
stage: build
script:
- echo HelloA
jobB:
stage: build
script:
- echo HelloB
There are some useful patterns for Resource Group.
resource_group: $CI_ENVIRONMENT_NAME … Limit per environment
resource_group: $CI_JOB_NAME … Limit per job
resource_group: $CI_COMMIT_REF_NAME:$CI_JOB_NAME … Limit per job per branch
resource_group: $CI_COMMIT_REF_NAME:$CI_ENVIRONMENT_NAME … Limit per environment per branch (e.g. review apps)
Source Gitlab issue 15536