Shared job prepare for docker executors
Coming from https://gitlab.com/gitlab-org/gitlab-ce/issues/21480#note_120346758, here's the idea:
In my environment, running jobs in parallel loses the winning effect as project setup (git clone, download cache, download artifacts) takes longer than running each job
- git checkout project
- download cache, download artifacts
- run
before_script
(or some new keyword) - commit the resulting workspace as docker image
- run parallel jobs on the same workspace clones (so they can modify state, but that won't be shared)
- run
after_script
- upload cache, upload artifacts
This would work only if the parallel jobs are ran in same docker engine.
Maybe the design should be instead that there's special job, that is ran to setup workspace:
prepare:
tags:
- specific_runner
script: echo prepared
when:
- dependency
job:
tags:
- specific_runner
workspace_setup_job: prepare
parallel: 4
script: echo ${CI_PARALLEL_ITEM}
the workspace_setup_job
is clumsy, but here used to express the idea.
Edited by Elan Ruusamäe