title: Does the jenkinsfile's repo have to be reachable form a worker agent?
body: <p>I have a local git repo with the following Jenkinsfile: </p>
  
  <pre><code>pipeline {
    agent none           
    stages {
      stage('hello') {
        agent { label 'aws' }
        steps {
              echo "HELLO"
        }
      }
    }
  }
  </code></pre>
  
  <p>The repo is fine and accessible by Jenkins master, so jobs starts running fine. However, when it hits the stage (assigned to an 'aws' node), it fails because it's not reachable from there- the node is a different network.
  If I paste the pipeline in the job config as an inline script, it works fine.
  I don't see why Jenkins is trying to clone the Jenkinsfile's repo on a remote node - is there any way to avoid that?</p>
  
  <p>I tried with and without "Lightweight checkout", still getting the same failure:</p>
  
  <pre><code>Obtained hello.jenkinsfile from git /home/inger/localci
  Running in Durability level: MAX_SURVIVABILITY
  [Pipeline] Start of Pipeline
  [Pipeline] stage
  [Pipeline] { (hello)
  [Pipeline] node
  Running on EC2 (MyAWS) - test-image (i-09de5ed33de7637e5) in /home/ubuntu/workspace/hello
  [Pipeline] {
  [Pipeline] checkout
  No credentials specified
  Fetching changes from the remote Git repository
   &gt; git rev-parse --is-inside-work-tree # timeout=10
  ERROR: Error fetching remote repo 'origin'
  hudson.plugins.git.GitException: Failed to fetch from /home/inger/localci
      at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:908)
  ...        ..
  stderr: fatal: '/home/inger/localci' does not appear to be a git repository
  fatal: Could not read from remote repository.
  
  Please make sure you have the correct access rights
  and the repository exists.
  ....
  [Pipeline] }
  [Pipeline] // node
  [Pipeline] }
  [Pipeline] // stage
  [Pipeline] End of Pipeline
  ERROR: Error fetching remote repo 'origin'
  Finished: FAILURE
  </code></pre>