bryanforst
Posts: 6
Joined: Tue Apr 23, 2019 3:12 pm

Using Jenkins env variables in AI "Additional Commands"

Tue Apr 23, 2019 3:20 pm

I am firing off my advanced installer package just fine in Jenkins.
However I would like to use the BUILD_NUMBER env variable in a SetVersion command stored in the Advanced Options area.

Nothing from the Jenkins environment seems to get translated. I have used all of the usual formats.

SetVersion $BUILD_NUMBER
SetVersion ${BUILD_NUMBER}
SetVersion %BUILD_NUMBER%

I can set a parameter of my own but this requires someone to enter a value. The Jenkins env variable is not translated.

Has anyone ran into this?

Thanks

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Using Jenkins env variables in AI "Additional Commands"

Wed Apr 24, 2019 1:01 pm

Hello Bryan and welcome to Advanced Installer forums,

From what I can see, it does not have to do with the syntax of the environment variable. It most probably have to do with the fact that your environment variable is not valid.

With that being said, could you please try the specified command with the value that is contained by the BUILD_NUMBER environment variable first, and then try with the environment variable itself?

Hope this helps.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

bryanforst
Posts: 6
Joined: Tue Apr 23, 2019 3:12 pm

Re: Using Jenkins env variables in AI "Additional Commands"

Wed Apr 24, 2019 3:18 pm

Hi Catalin,

The BUILD_NUMBER env var is standard with Jenkins. I have used it in calls to windows bat files with no problem.
The issue seems to be in the Advanced Options/additional commands area. It does not convert the BUILD_NUMBER variable.

Using SetVersion with a value like "1.0.5" works fine
as does creating a parameter in the Jenkins job and using it. Its just directly using the BUILD_NUMBER provided by Jenkins that does not.

I actually have the same problem in the UI sections of Jenkins so I have posted with them as well. It may not be specific to
Advanced Installer, just wanted to see if anyone ran into this and has a solution.

Thanks,
Bryan

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Using Jenkins env variables in AI "Additional Commands"

Tue May 07, 2019 9:17 am

Hello Bryan,

First of all, please accept my apologies for the delayed reply, but we had our Orthodox Easter holiday here.

From what I know, this should work as expected.

However, as you have stated, this may not be related to Advanced Installer.

Could you please let me know what the support team form Jenkins has said in what regards your UI issue?

Looking forward to hearing from you.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

bryanforst
Posts: 6
Joined: Tue Apr 23, 2019 3:12 pm

Re: Using Jenkins env variables in AI "Additional Commands"

Tue May 07, 2019 2:46 pm

Hi Catalin,
I will let you know as soon as I hear from them. Have not yet....

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Using Jenkins env variables in AI "Additional Commands"

Wed May 08, 2019 9:29 am

Sure Bryan,

I am looking forward to hearing from you.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”