我有一个.gitlab-ci.yml
看起来像这样:
image: "python:3.7"
before_script:
- pip install -r requirements.txt
stages:
- stageA
- stageB
stage_a:
stage: stageA
script:
- run_some_python_scripts
stage_b:
stage: stageB
script:
- run_more_python_scripts
通过这种设置,在每个阶段之前都会安装requirements.txt
。
我只需要安装一次,这样stageA
和stageB
都可以使用
我怎样才能做到这一点
我发现,如果
requirements.txt
文件没有太大变化,那么将其烘焙到您自己的Docker映像中是一个很好的选择我个人不太喜欢的另一种选择是使用
virtualenv
,然后在virtualenv
上使用GitLab的cache,但是如果有很多pip
包,这可能会有点慢相关问题 更多 >
编程相关推荐