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.
On Wednesday, September 7, 2016 at 9:05:56 PM UTC+5:30, Ian Cotton wrote:
>
> 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
> as part of the code:
> Properties File Path =
> newbuild/src/gateways/build/scripts/bldcfg.properties
>
> Generated code:
> properties [[$class: 'BuildBlockerProperty', blockLevel: <object of type
> hudson.plugins.buildblocker.BuildBlockerProperty.BlockLevel>, blockingJobs:
> '', scanQueueFor: <object of type
> hudson.plugins.buildblocker.BuildBlockerProperty.QueueScanScope>,
> useBuildBlocker: false], pipelineTriggers([]), [$class:
> 'ThrottleJobProperty', categories: [], limitOneJobWithMatchingParams:
> false, maxConcurrentPerNode: 0, maxConcurrentTotal: 0, paramsToUseForLimit:
> '', 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 [email protected].
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.