title: Define global environment variables from inside a stage
body: <p>I have env vars defined in my environment directive at the top of the pipeline:</p>
  
  <pre><code>environment {
      var1 = 'sdfsdfdsf'
      var2 = 'sssssss'
  }
  </code></pre>
  
  <p>But there are some that I need to dynamically set or override in the stages. But if I use an environment{} directive in a stage the vars won't be accessible to other stages. Initially I thought I could define them all with default values in the top environment directive and overwrite them in the pipeline but this is the behavior I observed:</p>
  
  <ol>
  <li>Define var in environment block</li>
  <li>Try to overwrite in script{} block like: <code>script {env.var1 = 'new value'}</code></li>
  <li>The env is not overwritten</li>
  </ol>
  
  <p>How can I change the envs?</p>