[JIRA] [customtools-plugin] (JENKINS-32739) Unable to export path in matrix jobs.

33 views
Skip to first unread message

jwzh.hi@gmail.com (JIRA)

unread,
Feb 2, 2016, 8:13:01 PM2/2/16
to jenkinsc...@googlegroups.com
Wenzheng Jiang created an issue
 
Jenkins / Bug JENKINS-32739
Unable to export path in matrix jobs.
Issue Type: Bug Bug
Assignee: Oleg Nenashev
Attachments: 2.png
Components: customtools-plugin
Created: 03/Feb/16 1:12 AM
Environment: Jenkins 1.646
Custom Tools Plugin 0.4.4
Priority: Minor Minor
Reporter: Wenzheng Jiang

When using customTools plugin, I export the installation path by putting them in "Exported paths". But these paths don't appear later in PATH in matrixjobs, while it works fine in freestylejobs.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

o.v.nenashev@gmail.com (JIRA)

unread,
Feb 2, 2016, 9:53:01 PM2/2/16
to jenkinsc...@googlegroups.com
Oleg Nenashev commented on Bug JENKINS-32739
 
Re: Unable to export path in matrix jobs.

Cannot reproduce. Which versions of Matrix project and Custom Tools do you use?

jwzh.hi@gmail.com (JIRA)

unread,
Feb 3, 2016, 1:08:01 AM2/3/16
to jenkinsc...@googlegroups.com
Wenzheng Jiang updated an issue
 
Change By: Wenzheng Jiang
Environment:
Jenkins 1.646 
Custom Tools Plugin 0.4.4

Matrix Project Plugin 1.6

jwzh.hi@gmail.com (JIRA)

unread,
Feb 3, 2016, 1:11:01 AM2/3/16
to jenkinsc...@googlegroups.com
Wenzheng Jiang updated an issue
When using customTools plugin, I export the installation path by putting them in "Exported paths".  But these paths don't appear later in PATH in matrixjobs, while it works fine in freestylejobs.  
 

My installer configuration is :

Name: phpenv
Exported paths; phpenv/bin,phpenv/shims
Command :
export PHPENV_ROOT=$(pwd)/phpenv
export PATH="$PATH:$PHPENV_ROOT/bin"

# Use `flock` to ensure that we do not install/update `phpenv` simultaneously across different jobs.
(
    if ! flock --exclusive --nonblock 9; then
        # Wait for the lock to be released and then continue.
        flock --exclusive 9
        exit 1
    fi
    
    if test -d $PHPENV_ROOT; then
       # phpenv update
       echo 'phpenv installed'
    else
        curl -L http://git.io/phpenv-installer | bash
    fi
    
    if ! test -d $PHPENV_ROOT/shims; then
        mkdir $PHPENV_ROOT/shims
    fi
) 9>phpenv.lock

eval "$(phpenv init -)"

jwzh.hi@gmail.com (JIRA)

unread,
Feb 3, 2016, 1:12:01 AM2/3/16
to jenkinsc...@googlegroups.com

jwzh.hi@gmail.com (JIRA)

unread,
Feb 3, 2016, 1:13:01 AM2/3/16
to jenkinsc...@googlegroups.com

jwzh.hi@gmail.com (JIRA)

unread,
Feb 3, 2016, 1:13:03 AM2/3/16
to jenkinsc...@googlegroups.com

jwzh.hi@gmail.com (JIRA)

unread,
Feb 3, 2016, 1:16:01 AM2/3/16
to jenkinsc...@googlegroups.com
Wenzheng Jiang updated an issue


I also export the path in the installer command, but it also doesn't work. In the building process, I get 'phpenv not found' error and reason is the installation path is not in $PATH.

jwzh.hi@gmail.com (JIRA)

unread,
Feb 3, 2016, 1:18:01 AM2/3/16
to jenkinsc...@googlegroups.com
Wenzheng Jiang updated an issue
When using customTools plugin, I export the installation path by putting them in "Exported paths".  But these paths don't appear later in PATH in matrixjobs, while it works fine in freestylejobs. 

My installer configuration is :

Name: phpenv
Exported paths; phpenv/bin,phpenv/shims
Command :
```
export PHPENV_ROOT=$(pwd)/phpenv
export PATH="$PATH:$PHPENV_ROOT/bin"

(
    if ! flock --exclusive --nonblock 9; then
        flock --exclusive 9
        exit 1
    fi
    
    if test -d $PHPENV_ROOT; then
       # phpenv update
       echo 'phpenv installed'
    else
        curl -L http://git.io/phpenv-installer | bash
    fi
    
    if ! test -d $PHPENV_ROOT/shims; then
        mkdir $PHPENV_ROOT/shims
    fi
) 9>phpenv.lock

eval "$(phpenv init -)"
```

I also export the path in the installer command, but it also doesn't work. In the building process, I get 'phpenv not found' error and reason is the installation path is not in $PATH.

jwzh.hi@gmail.com (JIRA)

unread,
Feb 3, 2016, 1:18:03 AM2/3/16
to jenkinsc...@googlegroups.com
Wenzheng Jiang updated an issue
When using customTools plugin, I export the installation path by putting them in "Exported paths".  But these paths don't appear later in PATH in matrixjobs, while it works fine in freestylejobs. 

My installer configuration is :

Name: phpenv
Exported paths; phpenv/bin,phpenv/shims
Command :
```
export PHPENV_ROOT=$(pwd)/phpenv
export PATH="$PATH:$PHPENV_ROOT/bin"

# Use `flock` to ensure that we do not install/update `phpenv` simultaneously across different jobs.
(
    if ! flock --exclusive --nonblock 9; then
        # Wait for the lock to be released and then continue.
        flock --exclusive 9
        exit 1
    fi
    
    if test -d $PHPENV_ROOT; then
       # phpenv update
       echo 'phpenv installed'
    else
        curl -L http://git.io/phpenv-installer | bash
    fi
    
    if ! test -d $PHPENV_ROOT/shims; then
        mkdir $PHPENV_ROOT/shims
    fi
) 9>phpenv.lock

eval "$(phpenv init -)"
```

I also export the path in the installer command, but it also doesn't work. In the building process, I get 'phpenv not found' error and reason is the installation path is not in $PATH.

jwzh.hi@gmail.com (JIRA)

unread,
Feb 3, 2016, 1:22:02 AM2/3/16
to jenkinsc...@googlegroups.com
Wenzheng Jiang updated an issue
When using customTools plugin, I export the installation path by putting them in "Exported paths".  But these paths don't appear later in PATH in matrixjobs, while it works fine in freestylejobs. 

My installer configuration is :

Name: phpenv
Exported paths; phpenv/bin,phpenv/shims
Command :
```
export PHPENV_ROOT=$(pwd)/phpenv
export PATH="$PATH:$PHPENV_ROOT/bin"

(
    if ! flock --exclusive --nonblock 9; then
        flock --exclusive 9
        exit 1
    fi
    
    if test -d $PHPENV_ROOT; then
       echo 'phpenv installed'
    else
        curl -L http://git.io/phpenv-installer | bash
    fi
    
    if ! test -d $PHPENV_ROOT/shims; then
        mkdir $PHPENV_ROOT/shims
    fi
) 9>phpenv.lock

eval "$(phpenv init -)"
```

I also export the path in the installer command, but it also doesn't work My Job configuration is 

Axis config:
Name: PHP_VERSION
Value: 5
. 3.29 5.4.45 5.5.30

Build config:
```
phpenv versions | grep ${PHP_VERSION} || phpenv install ${PHP_VERSION}
```

 In the building process, I  get  got  'phpenv not found' error and reason is the installation path is not in $PATH.

jwzh.hi@gmail.com (JIRA)

unread,
Feb 3, 2016, 1:40:02 AM2/3/16
to jenkinsc...@googlegroups.com
 
Re: Unable to export path in matrix jobs.

Well, that problem seems to be disappeared for some reason ... So never mind

jwzh.hi@gmail.com (JIRA)

unread,
Feb 3, 2016, 1:41:01 AM2/3/16
to jenkinsc...@googlegroups.com
Wenzheng Jiang updated an issue
Change By: Wenzheng Jiang
When using customTools plugin, I export the installation path by putting them in "Exported paths".  But these paths don't appear later in PATH in matrixjobs, while it works fine in freestylejobs. 

My installer configuration is :

Name: phpenv
Exported paths; phpenv/bin,phpenv/shims
Command :
```
export PHPENV_ROOT=$(pwd)/phpenv
export PATH="$PATH:$PHPENV_ROOT/bin"

(
    if ! flock --exclusive --nonblock 9; then
        flock --exclusive 9
        exit 1
    fi
    
    if test -d $PHPENV_ROOT; then
       echo 'phpenv installed'
    else
        curl -L http://git.io/phpenv-installer | bash
    fi
    
    if ! test -d $PHPENV_ROOT/shims; then
        mkdir $PHPENV_ROOT/shims
    fi
) 9>phpenv.lock

eval "$(phpenv init -)"
```

My Job configuration is 

Axis config:
Name: PHP_VERSION
Value: 5.3.29 5.4.45 5.5.30


Build config:
```
phpenv versions | grep ${PHP_VERSION} || phpenv install ${PHP_VERSION}
```

In the building process, I got 'phpenv not found' error and reason is the installation path is not in $PATH.

This problem is solved !

jwzh.hi@gmail.com (JIRA)

unread,
Feb 3, 2016, 5:34:02 PM2/3/16
to jenkinsc...@googlegroups.com

jwzh.hi@gmail.com (JIRA)

unread,
Feb 3, 2016, 5:36:01 PM2/3/16
to jenkinsc...@googlegroups.com
 
Re: Unable to export path in matrix jobs.

Sorry, I'm fairly sure the problem is still there.

josh@freelancer.com (JIRA)

unread,
Feb 3, 2016, 8:39:02 PM2/3/16
to jenkinsc...@googlegroups.com

Yeah, I'm seeing this issue as well. Could it be related to JENKINS-32724?

josh@freelancer.com (JIRA)

unread,
Feb 3, 2016, 8:41:01 PM2/3/16
to jenkinsc...@googlegroups.com

I put a shell step into the job which ran `env`. Looking at the output, `$PATH` does not seem to be set correctly (notice the `::`):

```
PATH=/mnt/jenkins-slave-workspace/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/arcanist:/mnt/jenkins-slave-workspace/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/arcanist/arcanist/bin::/home/jenkins-slave/.composer/vendor/bin:/home/jenkins-slave/.composer/vendor/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/jenkins-slave/.rvm/bin:/home/jenkins-slave/.rvm/bin:/home/jenkins-slave/.rvm/bin:/home/jenkins-slave/.rvm/bin:/home/jenkins-slave/.composer/vendor/bin:/home/jenkins-slave/.composer/vendor/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/jenkins-slave/.rvm/bin:/home/jenkins-slave/.rvm/bin:/home/jenkins-slave/.rvm/bin:/home/jenkins-slave/.rvm/bin
```

josh@freelancer.com (JIRA)

unread,
Feb 3, 2016, 8:48:02 PM2/3/16
to jenkinsc...@googlegroups.com

Ah interesting... it may be because we are using two custom tools in the same job. If I remove the first custom tool then it works as expected.

josh@freelancer.com (JIRA)

unread,
Feb 3, 2016, 8:54:01 PM2/3/16
to jenkinsc...@googlegroups.com

OK, so this doesn't work:

```
<com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper>
<selectedTools>
<com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper_-SelectedTool>
<name>arcanist</name>
</com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper_-SelectedTool>
</selectedTools>
<multiconfigOptions>
<skipMasterInstallation>false</skipMasterInstallation>
</multiconfigOptions>
<convertHomesToUppercase>false</convertHomesToUppercase>
</com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper>
<com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper>
<selectedTools>
<com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper_-SelectedTool>
<name>phpenv</name>
</com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper_-SelectedTool>
</selectedTools>
<multiconfigOptions>
<skipMasterInstallation>false</skipMasterInstallation>
</multiconfigOptions>
<convertHomesToUppercase>false</convertHomesToUppercase>
</com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper>
```

But this does work:

```
<com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper>
<selectedTools>
<com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper_-SelectedTool>
<name>arcanist</name>
</com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper_-SelectedTool>
<com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper_-SelectedTool>
<name>phpenv</name>
</com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper_-SelectedTool>
</selectedTools>
<multiconfigOptions>
<skipMasterInstallation>false</skipMasterInstallation>
</multiconfigOptions>
<convertHomesToUppercase>false</convertHomesToUppercase>
</com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper>
```

o.v.nenashev@gmail.com (JIRA)

unread,
Feb 4, 2016, 2:10:02 AM2/4/16
to jenkinsc...@googlegroups.com
Oleg Nenashev edited a comment on Bug JENKINS-32739
[~joshuaspence]
How have you managed to add two instances of the Build Wrapper into your job configuration
. ?
AFAIK Jenkins core is not designed in such way, and the plugin also won't work correctly with such configuration.
Have you edited the config.xml file manually?

o.v.nenashev@gmail.com (JIRA)

unread,
Feb 4, 2016, 2:10:03 AM2/4/16
to jenkinsc...@googlegroups.com


How have you managed to add two instances of the Build Wrapper into your job configuration.

AFAIK Jenkins core is not designed in such way, and the plugin also won't work correctly with such configuration.
Have you edited the config.xml file manually?

josh@freelancer.com (JIRA)

unread,
Feb 4, 2016, 2:12:01 AM2/4/16
to jenkinsc...@googlegroups.com

o.v.nenashev@gmail.com (JIRA)

unread,
Feb 4, 2016, 2:16:01 AM2/4/16
to jenkinsc...@googlegroups.com

jwzh.hi@gmail.com (JIRA)

unread,
Feb 4, 2016, 5:59:02 AM2/4/16
to jenkinsc...@googlegroups.com

Same situation here.

Below dsl code can generate the "incorrect" xml

Unable to find source-code formatter for language: groovy. Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml
customtools['arcanist'] 
customtools['phpenv']

Where

Unable to find source-code formatter for language: groovy. Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml
customtools['arcanist', 'phpenv'] 

generates the "correct" xml.

jwzh.hi@gmail.com (JIRA)

unread,
Feb 4, 2016, 6:03:02 AM2/4/16
to jenkinsc...@googlegroups.com
Wenzheng Jiang edited a comment on Bug JENKINS-32739
Same situation here.

Below dsl code can generate the "incorrect" xml
{code: groovy java }
customtools['arcanist'] 
customtools['phpenv']
{code}
 Where 
{code:
groovy java }
customtools['arcanist', 'phpenv'] 
{code}
generates the "correct" xml.

o.v.nenashev@gmail.com (JIRA)

unread,
Feb 4, 2016, 6:18:01 AM2/4/16
to jenkinsc...@googlegroups.com
Oleg Nenashev updated an issue
 
Change By: Oleg Nenashev
Component/s: job-dsl-plugin
Component/s: customtools-plugin

o.v.nenashev@gmail.com (JIRA)

unread,
Feb 4, 2016, 6:18:02 AM2/4/16
to jenkinsc...@googlegroups.com
Oleg Nenashev assigned an issue to Daniel Spilker
Change By: Oleg Nenashev
Assignee: Oleg Nenashev Daniel Spilker

o.v.nenashev@gmail.com (JIRA)

unread,
Feb 4, 2016, 6:20:01 AM2/4/16
to jenkinsc...@googlegroups.com
Oleg Nenashev commented on Bug JENKINS-32739
 
Re: Unable to export path in matrix jobs.

So it's not a bug in Custom Tools Plugin.
Passing it to Daniel Spilker. Maybe he accepts it as an improvement to JobDSL

jwzh.hi@gmail.com (JIRA)

unread,
Feb 4, 2016, 6:22:01 AM2/4/16
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages