[HAP-554] Environment variables not passed to Artifactory Created: 01/Jan/15  Updated: 01/Jun/15  Resolved: 05/Mar/15

Status: Resolved
Project: Jenkins Artifactory Plug-in
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3.0

Type: Bug Priority: Critical
Reporter: Avi Amsalem Assignee: Aviad Shikloshi (Inactive)
Resolution: Fixed Votes: 4
Labels: None


 Description   

im trying to pass property value from file with EnvInject to Artifactory.

1. im using post step to inject the properties
2. using Deployment properties to pass the property to Artifactory
i'm printing the value in post step build and see the correct value
but in artifactory i see the value as parameter e,g ${propertyName} and not the value.

using Artifactory pro 3.4.2
using Artifactory plugin 2.2.5
using jenkins 1.572
using ENVInject plugin 1.9.0

please advice



 Comments   
Comment by Aviad Shikloshi (Inactive) [ 13/Jan/15 ]

Hi Avi,

Regarding the injected environment variables:
Please note that if you are using, as you mentioned, a "post" / "pre" step to inject those variables, Jenkins Artifactory plugin wont recognize these environment variables in the build process and therefore wont show the resolved values for the variables in the artifact properties. This is caused due the plugin initialization setup that starts prior to the "pre" step and initializing the environment for the current run.

The workflow that achieve the thing you are referring to is to set the environment prior to the build process initialization, and you can to do so by:
1. Checking the "Prepare an environment for the run" - You will find this option in start of the Jenkins job configuration page.
2. When clicking this a new text box for "Properties File Path" / "Properties Content" will appear on your configurations page - these properties will be injected to the environment prior to the plugin initialization.
3. Continue with your other configuration and build the project.
This way - the environment variables build will be set when Artifactory plugin will initialize and your artifacts properties values will be resolved according to your existing or injected environment variables.

Please let us know if this works for you.

Thank you,
Aviad.

Comment by Avi Amsalem [ 13/Jan/15 ]

I did it and it's work but now this option failed the deployment of jira issues data to Artifactory.
i'm using "Enable JIRA Integration"

Comment by Aviad Shikloshi (Inactive) [ 14/Jan/15 ]

Hi Avi,

I'm not sure I know what you mean by your last comment.
Can you please elaborate regarding the workflow and how will I be able to reproduce this on my environment?

Thanks,
Aviad.

Comment by Avi Amsalem [ 14/Jan/15 ]

Hi,

I already did the workflow you described above.
but if you using the "Prepare an environment for the run" option to import property file as environment variables this make the jira issue integration not working.

by saying jira integartion i mean when you enable the option "Enable JIRA Integration" in Artifactory deployment section in job configuration.
When i'm not using "Prepare an environment for the run" option and enable Jira Integration in jenkins job confugration then i can see the jir issues in the build data in artifactory.

Thanks,
Avi.

Comment by Shay Bagants [ 20/Jan/15 ]

HI Avi,

As we were not able to reproduce this issue, I wrote you directly through the official JFrog Support channel. Please reply to the email I sent you when you can.

Regards,
Shay.

Comment by Avi Amsalem [ 21/Jan/15 ]

Answered on email, with files you requested

Comment by William Duncan [ 13/Feb/15 ]

Aviad,

I am having an issue using injected variables with the plugin as well. I describe my issue --> HERE

Setting the variable as as part of build environment initialization as mentioned in your workflow above is not an option for us. The reason is that the values being injected as environment variables are sourced from a properties file which is checked out from a revision control system.

-William

Generated at Sun Oct 20 11:13:02 UTC 2019 using JIRA 7.6.16#76018-sha1:9ed376192612a49536ac834c64177a0fed6290f5.