[英]Bitbuckets Pipelines create a step with parallel steps
I want to have one step, that will setup everything and then in parallel run other steps.我想要一个步骤,它将设置所有内容,然后并行运行其他步骤。 Currently I have something like this:
目前我有这样的事情:
image: python:3.9.16-alpine
pipelines:
default:
- step:
runs-on:
- self.hosted
- regressiontests
name: First Step
clone:
enabled: false
caches:
- pip
script:
- apk add git
- apk add openssh-client
- git clone myrepository.git
- pip install -r myrepository/requirements.txt
- echo $ENV_FILE | base64 -d -i > myrepository/.env
artifacts:
- myrepository/**
- step:
runs-on:
- self.hosted
- regressiontests
name: Second Step
clone:
enabled: false
caches:
- pip
script:
- cd myrepository
- pip install -r requirements.txt
parallel:
- step:
name: Step 2.1
script:
- python fancy command 1
- step:
name: Step 2.2
script:
- python fancy command 2
- step:
name: Step 2.3
script:
- python fancy command 3
- step:
name: Step 2.4
script:
- python fancy command 4
But the only steps that I see is First Step and Second Step none of parallel steps is executed in pipelines但是我看到的唯一步骤是第一步和第二步没有并行步骤在管道中执行
image: python:3.9.16-alpine
pipelines:
default:
- step:
name: First Step
script: []
- step:
name: Second Step
script: []
- parallel:
- step:
name: Step 3.1
script: []
- step:
name: Step 3.2
script: []
# ...
This what I think you are trying to achieve这就是我认为你正在努力实现的目标
BUT但
Therefore I am afraid your whole effort to speed up your steps setup is futile.因此,恐怕您为加快步骤设置所做的全部努力都是徒劳的。
Instead, you'd like to tune your caches.相反,您想调整缓存。 For python you may want to cache both
~/.cache/pip
and a virtualenv so that pip install -r...
instructions are sped up.对于 python,您可能希望同时缓存
~/.cache/pip
和 virtualenv,以便加快pip install -r...
指令的速度。
Plus, I have a feeling that bitbucket artifacts are quite slow so I'd expect disabling the repository clone in every step to be actually slower.另外,我觉得 bitbucket 工件非常慢,所以我希望在每个步骤中禁用存储库克隆实际上会更慢。 I'd use a shallow clone instead with
我会使用浅克隆代替
clone:
depth: 1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.