Gitlab CI Different executor per stage

2019-05-30 04:04发布

Is it possible to have 2 stages in gitlab-ci.yml and one to be run with docker runner but the other to be run with shell?

Imagine I want to run tests in a docker container but I want to run deploy stage in shell locally in the container.

1条回答
贪生不怕死
2楼-- · 2019-05-30 04:58

Not exactly stages but you can have different jobs to be run by different runners using tags configuration option which should give you exactly what you want.

Add (either during runner creation or later in Project settings -> Runners) tag docker to the Docker runner and tag shell to the shell runner. Then you can set the tags in your .gitlab-ci.yml file:

stages:
  - test
  - deploy

tests:
  stage: test
  tags:
    - docker
  script:
    - [test routine]

deployment:
  stage: deploy
  tags:
    - shell
  script:
    - [deployment routine]
查看更多
登录 后发表回答