title: How to edit a file in Jenkins before building the app?
body: <p>Currently in my Jenkins pipeline script, I have this:</p>
  
  <pre><code>stage ('get_repo'){
  
  checkout([$class: 'GitSCM', 
            branches: [[name: '*/master']], 
            doGenerateSubmoduleConfigurations: false, 
            extensions: [], 
            submoduleCfg: [], 
            userRemoteConfigs: [[credentialsId: 'git', url: 'git@bitbucket.org:myrepo/myrepo.git']]])
  
  }
  stage ('build'){
      bat "npm install @angular-devkit/build-angular"
      bat 'C:\\Users\\user1\AppData\\Roaming\\npm\\ng.cmd build --aot'
  }
  stage ('create artifact'){
   archiveArtifacts 'dist//**'
   }}}
  </code></pre>
  
  <p>What I want to achieve is this:</p>
  
  <ol>
  <li>The repository has a file called env.ts but it has some static ip address. The static ip address is only applicable to one of our branches. I want to be able to edit that env.ts file to contain the correct ip address for that build before running the next stage which is the build stage. I am running this on a windows jenkins node. The file content is like this: </li>
  </ol>
  
  <p>export const environment = {
    apiServer: '<a href="http://1.1.1.1:80" rel="nofollow noreferrer">http://1.1.1.1:80</a>',
    production: true,
    paginationLimit: 10,
  };</p>
  
  <p>I want to change the value of apiServer from 1.1.1.1 to 2.2.2.2</p>
  
  <ol start="2">
  <li>Once the file contents has been changed, i want the file renamed to environment.ts</li>
  </ol>
  
  <p>How do I achieve this?</p>
  
  <p>Thank you in advance!</p>