test after build would run in new environment on gitlab-ci

空扰寡人 提交于 2019-12-04 00:52:25

Gitlab CI jobs supposed to be independent, because they could run on different runners. It is not issue. There two ways to pass files between stages:

  • The right way. Using artefacts.
  • The wrong way. Using cache. With cache key "hack". Still need same runner.

So yes, supposed by gitlab way to have everything your job depends on in before script.

Artifacts example:

  artifacts:
   when: on_success
   expire_in: 1 mos
   paths:
    - some_project_files/

Cache example:

cache:
  key: "$CI_BUILD_REF_NAME"
  untracked: true
  paths:
   - node_modules/
   - src/bower_components/

For correct running environment i suggest using docker with image containing apt-get dependencies. And use artefacts for passing job results between jobs. Note that artefact also uploaded to gitlab web interface and being able to download them. So if they are quite heavy use small expire_in time, for removing them after all jobs done.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!