0

I have the following Gitlab CI conf:

[...]
.e2e-config-template: &e2e-config-template
  stage: e2e-test
  needs: ['setup-project']
  interruptible: true
  image: xxx/xxx/...
  allow_failure: false
  tags:
    - private
  rules:
    - if: "$CI_MERGE_REQUEST_IID != null && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == 'master'"
      when: always
    - when: manual

e2e 1/4:
  <<: *e2e-config-template
  script:
    - yarn install --check-files
    - echo "127.0.0.1 abc.def.gh" >> /etc/hosts
    - apt install lsof
    - yarn test:e2e --shard=1/4

e2e 2/4:
  <<: *e2e-config-template
  script:
    - yarn install --check-files
    - echo "127.0.0.1 abc.def.gh" >> /etc/hosts
    - apt install lsof
    - yarn test:e2e --shard=2/4
[...]

When the CI is running, I end up with:
enter image description here

The problem is I'm lazy and I have to click on the 4 "Play" buttons each time I want to trigger the E2E tests (which is not always the case).

I'd like to have a "parent" stage that would allow, in just one click, to trigger all 4 E2E jobs.

Is this possible?

1 Answers1

0

You can add:

when: on_success

You can see how this works on the documentation here: https://docs.gitlab.com/ee/ci/yaml/#rules

muhrahim95
  • 121
  • 4