问题
I'm using the Gitlab-ci-multi-runner, using an OSX machine (bash shell) and a Windows 7 machine (batch commands). Whenever I push I want it to build and test on both runners. But obviously the commands need to be slightly different for each platform. I do not wish to use docker.
I've been looking at http://doc.gitlab.com/ci/yaml/README.html but there doesn't seem to be anything about specific runner coupling for a stage.
回答1:
You can use the tag system for runner.
I suppose that you have two runner. The Windows one with windows as tag and the OS X one with osx as tag.
So, now you can select runner by reclaim tag before running.
The used .gitlab-ci.yml should be like this:
MyWindowsJob:
tags:
- windows
script:
- echo Say hello from windows
MyOSXJob:
tags:
- osx
script:
- uname -a
- echo Say hello from osx
If you will build on more than one version of os you should better add version number in tag. For example:
- OS X v10.9 Mavericks:
osxandosx_v10.9 - OS X v10.10 Yosemite:
osxandosx_v10.10 - OS X v10.11 El Capitan:
osxandosx_v10.11
来源:https://stackoverflow.com/questions/32412248/how-do-i-create-2-jobs-that-run-on-different-platforms