Make artifacts and repository optional during a stage
Continuing from gitlab-ce#19505, I think it would be great to be able to make artifacts downloading and even repository checkout optional at certain stages of CI.
For instance our current workflow uses two runners:
- a docker runner on the same host as gitlab
- a shell runner on a remote server
The first runner is responsible for building, testing, ... and the second for deploying. The way we deploy (via docker) makes any artifacts between build/test and deploy. The repository is not even needed either as we only run some docker or ssh commands.
Making the artifacts from the build optional would prevent the deploy runner from downloading the code 3 times (git, artifacts and docker image). Currently we avoided the issue by not using artifacts and having a large build step but I'd love to separate a bit more this stage.
Using caches does not really alleviate the problem because, theoretically, we're supposed to not rely on the cache being present. Meaning we should run the build code at each stage, defeating the purpose.