title: Jenkinsfile Environment variable does not reflect in the Makefile called within the script section
body: <p>I have the below jenkins file, I am trying to print the environment variable, defined in the jenkins file, in the make file. But, it does not reflect in the make file. it remains empty.</p>
  
  <pre><code>pipeline {
    environment {
        CREDS = credentials('some jenkins credential id')
    }
    agent{
       kubernetes {
          label 'mypod'
          containerTemplate {
              name 'ubuntu'
              image 'ubuntu:16.04'
              ttyEnabled true
              command 'cat'
          }
      }
    }
    stages{
        stage('execute Makefile'){
           script{
             sh"""
               make print-jenkinsfile-env-var
  
               echo ${CREDS_USR}
               echo ${CREDS}
  
              """
           }
  
        }
    }
  }
  </code></pre>
  
  <p>Below is my Makefile:</p>
  
  <pre><code>usercred := $(CREDS)
  export usercred
  username := $(CRED_USR)
  export username
  testuser := 'newvar'
  export testuser
  print-jenkinsfile-env-var:
       @echo "$$usercred"
       @echo "$$username"
       @echo "$$testuser"
  </code></pre>
  
  <p>Suggested edit in the make file, it did not print either.</p>
  
  <pre><code>usercred := $(CREDS)
  export usercred
  username := $(CRED_USR)
  export username
  testuser := 'newvar'
  export testuser
  print-jenkinsfile-env-var:
       @echo $(usercred)
       @echo $(username)
       @echo "$$testuser"
  </code></pre>
  
  <p>Testuser gets printed, as it was defined in the Makefile, but the other two variables printed empty.
  I am able to print the env vaiables in the script section explicitly, but not though the makefile.</p>
  
  <p>I am looking for the below to work</p>
  
  <pre><code>push-package:
  #tgz file creation step
  #push the package 
  @curl -u $(CREDS) -X PUT "jfrog artifactory repo url" -T *tgz
  </code></pre>
  
  <p>But, my Makefile does not get the value for $(CRED) that is there in the Jenkins file environment. However, I can execute the same script like below in the Jenkinsfile</p>
  
  <pre><code>curl -u ${CREDS} -X PUT "jfrog artifactory repo url" -T *tgz
  </code></pre>
  
  <p>Can someone suggest?</p>