Reuse workspace from other job in azure pipelines

Viewed 1246

Hi i want to split my build into different jobs. But when i install stuff in the job Installs and Certificats the steps in the build jobs cannot find the installed stuff from the previous jobs.

Is it possible to reuse the workspace created in the previous jobs? Even better would be to use different stages but i dont think this is possible.

jobs:
- job: Certificats
  # install certificates

- job: Installs
  # npm install locally and globally

- job: Build Android
  dependsOn:
  - Certificats
  - Installs
  # Build Android

- job: Build Android
  dependsOn:
  - Certificats
  - Installs
  # Build IOS
1 Answers

The short answer is "no, and that's by design".

Jobs are intended to be isolated so that they can potentially be parallelized. If it's being parallelized, sharing state between jobs leads to race conditions.

Think of this scenario: You want to simultaneously build Android and iOS. For that, you need to run each of those jobs on different agents. If those agents both require NPM install to have run first, then NPM install has to be run on each of them, not once for both.

Related