From: Thanh Ha Date: Thu, 7 Sep 2017 01:15:36 +0000 (+0000) Subject: Merge "Update JJB best practices" X-Git-Tag: v0.10.0~10 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=c30ad0b42bdecae99f6dda1c5847a2197278ef2e;p=releng%2Flftools.git Merge "Update JJB best practices" --- c30ad0b42bdecae99f6dda1c5847a2197278ef2e diff --cc docs/best-practices.rst index 331f9211,534031a5..bf74797e --- a/docs/best-practices.rst +++ b/docs/best-practices.rst @@@ -207,13 -207,15 +207,15 @@@ There are 2 ways to pass parameters int 2) Environment variables in the format ${VAR} We recommend avoiding using method 1 (Pass JJB variables) into shell scripts -and instead always use method 2 (Enviornment variables). This makes +and instead always use method 2 (Environment variables). This makes troubleshooting JJB errors easier and does not require escaping curly braces. - This method requires 2 steps: + This method requires 3 steps: + + 1) Declare a parameter section or inject the variable as properties-content. + 2) Invoke the shell script with `include-raw-escape` instead of `include-raw`. + 3) Use the shell variable in shell script. - 1) Declare a parameter section - 2) Use the parameter in shell script The benefit of this method is that parameters will always be at the top of the job page and when clicking the Build with Parameters button in Jenkins