title: Jenkins doesn't change directory through sh 'cd directory' command
body: <p>I use mac. I have ios and android projects on react-native and created fastlane scripts for each project. Now I want to automate builds with Jenkins in pipeline, so I have Jenkins file. In work space of Jenkins I have to go to <code>ios</code> folder, and execute fastlane script. </p>
  
  <p>But the problem is that Jenkins doesn't change directory with command <code>sh 'cd ios'</code>. I can see it because I execute <code>pwd</code> command before and after change directory command.</p>
  
  <p>I tried to use symbolic link, run command in my current process with the "dot" command (like <code>sh '. cd ios'</code>), tried to use full path to ios folder. But all of this did not bring success :(</p>
  
  <p>So, why Jenkins doesn't change the directory with <code>sh 'cd ios'</code> command? How can I cope with it ? Thank you in advance.</p>
  
  <p>Here is my script</p>
  
  <pre><code>pipeline {
  </code></pre>
  
  <p>agent any</p>
  
  <p>tools {nodejs "Jenkins_NodeJS"}</p>
  
  <p>stages {</p>
  
  <pre><code>stage('Pulling git repo'){
    steps{
      git(
        url: 'url_to_git_repo',
        credentialsId: 'jenkins_private_key2',
        branch: 'new_code'
      )
    }
  }
  
  stage('Prepare') {
      steps{
        sh 'npm install -g yarn'
        sh 'yarn install'
      }
  }
  
  stage('Building') {
      steps{
        sh 'cd /Users/igor/.jenkins/workspace/MobileAppsPipeline/ios'
        sh 'ls -l'
        sh '/usr/local/bin/fastlane build_and_push'
      }
  }
  </code></pre>
  
  <p>}
  }</p>