Answers: <p>Considering that plugin hasn't been updated in 7 years, it almost certainly doesn't have Pipeline support - Pipelines were likely either nonexistent or not widely used last time that plugin received an update.</p>
  <p>You can still try to use it in a Pipeline job.  Jenkins has a <a href="https://www.jenkins.io/doc/book/pipeline/getting-started/#snippet-generator" rel="nofollow noreferrer">snippet generator feature</a> to automatically generate Pipeline code using Freestyle job steps in the web UI.  However there is no guarantee that the Pipeline code output by this tool will work identically to the equivalent Freestyle configuration.</p>
  
Answers: CC BY-SA 4.0
Answers: 2022-04-04T18:02:59.930Z
Answers: 2022-04-04T18:02:59.930Z
Answers: jayhendren
Body: <p>I want to use the <a href="https://plugins.jenkins.io/shared-workspace/" rel="nofollow noreferrer">Shared Workspace</a> plugin, so I set up the following key/value pair in my <code>Manage Jenkins -&gt; Configure System -&gt; Workspace Sharing</code></p>
  <pre><code>Name: sandbox-workspace
  Repository URL: git@bitbucket.org:mycompany/myrepo.git
  </code></pre>
  <p>Now I want to share the above workspace between two separate pipeline jobs <code>Job1</code> and <code>Job2</code>, where <code>Job1</code> triggers <code>Job2</code> so they're guaranteed to never run concurrently. Each job may/can run on different nodes. What is the pipeline syntax for using the above shared workspace?</p>
  
Tags: <jenkins><jenkins-pipeline>
Title: How to use the Shared Workspace plugin in a Jenkins pipeline?
UserDisplayName: Chris F
ThreadText: # How to use the Shared Workspace plugin in a Jenkins pipeline?
  
  (Asked by: username_0 on 2022-04-02)
  
  I want to use the [Shared Workspace](https://plugins.jenkins.io/shared-workspace/) plugin, so I set up the following key/value pair in my `Manage Jenkins -> Configure System -> Workspace Sharing`
  
  ```
  Name: sandbox-workspace
  Repository URL: git@bitbucket.org:mycompany/myrepo.git
  
  ```
  
  Now I want to share the above workspace between two separate pipeline jobs `Job1` and `Job2`, where `Job1` triggers `Job2` so they're guaranteed to never run concurrently. Each job may/can run on different nodes. What is the pipeline syntax for using the above shared workspace?
  
  **Tags:** jenkins, jenkins-pipeline
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-04-04. Score: 1 | Accepted answer
  
  Considering that plugin hasn't been updated in 7 years, it almost certainly doesn't have Pipeline support - Pipelines were likely either nonexistent or not widely used last time that plugin received an update.
  
  You can still try to use it in a Pipeline job. Jenkins has a [snippet generator feature](https://www.jenkins.io/doc/book/pipeline/getting-started/#snippet-generator) to automatically generate Pipeline code using Freestyle job steps in the web UI. However there is no guarantee that the Pipeline code output by this tool will work identically to the equivalent Freestyle configuration.
  
  
  ---
  
  