Discussion:
Loading properties from a file in Jenkins 2.0 pipeline
j***@bodycad.com
2016-09-07 18:07:50 UTC
Permalink
Not sure about the Java properties file, but I succeed by doing a .groovy
file if that's interest you (probably not, but here it is if someone need
it, it's unsafe but in controlled env it doesn't matter):

*Jenkinsfile*
def my_var = evaluate(new File("myEnv.groovy"));
bat "\"${my_var.python_2_exe}\" myscript.py"
...

*myEnv.groovy*
def rv= [:]

rv['mercurial_url'] = 'http://mercurial.buildserver/'
rv['python_2_exe'] = "c:\\Python27\\python.exe"
...
return rv;

I put the .groovy file on the build machine jenkins folder, so the
Jenkinsfile from the repos can work with vars from any of our build
machines or network emplacement.
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/1a03bb2f-5022-4005-ab10-5e3146aebcd1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Ian Cotton
2016-09-08 09:09:18 UTC
Permalink
Thanks Jerome. Unfortunately this doesn't help me much. The properties file
I need to load already exists and is in use by various build scripts.
I assume I need to create an EnvInjectJobProperty object and set the
appropriate property on it. I'll give that a try.
Post by j***@bodycad.com
Not sure about the Java properties file, but I succeed by doing a .groovy
file if that's interest you (probably not, but here it is if someone need
*Jenkinsfile*
def my_var = evaluate(new File("myEnv.groovy"));
bat "\"${my_var.python_2_exe}\" myscript.py"
...
*myEnv.groovy*
def rv= [:]
rv['mercurial_url'] = 'http://mercurial.buildserver/'
rv['python_2_exe'] = "c:\\Python27\\python.exe"
...
return rv;
I put the .groovy file on the build machine jenkins folder, so the
Jenkinsfile from the repos can work with vars from any of our build
machines or network emplacement.
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/1a03bb2f-5022-4005-ab10-5e3146aebcd1%40googlegroups.com
<https://groups.google.com/d/msgid/jenkinsci-users/1a03bb2f-5022-4005-ab10-5e3146aebcd1%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAHZUCTkzOYmeYK7_NBWvYpiktOxG5%3DJYBeXXjnafZCyJ9Kr1cw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
j***@bodycad.com
2016-09-09 17:16:12 UTC
Permalink
I haven't test it but saw it while checking for something else (zip):
Pipeline Utility Steps
<https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Utility+Steps+Plugin>
https://github.com/jenkinsci/pipeline-utility-steps-plugin/blob/master/docs/STEPS.md

Maybe that's what you're looking for with the readProperties function
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/f9b800c6-8570-43d9-bed4-d001b533105f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Pete Singleton
2016-09-21 15:22:30 UTC
Permalink
Hi, I'm having exactly the same issue (having only started with Jenkins 2.0
in the last couple of days). I've tried the Pipeline Utility, tried the
EnvInject plugin, also tried opening the file using Groovy file operations,
no success! Did you manage to solve this??
Post by Ian Cotton
Thanks Jerome. Unfortunately this doesn't help me much. The properties
file I need to load already exists and is in use by various build scripts.
I assume I need to create an EnvInjectJobProperty object and set the
appropriate property on it. I'll give that a try.
Post by j***@bodycad.com
Not sure about the Java properties file, but I succeed by doing a .groovy
file if that's interest you (probably not, but here it is if someone need
*Jenkinsfile*
def my_var = evaluate(new File("myEnv.groovy"));
bat "\"${my_var.python_2_exe}\" myscript.py"
...
*myEnv.groovy*
def rv= [:]
rv['mercurial_url'] = 'http://mercurial.buildserver/'
rv['python_2_exe'] = "c:\\Python27\\python.exe"
...
return rv;
I put the .groovy file on the build machine jenkins folder, so the
Jenkinsfile from the repos can work with vars from any of our build
machines or network emplacement.
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/1a03bb2f-5022-4005-ab10-5e3146aebcd1%40googlegroups.com
<https://groups.google.com/d/msgid/jenkinsci-users/1a03bb2f-5022-4005-ab10-5e3146aebcd1%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/fcf3de22-08c3-47e2-b996-1d0bd85f28ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Phillip Campbell
2016-09-21 16:12:03 UTC
Permalink
Here's a snippet from a Jenkinsfile in a pre-2.0 pipeline job that I use
to read an existing build.properties file in the workspace so that the
Jenkinsfile can use the properties. I haven't tried this in 2.0 pipeline
yet.

if (!fileExists('build.properties')){ echo 'No
build properties.' exit } def props =
readProperties file: 'build.properties' /* * From build.properties
file */ def Var1= props["SOME_PROPERTY"] def Var2=
props["ANOTHER_PROPERTY"]
Post by Pete Singleton
Hi, I'm having exactly the same issue (having only started with Jenkins
2.0 in the last couple of days). I've tried the Pipeline Utility, tried
the EnvInject plugin, also tried opening the file using Groovy file
operations, no success! Did you manage to solve this??
Post by Ian Cotton
Thanks Jerome. Unfortunately this doesn't help me much. The properties
file I need to load already exists and is in use by various build scripts.
I assume I need to create an EnvInjectJobProperty object and set the
appropriate property on it. I'll give that a try.
Post by j***@bodycad.com
Not sure about the Java properties file, but I succeed by doing a
.groovy file if that's interest you (probably not, but here it is if
*Jenkinsfile*
def my_var = evaluate(new File("myEnv.groovy"));
bat "\"${my_var.python_2_exe}\" myscript.py"
...
*myEnv.groovy*
def rv= [:]
rv['mercurial_url'] = 'http://mercurial.buildserver/'
rv['python_2_exe'] = "c:\\Python27\\python.exe"
...
return rv;
I put the .groovy file on the build machine jenkins folder, so the
Jenkinsfile from the repos can work with vars from any of our build
machines or network emplacement.
--
You received this message because you are subscribed to the Google
Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send
To view this discussion on the web visit https://groups.google.com/d/ms
gid/jenkinsci-users/1a03bb2f-5022-4005-ab10-5e3146aebcd1%
40googlegroups.com
<https://groups.google.com/d/msgid/jenkinsci-users/1a03bb2f-5022-4005-ab10-5e3146aebcd1%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit https://groups.google.com/d/
msgid/jenkinsci-users/fcf3de22-08c3-47e2-b996-1d0bd85f28ed%40googlegroups.
com
<https://groups.google.com/d/msgid/jenkinsci-users/fcf3de22-08c3-47e2-b996-1d0bd85f28ed%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAAYHPVij13azLVN%2BwkQfeGG_ExE6eUqGE1A4cL9Dg-zvwtXK0A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Pete Singleton
2016-09-22 08:11:07 UTC
Permalink
ok thanks, that seems to work as far as reading the properties file, but
then fails when I try to echo the variable:

def props = readProperties file: 'project.properties'
def Var1= props['RELEASE']
def Var2= props['SOFTWARE.VERSION']

echo "Var1=" Var1
echo "Var2=" Var2

java.lang.NullPointerException: Cannot get property 'Var1' on null object
Post by Phillip Campbell
Here's a snippet from a Jenkinsfile in a pre-2.0 pipeline job that I use
to read an existing build.properties file in the workspace so that the
Jenkinsfile can use the properties. I haven't tried this in 2.0 pipeline
yet.
if (!fileExists('build.properties')){ echo 'No build properties.' exit } def props = readProperties file: 'build.properties' /* * From build.properties file */ def Var1= props["SOME_PROPERTY"] def Var2= props["ANOTHER_PROPERTY"]
Post by Pete Singleton
Hi, I'm having exactly the same issue (having only started with Jenkins
2.0 in the last couple of days). I've tried the Pipeline Utility, tried
the EnvInject plugin, also tried opening the file using Groovy file
operations, no success! Did you manage to solve this??
Post by Ian Cotton
Thanks Jerome. Unfortunately this doesn't help me much. The properties
file I need to load already exists and is in use by various build scripts.
I assume I need to create an EnvInjectJobProperty object and set the
appropriate property on it. I'll give that a try.
Post by j***@bodycad.com
Not sure about the Java properties file, but I succeed by doing a
.groovy file if that's interest you (probably not, but here it is if
*Jenkinsfile*
def my_var = evaluate(new File("myEnv.groovy"));
bat "\"${my_var.python_2_exe}\" myscript.py"
...
*myEnv.groovy*
def rv= [:]
rv['mercurial_url'] = 'http://mercurial.buildserver/'
rv['python_2_exe'] = "c:\\Python27\\python.exe"
...
return rv;
I put the .groovy file on the build machine jenkins folder, so the
Jenkinsfile from the repos can work with vars from any of our build
machines or network emplacement.
--
You received this message because you are subscribed to the Google
Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send
To view this discussion on the web visit https://groups.google.com/d/ms
gid/jenkinsci-users/1a03bb2f-5022-4005-ab10-5e3146aebcd1%40g
ooglegroups.com
<https://groups.google.com/d/msgid/jenkinsci-users/1a03bb2f-5022-4005-ab10-5e3146aebcd1%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit https://groups.google.com/d/ms
gid/jenkinsci-users/fcf3de22-08c3-47e2-b996-1d0bd85f28ed%
40googlegroups.com
<https://groups.google.com/d/msgid/jenkinsci-users/fcf3de22-08c3-47e2-b996-1d0bd85f28ed%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the
Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/
topic/jenkinsci-users/OV9h0q_FGfQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
To view this discussion on the web visit https://groups.google.com/d/
msgid/jenkinsci-users/CAAYHPVij13azLVN%2BwkQfeGG_
ExE6eUqGE1A4cL9Dg-zvwtXK0A%40mail.gmail.com
<https://groups.google.com/d/msgid/jenkinsci-users/CAAYHPVij13azLVN%2BwkQfeGG_ExE6eUqGE1A4cL9Dg-zvwtXK0A%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAG7ZcNsW5TAbKo1J%3Dm77x9F_FQYcNzh5ndQWHe%2Bo3s5wYtwmGw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Phillip Campbell
2016-09-22 12:12:36 UTC
Permalink
Syntax error. Var1 and Var2 are variables. Try:

echo "Var1=${Var1}"
echo "Var2=${Var2}"
Post by Pete Singleton
ok thanks, that seems to work as far as reading the properties file, but
def props = readProperties file: 'project.properties'
def Var1= props['RELEASE']
def Var2= props['SOFTWARE.VERSION']
echo "Var1=" Var1
echo "Var2=" Var2
java.lang.NullPointerException: Cannot get property 'Var1' on null object
On 21 September 2016 at 17:12, Phillip Campbell <
Post by Phillip Campbell
Here's a snippet from a Jenkinsfile in a pre-2.0 pipeline job that I use
to read an existing build.properties file in the workspace so that the
Jenkinsfile can use the properties. I haven't tried this in 2.0 pipeline
yet.
if (!fileExists('build.properties')){ echo 'No build properties.' exit } def props = readProperties file: 'build.properties' /* * From build.properties file */ def Var1= props["SOME_PROPERTY"] def Var2= props["ANOTHER_PROPERTY"]
Post by Pete Singleton
Hi, I'm having exactly the same issue (having only started with Jenkins
2.0 in the last couple of days). I've tried the Pipeline Utility, tried
the EnvInject plugin, also tried opening the file using Groovy file
operations, no success! Did you manage to solve this??
Post by Ian Cotton
Thanks Jerome. Unfortunately this doesn't help me much. The properties
file I need to load already exists and is in use by various build scripts.
I assume I need to create an EnvInjectJobProperty object and set the
appropriate property on it. I'll give that a try.
Post by j***@bodycad.com
Not sure about the Java properties file, but I succeed by doing a
.groovy file if that's interest you (probably not, but here it is if
*Jenkinsfile*
def my_var = evaluate(new File("myEnv.groovy"));
bat "\"${my_var.python_2_exe}\" myscript.py"
...
*myEnv.groovy*
def rv= [:]
rv['mercurial_url'] = 'http://mercurial.buildserver/'
rv['python_2_exe'] = "c:\\Python27\\python.exe"
...
return rv;
I put the .groovy file on the build machine jenkins folder, so the
Jenkinsfile from the repos can work with vars from any of our build
machines or network emplacement.
--
You received this message because you are subscribed to the Google
Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/1a03bb2f-5
022-4005-ab10-5e3146aebcd1%40googlegroups.com
<https://groups.google.com/d/msgid/jenkinsci-users/1a03bb2f-5022-4005-ab10-5e3146aebcd1%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google
Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send
To view this discussion on the web visit https://groups.google.com/d/ms
gid/jenkinsci-users/fcf3de22-08c3-47e2-b996-1d0bd85f28ed%40g
ooglegroups.com
<https://groups.google.com/d/msgid/jenkinsci-users/fcf3de22-08c3-47e2-b996-1d0bd85f28ed%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the
Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/to
pic/jenkinsci-users/OV9h0q_FGfQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
To view this discussion on the web visit https://groups.google.com/d/ms
gid/jenkinsci-users/CAAYHPVij13azLVN%2BwkQfeGG_ExE6eUqGE1A4c
L9Dg-zvwtXK0A%40mail.gmail.com
<https://groups.google.com/d/msgid/jenkinsci-users/CAAYHPVij13azLVN%2BwkQfeGG_ExE6eUqGE1A4cL9Dg-zvwtXK0A%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit https://groups.google.com/d/
msgid/jenkinsci-users/CAG7ZcNsW5TAbKo1J%3Dm77x9F_
FQYcNzh5ndQWHe%2Bo3s5wYtwmGw%40mail.gmail.com
<https://groups.google.com/d/msgid/jenkinsci-users/CAG7ZcNsW5TAbKo1J%3Dm77x9F_FQYcNzh5ndQWHe%2Bo3s5wYtwmGw%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAAYHPVjCWkkGv%2Bos%3DD5h%3Dkjmk%2BriJh485rgqoP%3DGJk980NEebQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Ian Cotton
2016-09-22 13:21:04 UTC
Permalink
The original idea of using the properties build step was just not workable
since I couldn't directly instantiate the required objects and couldn't
find any kind of factory. I went with loading from file straight into a
Properties object as some have suggested and it works fine. I'm using much
more of the Groovy language now and not working in the sandbox. Security
risk, I know, but it's much more powerful.
Post by Phillip Campbell
echo "Var1=${Var1}"
echo "Var2=${Var2}"
Post by Pete Singleton
ok thanks, that seems to work as far as reading the properties file, but
def props = readProperties file: 'project.properties'
def Var1= props['RELEASE']
def Var2= props['SOFTWARE.VERSION']
echo "Var1=" Var1
echo "Var2=" Var2
java.lang.NullPointerException: Cannot get property 'Var1' on null object
On 21 September 2016 at 17:12, Phillip Campbell <
Post by Phillip Campbell
Here's a snippet from a Jenkinsfile in a pre-2.0 pipeline job that I
use to read an existing build.properties file in the workspace so that the
Jenkinsfile can use the properties. I haven't tried this in 2.0 pipeline
yet.
if (!fileExists('build.properties')){ echo 'No build properties.' exit } def props = readProperties file: 'build.properties' /* * From build.properties file */ def Var1= props["SOME_PROPERTY"] def Var2= props["ANOTHER_PROPERTY"]
On Wed, Sep 21, 2016 at 8:22 AM, Pete Singleton <
Post by Pete Singleton
Hi, I'm having exactly the same issue (having only started with Jenkins
2.0 in the last couple of days). I've tried the Pipeline Utility, tried
the EnvInject plugin, also tried opening the file using Groovy file
operations, no success! Did you manage to solve this??
Post by Ian Cotton
Thanks Jerome. Unfortunately this doesn't help me much. The properties
file I need to load already exists and is in use by various build scripts.
I assume I need to create an EnvInjectJobProperty object and set the
appropriate property on it. I'll give that a try.
Post by j***@bodycad.com
Not sure about the Java properties file, but I succeed by doing a
.groovy file if that's interest you (probably not, but here it is if
*Jenkinsfile*
def my_var = evaluate(new File("myEnv.groovy"));
bat "\"${my_var.python_2_exe}\" myscript.py"
...
*myEnv.groovy*
def rv= [:]
rv['mercurial_url'] = 'http://mercurial.buildserver/'
rv['python_2_exe'] = "c:\\Python27\\python.exe"
...
return rv;
I put the .groovy file on the build machine jenkins folder, so the
Jenkinsfile from the repos can work with vars from any of our build
machines or network emplacement.
--
You received this message because you are subscribed to the Google
Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it,
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/1a03bb2f-5022-4005-ab10-5e3146aebcd1%40googlegroups.com
<https://groups.google.com/d/msgid/jenkinsci-users/1a03bb2f-5022-4005-ab10-5e3146aebcd1%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google
Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/fcf3de22-08c3-47e2-b996-1d0bd85f28ed%40googlegroups.com
<https://groups.google.com/d/msgid/jenkinsci-users/fcf3de22-08c3-47e2-b996-1d0bd85f28ed%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the
Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/jenkinsci-users/OV9h0q_FGfQ/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/CAAYHPVij13azLVN%2BwkQfeGG_ExE6eUqGE1A4cL9Dg-zvwtXK0A%40mail.gmail.com
<https://groups.google.com/d/msgid/jenkinsci-users/CAAYHPVij13azLVN%2BwkQfeGG_ExE6eUqGE1A4cL9Dg-zvwtXK0A%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/CAG7ZcNsW5TAbKo1J%3Dm77x9F_FQYcNzh5ndQWHe%2Bo3s5wYtwmGw%40mail.gmail.com
<https://groups.google.com/d/msgid/jenkinsci-users/CAG7ZcNsW5TAbKo1J%3Dm77x9F_FQYcNzh5ndQWHe%2Bo3s5wYtwmGw%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/CAAYHPVjCWkkGv%2Bos%3DD5h%3Dkjmk%2BriJh485rgqoP%3DGJk980NEebQ%40mail.gmail.com
<https://groups.google.com/d/msgid/jenkinsci-users/CAAYHPVjCWkkGv%2Bos%3DD5h%3Dkjmk%2BriJh485rgqoP%3DGJk980NEebQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAHZUCTkDboZVaXW1g6r_Q89usAGiqBUi6OZ6h1mvDv2MxjN9mQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
naresh thota
2018-04-30 15:52:05 UTC
Permalink
hi, can someone help to resolve the below issue.

i have used the readProperties to read the properties from the file as
below.

def props = readProperties file: 'my_dir/env_props.properties'

def var1 = props["${env}.install"]

here env is the parameter passed to the pipeline job, the value of the
"env" is not populated in the above statement.

can someone advise on this, thanks in advance.
Hi all,
I would like to load properties from a Java properties file as environment
variables. The snippet generator appears to be able to do just this using
the properties step. If I check the box 'Prepare an environment for the
run' it offers me a text box to enter a 'Properties File Path'. When I
put the path in for my properties file, however, it doesn't generate this
Properties File Path =
newbuild/src/gateways/build/scripts/bldcfg.properties
properties [[$class: 'BuildBlockerProperty', blockLevel: <object of type
'', scanQueueFor: <object of type
hudson.plugins.buildblocker.BuildBlockerProperty.QueueScanScope>,
'', throttleEnabled: false, throttleOption: 'project'], <object of type
org.jenkinsci.plugins.envinject.EnvInjectJobProperty>]
The last parameter (<object of type
org.jenkinsci.plugins.envinject.EnvInjectJobProperty>) appears to be
where the file name should appear but the code generator is putting nothing
in there. Does anyone have any idea what the correct syntax should be?
I'm using Jenkins 2.20.
Thanks,
Ian.
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/4c3958d5-04cc-4d0b-802f-9687d1f33e4c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...