BUILD_NUMBER changes to number from dsl.groovy to jenkins job
<p>In our git repo when updated and when dsl.groovy exists, it will create a Jenkins job if it doesn't exists. If it exists, it will overwrite it with whatever we have in dsl.groovy.</p>

<p>I have this code in the dsl.groovy</p>

<pre><code>shell('echo "BUILD_NUMBER=${BUILD_NUMBER}" &gt; log.txt')
</code></pre>

<p>However, when the Jenkins job gets created, it's wrong. It parses the variable name rather than pasting the original code in Execute shell. Here is a screenshot of the jenkins job specifically the Execute shell. <a href="http://imgur.com/CChEA2F" rel="nofollow">http://imgur.com/CChEA2F</a></p>

<p>What am I doing wrong? I really need the value of the BUILD_NUMBER in my unix shell since I use the number as part of directory name that I will create with mkdir (ie. mkdir project_acme_${BUILD_NUMBER} )</p>