Quantcast

How to pass system variable to slave?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to pass system variable to slave?

jcarsique
Hello,

I need to use ANDROID_HOME=/path/to/android/sdk/ in pom.xml files but I cannot set this from Jenkins; I tried to set it
on the server administration screen and on the slave configuration but with no success: POM parsing fails.
https://qa.nuxeo.org/jenkins/job/nuxeo-android-5.4/7/console
<< [ERROR] 'dependencies.dependency.systemPath' for com.google.android:android-sdk-nx:jar must specify an absolute path
but is ${env.ANDROID_HOME}/platforms/android-8/android.jar @ line 23, column 19 >>

The only way I found was to set this as a build parameter.

The slaves don't have any .bashrc or .profile.

I already had this issue with other cases but I didn't have retry for a long time and I'm surprised to see it's still
not working.
Is it a known issue or something I'm doing wrong ?

Thanks,

--
Julien Carsique, DevOps, Nuxeo (Paris, France)
www.nuxeo.com - The Open Source ECM Platform - www.nuxeo.org
Nuxeo ECM Stack - The Java EE, scalable, standard-based ECM Platform


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to pass system variable to slave?

Gregory Boissinot
Have you try to configure the node/slave properties?
In the node properties, you are able to configure the tool locations
and the environment variables.
If you add Environment variable from the node property,  you can
access to these variables with ${env.VAR} in your pom.xml.
I tested for Jenkins 1.397 and a Maven job type -> it 's OK for me.

On Fri, Feb 18, 2011 at 3:30 PM, Julien CARSIQUE <[hidden email]> wrote:

> Hello,
>
> I need to use ANDROID_HOME=/path/to/android/sdk/ in pom.xml files but I cannot set this from Jenkins; I tried to set it
> on the server administration screen and on the slave configuration but with no success: POM parsing fails.
> https://qa.nuxeo.org/jenkins/job/nuxeo-android-5.4/7/console
> << [ERROR] 'dependencies.dependency.systemPath' for com.google.android:android-sdk-nx:jar must specify an absolute path
> but is ${env.ANDROID_HOME}/platforms/android-8/android.jar @ line 23, column 19 >>
>
> The only way I found was to set this as a build parameter.
>
> The slaves don't have any .bashrc or .profile.
>
> I already had this issue with other cases but I didn't have retry for a long time and I'm surprised to see it's still
> not working.
> Is it a known issue or something I'm doing wrong ?
>
> Thanks,
>
> --
> Julien Carsique, DevOps, Nuxeo (Paris, France)
> www.nuxeo.com - The Open Source ECM Platform - www.nuxeo.org
> Nuxeo ECM Stack - The Java EE, scalable, standard-based ECM Platform
>
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to pass system variable to slave?

jcarsique
I tried and it didn't work.

I successfully tested it with a free-style project and running "echo $TEST_VAR" as a Shell command, I can see the value set from the node configuration.

Here's a failure with a Maven job: http://qa.nuxeo.org/jenkins/job/nuxeo-android-5.4/22/console
ERROR: Failed to parse POMs
hudson.util.IOException2: remote file operation failed: /home/hudson/tmp/workspace/nuxeo-android-5.4 at hudson.remoting.Channel@663ffd14:dvalinn
	at hudson.FilePath.act(FilePath.java:752)
	at hudson.FilePath.act(FilePath.java:738)
	at hudson.maven.MavenModuleSetBuild$RunnerImpl.parsePoms(MavenModuleSetBuild.java:698)
	at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:531)
	at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:420)
	at hudson.model.Run.run(Run.java:1362)
	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:405)
	at hudson.model.ResourceController.execute(ResourceController.java:88)
	at hudson.model.Executor.run(Executor.java:145)
Caused by: hudson.remoting.ProxyException: hudson.maven.MavenModuleSetBuild$MavenExecutionException: org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[ERROR] 'dependencies.dependency.systemPath' for com.google.android:android-sdk-nx:jar must specify an absolute path but is ${env.ANDROID_HOME}/platforms/android-8/android.jar @ line 23, column 19

Setting it in Jenkins global configuration doesn't work, nor doing it in the node/slave configuration.
Whereas setting it in the job configuration using http://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Build does work.

Maybe is there some conflict between Jenkins and some plugins ?
Note however, I often had that issue with environment variables for a very long time. Our oldest jobs are setting the wanted system value in their Shell script (in job configuration) because parameters defined from master or node were not set.

How did you test it with a Maven job?

Le 21/02/11 20:52, Grégory Boissinot a écrit :
Have you try to configure the node/slave properties?
In the node properties, you are able to configure the tool locations
and the environment variables.
If you add Environment variable from the node property,  you can
access to these variables with ${env.VAR} in your pom.xml.
I tested for Jenkins 1.397 and a Maven job type -> it 's OK for me.

On Fri, Feb 18, 2011 at 3:30 PM, Julien CARSIQUE [hidden email] wrote:
Hello,

I need to use ANDROID_HOME=/path/to/android/sdk/ in pom.xml files but I cannot set this from Jenkins; I tried to set it
on the server administration screen and on the slave configuration but with no success: POM parsing fails.
https://qa.nuxeo.org/jenkins/job/nuxeo-android-5.4/7/console
<< [ERROR] 'dependencies.dependency.systemPath' for com.google.android:android-sdk-nx:jar must specify an absolute path
but is ${env.ANDROID_HOME}/platforms/android-8/android.jar @ line 23, column 19 >>

The only way I found was to set this as a build parameter.

The slaves don't have any .bashrc or .profile.

I already had this issue with other cases but I didn't have retry for a long time and I'm surprised to see it's still
not working.
Is it a known issue or something I'm doing wrong ?

Thanks,

--
Julien Carsique, DevOps, Nuxeo (Paris, France)
www.nuxeo.com - The Open Source ECM Platform - www.nuxeo.org
Nuxeo ECM Stack - The Java EE, scalable, standard-based ECM Platform




-- 
Julien Carsique, DevOps, Nuxeo (Paris, France)
www.nuxeo.com - The Open Source ECM Platform - www.nuxeo.org
Nuxeo ECM Stack - The Java EE, scalable, standard-based ECM Platform

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to pass system variable to slave?

Olivier Lamy-2
Please load an issue in jira ( maven component) if possible with a
sample project.
I will have a look.


Le 22 février 2011 15:22, Julien CARSIQUE <[hidden email]> a écrit :

> I tried and it didn't work.
>
> I successfully tested it with a free-style project and running "echo
> $TEST_VAR" as a Shell command, I can see the value set from the node
> configuration.
>
> Here's a failure with a Maven job:
> http://qa.nuxeo.org/jenkins/job/nuxeo-android-5.4/22/console
>
> ERROR: Failed to parse POMs
> hudson.util.IOException2: remote file operation failed:
> /home/hudson/tmp/workspace/nuxeo-android-5.4 at
> hudson.remoting.Channel@663ffd14:dvalinn
> at hudson.FilePath.act(FilePath.java:752)
> at hudson.FilePath.act(FilePath.java:738)
> at
> hudson.maven.MavenModuleSetBuild$RunnerImpl.parsePoms(MavenModuleSetBuild.java:698)
> at
> hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:531)
> at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:420)
> at hudson.model.Run.run(Run.java:1362)
> at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:405)
> at hudson.model.ResourceController.execute(ResourceController.java:88)
> at hudson.model.Executor.run(Executor.java:145)
> Caused by: hudson.remoting.ProxyException:
> hudson.maven.MavenModuleSetBuild$MavenExecutionException:
> org.apache.maven.project.ProjectBuildingException: Some problems were
> encountered while processing the POMs:
> [ERROR] 'dependencies.dependency.systemPath' for
> com.google.android:android-sdk-nx:jar must specify an absolute path but is
> ${env.ANDROID_HOME}/platforms/android-8/android.jar @ line 23, column 19
>
> Setting it in Jenkins global configuration doesn't work, nor doing it in the
> node/slave configuration.
> Whereas setting it in the job configuration using
> http://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Build does work.
>
> Maybe is there some conflict between Jenkins and some plugins ?
> Note however, I often had that issue with environment variables for a very
> long time. Our oldest jobs are setting the wanted system value in their
> Shell script (in job configuration) because parameters defined from master
> or node were not set.
>
> How did you test it with a Maven job?
>
> Le 21/02/11 20:52, Grégory Boissinot a écrit :
>
> Have you try to configure the node/slave properties?
> In the node properties, you are able to configure the tool locations
> and the environment variables.
> If you add Environment variable from the node property,  you can
> access to these variables with ${env.VAR} in your pom.xml.
> I tested for Jenkins 1.397 and a Maven job type -> it 's OK for me.
>
> On Fri, Feb 18, 2011 at 3:30 PM, Julien CARSIQUE <[hidden email]>
> wrote:
>
> Hello,
>
> I need to use ANDROID_HOME=/path/to/android/sdk/ in pom.xml files but I
> cannot set this from Jenkins; I tried to set it
> on the server administration screen and on the slave configuration but with
> no success: POM parsing fails.
> https://qa.nuxeo.org/jenkins/job/nuxeo-android-5.4/7/console
> << [ERROR] 'dependencies.dependency.systemPath' for
> com.google.android:android-sdk-nx:jar must specify an absolute path
> but is ${env.ANDROID_HOME}/platforms/android-8/android.jar @ line 23, column
> 19 >>
>
> The only way I found was to set this as a build parameter.
>
> The slaves don't have any .bashrc or .profile.
>
> I already had this issue with other cases but I didn't have retry for a long
> time and I'm surprised to see it's still
> not working.
> Is it a known issue or something I'm doing wrong ?
>
> Thanks,
>
> --
> Julien Carsique, DevOps, Nuxeo (Paris, France)
> www.nuxeo.com - The Open Source ECM Platform - www.nuxeo.org
> Nuxeo ECM Stack - The Java EE, scalable, standard-based ECM Platform
>
>
>
>
> --
> Julien Carsique, DevOps, Nuxeo (Paris, France)
> www.nuxeo.com - The Open Source ECM Platform - www.nuxeo.org
> Nuxeo ECM Stack - The Java EE, scalable, standard-based ECM Platform
>
>



--
Olivier Lamy
http://twitter.com/olamy
http://www.linkedin.com/in/olamy
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to pass system variable to slave?

jcarsique
Thanks a lot, here is the issue: http://issues.jenkins-ci.org/browse/JENKINS-8865
I've attached a config.xml file with which I could reproduce the issue on a test Jenkins server.

As explained in the Jira issue, the project won't build successfully without Android SDK installed, but I think you
don't need it as it fails before running Maven, at parsing time.

Le 22/02/11 18:01, Olivier Lamy a écrit :

> Please load an issue in jira ( maven component) if possible with a
> sample project.
> I will have a look.
>
>
> Le 22 février 2011 15:22, Julien CARSIQUE <[hidden email]> a écrit :
>> I tried and it didn't work.
>>
>> I successfully tested it with a free-style project and running "echo
>> $TEST_VAR" as a Shell command, I can see the value set from the node
>> configuration.
>>
>> Here's a failure with a Maven job:
>> http://qa.nuxeo.org/jenkins/job/nuxeo-android-5.4/22/console
>>
>> ERROR: Failed to parse POMs
>> hudson.util.IOException2: remote file operation failed:
>> /home/hudson/tmp/workspace/nuxeo-android-5.4 at
>> hudson.remoting.Channel@663ffd14:dvalinn
>> at hudson.FilePath.act(FilePath.java:752)
>> at hudson.FilePath.act(FilePath.java:738)
>> at
>> hudson.maven.MavenModuleSetBuild$RunnerImpl.parsePoms(MavenModuleSetBuild.java:698)
>> at
>> hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:531)
>> at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:420)
>> at hudson.model.Run.run(Run.java:1362)
>> at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:405)
>> at hudson.model.ResourceController.execute(ResourceController.java:88)
>> at hudson.model.Executor.run(Executor.java:145)
>> Caused by: hudson.remoting.ProxyException:
>> hudson.maven.MavenModuleSetBuild$MavenExecutionException:
>> org.apache.maven.project.ProjectBuildingException: Some problems were
>> encountered while processing the POMs:
>> [ERROR] 'dependencies.dependency.systemPath' for
>> com.google.android:android-sdk-nx:jar must specify an absolute path but is
>> ${env.ANDROID_HOME}/platforms/android-8/android.jar @ line 23, column 19
>>
>> Setting it in Jenkins global configuration doesn't work, nor doing it in the
>> node/slave configuration.
>> Whereas setting it in the job configuration using
>> http://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Build does work.
>>
>> Maybe is there some conflict between Jenkins and some plugins ?
>> Note however, I often had that issue with environment variables for a very
>> long time. Our oldest jobs are setting the wanted system value in their
>> Shell script (in job configuration) because parameters defined from master
>> or node were not set.
>>
>> How did you test it with a Maven job?
>>
>> Le 21/02/11 20:52, Grégory Boissinot a écrit :
>>
>> Have you try to configure the node/slave properties?
>> In the node properties, you are able to configure the tool locations
>> and the environment variables.
>> If you add Environment variable from the node property,  you can
>> access to these variables with ${env.VAR} in your pom.xml.
>> I tested for Jenkins 1.397 and a Maven job type -> it 's OK for me.
>>
>> On Fri, Feb 18, 2011 at 3:30 PM, Julien CARSIQUE <[hidden email]>
>> wrote:
>>
>> Hello,
>>
>> I need to use ANDROID_HOME=/path/to/android/sdk/ in pom.xml files but I
>> cannot set this from Jenkins; I tried to set it
>> on the server administration screen and on the slave configuration but with
>> no success: POM parsing fails.
>> https://qa.nuxeo.org/jenkins/job/nuxeo-android-5.4/7/console
>> << [ERROR] 'dependencies.dependency.systemPath' for
>> com.google.android:android-sdk-nx:jar must specify an absolute path
>> but is ${env.ANDROID_HOME}/platforms/android-8/android.jar @ line 23, column
>> 19 >>
>>
>> The only way I found was to set this as a build parameter.
>>
>> The slaves don't have any .bashrc or .profile.
>>
>> I already had this issue with other cases but I didn't have retry for a long
>> time and I'm surprised to see it's still
>> not working.
>> Is it a known issue or something I'm doing wrong ?
>>
>> Thanks,
>>
>> --
>> Julien Carsique, DevOps, Nuxeo (Paris, France)
>> www.nuxeo.com - The Open Source ECM Platform - www.nuxeo.org
>> Nuxeo ECM Stack - The Java EE, scalable, standard-based ECM Platform
>>
>>
>>
>>
>> --
>> Julien Carsique, DevOps, Nuxeo (Paris, France)
>> www.nuxeo.com - The Open Source ECM Platform - www.nuxeo.org
>> Nuxeo ECM Stack - The Java EE, scalable, standard-based ECM Platform
>>
>>
>
>

--
Julien Carsique, DevOps, Nuxeo (Paris, France)
www.nuxeo.com - The Open Source ECM Platform - www.nuxeo.org
Nuxeo ECM Stack - The Java EE, scalable, standard-based ECM Platform


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to pass system variable to slave?

Olivier Lamy-2
Salut,

I have just pushed the fix.
You can test it with this war :
http://people.apache.org/~olamy/jenkins/jenkins.war


--
Olivier Lamy
http://twitter.com/olamy
http://www.linkedin.com/in/olamy

2011/3/1 Olivier Lamy <[hidden email]>:

> Salut,
>
> I have just pushed the fix.
> You can test it with this war :
> http://people.apache.org/~olamy/jenkins/jenkins.war
>
>
> --
> Olivier Lamy
> http://twitter.com/olamy
> http://www.linkedin.com/in/olamy
>
> 2011/2/23 Julien CARSIQUE <[hidden email]>:
>> Thanks a lot, here is the issue: http://issues.jenkins-ci.org/browse/JENKINS-8865
>> I've attached a config.xml file with which I could reproduce the issue on a test Jenkins server.
>>
>> As explained in the Jira issue, the project won't build successfully without Android SDK installed, but I think you
>> don't need it as it fails before running Maven, at parsing time.
>>
>> Le 22/02/11 18:01, Olivier Lamy a écrit :
>>> Please load an issue in jira ( maven component) if possible with a
>>> sample project.
>>> I will have a look.
>>>
>>>
>>> Le 22 février 2011 15:22, Julien CARSIQUE <[hidden email]> a écrit :
>>>> I tried and it didn't work.
>>>>
>>>> I successfully tested it with a free-style project and running "echo
>>>> $TEST_VAR" as a Shell command, I can see the value set from the node
>>>> configuration.
>>>>
>>>> Here's a failure with a Maven job:
>>>> http://qa.nuxeo.org/jenkins/job/nuxeo-android-5.4/22/console
>>>>
>>>> ERROR: Failed to parse POMs
>>>> hudson.util.IOException2: remote file operation failed:
>>>> /home/hudson/tmp/workspace/nuxeo-android-5.4 at
>>>> hudson.remoting.Channel@663ffd14:dvalinn
>>>>      at hudson.FilePath.act(FilePath.java:752)
>>>>      at hudson.FilePath.act(FilePath.java:738)
>>>>      at
>>>> hudson.maven.MavenModuleSetBuild$RunnerImpl.parsePoms(MavenModuleSetBuild.java:698)
>>>>      at
>>>> hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:531)
>>>>      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:420)
>>>>      at hudson.model.Run.run(Run.java:1362)
>>>>      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:405)
>>>>      at hudson.model.ResourceController.execute(ResourceController.java:88)
>>>>      at hudson.model.Executor.run(Executor.java:145)
>>>> Caused by: hudson.remoting.ProxyException:
>>>> hudson.maven.MavenModuleSetBuild$MavenExecutionException:
>>>> org.apache.maven.project.ProjectBuildingException: Some problems were
>>>> encountered while processing the POMs:
>>>> [ERROR] 'dependencies.dependency.systemPath' for
>>>> com.google.android:android-sdk-nx:jar must specify an absolute path but is
>>>> ${env.ANDROID_HOME}/platforms/android-8/android.jar @ line 23, column 19
>>>>
>>>> Setting it in Jenkins global configuration doesn't work, nor doing it in the
>>>> node/slave configuration.
>>>> Whereas setting it in the job configuration using
>>>> http://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Build does work.
>>>>
>>>> Maybe is there some conflict between Jenkins and some plugins ?
>>>> Note however, I often had that issue with environment variables for a very
>>>> long time. Our oldest jobs are setting the wanted system value in their
>>>> Shell script (in job configuration) because parameters defined from master
>>>> or node were not set.
>>>>
>>>> How did you test it with a Maven job?
>>>>
>>>> Le 21/02/11 20:52, Grégory Boissinot a écrit :
>>>>
>>>> Have you try to configure the node/slave properties?
>>>> In the node properties, you are able to configure the tool locations
>>>> and the environment variables.
>>>> If you add Environment variable from the node property,  you can
>>>> access to these variables with ${env.VAR} in your pom.xml.
>>>> I tested for Jenkins 1.397 and a Maven job type -> it 's OK for me.
>>>>
>>>> On Fri, Feb 18, 2011 at 3:30 PM, Julien CARSIQUE <[hidden email]>
>>>> wrote:
>>>>
>>>> Hello,
>>>>
>>>> I need to use ANDROID_HOME=/path/to/android/sdk/ in pom.xml files but I
>>>> cannot set this from Jenkins; I tried to set it
>>>> on the server administration screen and on the slave configuration but with
>>>> no success: POM parsing fails.
>>>> https://qa.nuxeo.org/jenkins/job/nuxeo-android-5.4/7/console
>>>> << [ERROR] 'dependencies.dependency.systemPath' for
>>>> com.google.android:android-sdk-nx:jar must specify an absolute path
>>>> but is ${env.ANDROID_HOME}/platforms/android-8/android.jar @ line 23, column
>>>> 19 >>
>>>>
>>>> The only way I found was to set this as a build parameter.
>>>>
>>>> The slaves don't have any .bashrc or .profile.
>>>>
>>>> I already had this issue with other cases but I didn't have retry for a long
>>>> time and I'm surprised to see it's still
>>>> not working.
>>>> Is it a known issue or something I'm doing wrong ?
>>>>
>>>> Thanks,
>>>>
>>>> --
>>>> Julien Carsique, DevOps, Nuxeo (Paris, France)
>>>> www.nuxeo.com - The Open Source ECM Platform - www.nuxeo.org
>>>> Nuxeo ECM Stack - The Java EE, scalable, standard-based ECM Platform
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Julien Carsique, DevOps, Nuxeo (Paris, France)
>>>> www.nuxeo.com - The Open Source ECM Platform - www.nuxeo.org
>>>> Nuxeo ECM Stack - The Java EE, scalable, standard-based ECM Platform
>>>>
>>>>
>>>
>>>
>>
>> --
>> Julien Carsique, DevOps, Nuxeo (Paris, France)
>> www.nuxeo.com - The Open Source ECM Platform - www.nuxeo.org
>> Nuxeo ECM Stack - The Java EE, scalable, standard-based ECM Platform
>>
>>
>>
>



--
Olivier Lamy
http://twitter.com/olamy
http://www.linkedin.com/in/olamy
Loading...