title: Don't want Jenkins Slave to clone repo?
body: <p>My system is set up as a Docker Linux PC Master/BeagleBone Linux Slave, connected via USB SSH. </p>
  
  <p>Essentially, I'm trying to do the following:</p>
  
  <ul>
  <li>Compile code on the master that is taken from a Bitbucket repo.</li>
  <li>Take the compiled binary and transfer it to the BeagleBone (I'm using 'stash' and 'unstash' in my Jenkinsfile to do this)</li>
  <li>Use the binary on the BeagleBone slave to flash another device that is connected to it (the slave, not the master)</li>
  </ul>
  
  <p>When I build from Jenkins, my master clones the repo, builds the code and stashes the binary. However, when I transfer to the 'flash' stage on the slave, it <em>also</em> tries to clone the repo (which fails due to credential problems - that's a separate issue). I don't want it to do this - rather, I want it to just take the newly stashed file and use that to flash the attached hardware, rather than look on the repo for it.</p>
  
  <p>I seemingly can't find an option to prevent this from happening. What can I do to just use the stashed file? If it's not possible with stash, can it be done another way without the slave attempting to clone the repo?</p>
  
  <p>Here's my Jenkinsfile:</p>
  
  <pre><code>pipeline { 
      agent none
      stages {
          stage('Build') {
              agent {
                  label 'master'
              }
              steps {
                  sh 'cd application/.../example &amp;&amp; make'
                  stash includes: 'application/.../example/example.bin', name: 'Flash'
              }
          }
  
          stage('Test of Flash') {
              agent {
                   label 'test_slave'
              }
              steps {
                unstash 'Flash'
                //Flashing step here
                sh 'make check || true'
              }
          }
      }
  }
  </code></pre>
  
  <p>And here's the console log, starting with the master compiling:</p>
  
  <pre><code>obtained Jenkinsfile from 913...
  [Pipeline] stage
  [Pipeline] { (Build)
  [Pipeline] node
  Running on Jenkins in /var/jenkins_home/...
  [Pipeline] {
  [Pipeline] checkout
  Cloning the remote Git repository
  Cloning with configured refspecs honoured and without tags
  Cloning repository git@bitbucket.org:...
  
  //Later, the file compiles:
  Generating binary and Printing size information:...
  //Compiles, then:
  [Pipeline] stash
  Stashed 1 file(s)
  [Pipeline] }
  [Pipeline] // withEnv
  [Pipeline] }
  [Pipeline] // node
  [Pipeline] }
  [Pipeline] // stage
  [Pipeline] stage
  [Pipeline] { (Test of Flash)
  [Pipeline] node
  Running on test_slave in /home/debian/...
  [Pipeline] {
  [Pipeline] checkout  //And it starts to clone the repo here!
  Cloning the remote Git repository
  Cloning with configured refspecs honoured and without tags
  Cloning repository git@bitbucket.org:...
  </code></pre>
  
  <p>I don't want it to do the above. </p>