Difference between revisions of "IT-SDK-Jenkins"

From wiki.samerhijazi.net
Jump to navigation Jump to search
Line 2: Line 2:
 
* src: https://jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables
 
* src: https://jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables
  
'''shell
+
<pre class="code">
 +
def username = 'Jenkins'
 +
echo 'Hello Mr. ${username}'
 +
echo "I said, Hello Mr. ${username}"
 +
...
 +
Hello Mr. ${username}
 +
I said, Hello Mr. Jenkins
 +
</pre>
 +
 
 +
<pre class="code">
 
environment {
 
environment {
 
APP = "${env.APP}-${env.BRANCH_NAME}"
 
APP = "${env.APP}-${env.BRANCH_NAME}"
Line 9: Line 18:
 
sh 'echo New ${APP}'   
 
sh 'echo New ${APP}'   
 
}
 
}
'''
+
</pre>

Revision as of 11:33, 20 March 2020

def username = 'Jenkins'
echo 'Hello Mr. ${username}'
echo "I said, Hello Mr. ${username}"
...
Hello Mr. ${username}
I said, Hello Mr. Jenkins
environment {
	APP = "${env.APP}-${env.BRANCH_NAME}"
}
steps {
	sh 'echo New ${APP}'  
}