Bug Publish over SSH

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug Publish over SSH

Erick Macedo
Hi,

I'm using the plugin Publish over SSH to run a remote command maven on a linux machine with properly configured maven.

However when running mvn command is generated an error "bash: mvn: command not found".

The plugin is properly connecting the remote machine, as for testing in the "Exec command" I include the command "ifconfig" and the same printed data from the remote machine.

However, when performing the command echo $ M2_HOME or echo $ PATH in the "Exec command" he printed the local machine where the information jenkins is the created, not the remote machine.

Something very strange.

Someone could help me?

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/05c8eac6-eeca-488a-a9ce-3e4a31dae3c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Bug Publish over SSH

Erick Macedo
I can not understand this behavior.

In Exec command: cd test / build-38 / project && ls && echo $ M2 && mvn -v

This command does the following:

1 - cd test / build-38 / project (in this directory on the remote server)
2 - ls (list the remote server content)
3 - echo $ M2 (Prints $ M2 LOCAL server, where the jenkins is the created)
4 - mvn -v (bash: mvn: command not found, here is also strange because mvn -v works both on the local server, and the remote)

Em terça-feira, 28 de abril de 2015 16:25:21 UTC-3, Erick Macedo escreveu:
Hi,

I'm using the plugin Publish over SSH to run a remote command maven on a linux machine with properly configured maven.

However when running mvn command is generated an error "bash: mvn: command not found".

The plugin is properly connecting the remote machine, as for testing in the "Exec command" I include the command "ifconfig" and the same printed data from the remote machine.

However, when performing the command echo $ M2_HOME or echo $ PATH in the "Exec command" he printed the local machine where the information jenkins is the created, not the remote machine.

Something very strange.

Someone could help me?

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/24f4e71d-fba0-468d-8047-44d6f4c48225%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Bug Publish over SSH

slide
It works as the user that you are connecting as? Is there anything in the .bashrc that would set the path to mvn? Perhaps the Publish Over SSH doesn't run in such a way that the .bashrc file is loaded? Check into these things.

On Tue, Apr 28, 2015 at 1:19 PM Erick Macedo <[hidden email]> wrote:
I can not understand this behavior.

In Exec command: cd test / build-38 / project && ls && echo $ M2 && mvn -v

This command does the following:

1 - cd test / build-38 / project (in this directory on the remote server)
2 - ls (list the remote server content)
3 - echo $ M2 (Prints $ M2 LOCAL server, where the jenkins is the created)
4 - mvn -v (bash: mvn: command not found, here is also strange because mvn -v works both on the local server, and the remote)

Em terça-feira, 28 de abril de 2015 16:25:21 UTC-3, Erick Macedo escreveu:
Hi,

I'm using the plugin Publish over SSH to run a remote command maven on a linux machine with properly configured maven.

However when running mvn command is generated an error "bash: mvn: command not found".

The plugin is properly connecting the remote machine, as for testing in the "Exec command" I include the command "ifconfig" and the same printed data from the remote machine.

However, when performing the command echo $ M2_HOME or echo $ PATH in the "Exec command" he printed the local machine where the information jenkins is the created, not the remote machine.

Something very strange.

Someone could help me?

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/24f4e71d-fba0-468d-8047-44d6f4c48225%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVd2--GmN5YBMqPOf6%3DLUnG3JUz%2BASpV0WuRC%3DhL376rMQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Bug Publish over SSH

Richard Bywater-2
To that effect, check your .bashrc as on Debian, for instance, one of the first things it does it not run anything in .bashrc if not starting as an interactive process.

Richard.

On Wed, 29 Apr 2015 at 08:41 Slide <[hidden email]> wrote:
It works as the user that you are connecting as? Is there anything in the .bashrc that would set the path to mvn? Perhaps the Publish Over SSH doesn't run in such a way that the .bashrc file is loaded? Check into these things.

On Tue, Apr 28, 2015 at 1:19 PM Erick Macedo <[hidden email]> wrote:
I can not understand this behavior.

In Exec command: cd test / build-38 / project && ls && echo $ M2 && mvn -v

This command does the following:

1 - cd test / build-38 / project (in this directory on the remote server)
2 - ls (list the remote server content)
3 - echo $ M2 (Prints $ M2 LOCAL server, where the jenkins is the created)
4 - mvn -v (bash: mvn: command not found, here is also strange because mvn -v works both on the local server, and the remote)

Em terça-feira, 28 de abril de 2015 16:25:21 UTC-3, Erick Macedo escreveu:
Hi,

I'm using the plugin Publish over SSH to run a remote command maven on a linux machine with properly configured maven.

However when running mvn command is generated an error "bash: mvn: command not found".

The plugin is properly connecting the remote machine, as for testing in the "Exec command" I include the command "ifconfig" and the same printed data from the remote machine.

However, when performing the command echo $ M2_HOME or echo $ PATH in the "Exec command" he printed the local machine where the information jenkins is the created, not the remote machine.

Something very strange.

Someone could help me?

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/24f4e71d-fba0-468d-8047-44d6f4c48225%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVd2--GmN5YBMqPOf6%3DLUnG3JUz%2BASpV0WuRC%3DhL376rMQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAMui945yYL5FgJYDD6iFVWWdGe-p6JTCjn28F0KFDez3_1jRLg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Bug Publish over SSH

Erick Macedo
In reply to this post by Erick Macedo
Hi,

The user I am connecting is the correct user, not root.

Are you referring to .bashrc the right remote machine?

Is remote machine is a Ubuntu and the .bashrc is so.

# JAVA
export JAVA_HOME = / usr / lib / jvm / java-8-oracle

# MAVEN
export MAVEN_HOME = / usr / local / apache-maven-3.2.5
export M2_HOME = / usr / local / apache-maven-3.2.5
export M2 = $ M2_HOME / bin
export PATH = $ M2: $ PATH

A very strange thing is that when I run the echo $ PATH in the "Exec command" it prints the variables of the local machine.


Em terça-feira, 28 de abril de 2015 16:25:21 UTC-3, Erick Macedo escreveu:
Hi,

I'm using the plugin Publish over SSH to run a remote command maven on a linux machine with properly configured maven.

However when running mvn command is generated an error "bash: mvn: command not found".

The plugin is properly connecting the remote machine, as for testing in the "Exec command" I include the command "ifconfig" and the same printed data from the remote machine.

However, when performing the command echo $ M2_HOME or echo $ PATH in the "Exec command" he printed the local machine where the information jenkins is the created, not the remote machine.

Something very strange.

Someone could help me?

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/d92784d9-0141-4ef1-a240-8570c627e302%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Bug Publish over SSH

Jeff Vincent
This might be an ignorant question but why are you using the "Publish over SSH" plugin instead of the "SSH plugin"? https://wiki.jenkins-ci.org/display/JENKINS/SSH+plugin

On Tue, Apr 28, 2015 at 3:16 PM, Erick Macedo <[hidden email]> wrote:
Hi,

The user I am connecting is the correct user, not root.

Are you referring to .bashrc the right remote machine?

Is remote machine is a Ubuntu and the .bashrc is so.

# JAVA
export JAVA_HOME = / usr / lib / jvm / java-8-oracle

# MAVEN
export MAVEN_HOME = / usr / local / apache-maven-3.2.5
export M2_HOME = / usr / local / apache-maven-3.2.5
export M2 = $ M2_HOME / bin
export PATH = $ M2: $ PATH

A very strange thing is that when I run the echo $ PATH in the "Exec command" it prints the variables of the local machine.


Em terça-feira, 28 de abril de 2015 16:25:21 UTC-3, Erick Macedo escreveu:
Hi,

I'm using the plugin Publish over SSH to run a remote command maven on a linux machine with properly configured maven.

However when running mvn command is generated an error "bash: mvn: command not found".

The plugin is properly connecting the remote machine, as for testing in the "Exec command" I include the command "ifconfig" and the same printed data from the remote machine.

However, when performing the command echo $ M2_HOME or echo $ PATH in the "Exec command" he printed the local machine where the information jenkins is the created, not the remote machine.

Something very strange.

Someone could help me?

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/d92784d9-0141-4ef1-a240-8570c627e302%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Jeff Vincent
See my LinkedIn profile at:
http://www.linkedin.com/in/rjeffreyvincent

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAPJK9%3DJwstGntydh%2B9NgR7fGOrty_0-EB5CXF_jwaLn%2Bk5Ucuw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Bug Publish over SSH

Erick Macedo
In reply to this post by Erick Macedo
The plugin "SSH plugin" only allows you to run an SSH command on the server, since the "Publish over SSH" lets you send data and execute any command.

Out of curiosity I auditioned with "SSH plugin" and it also returns mvn: command not found, which leads me to understand that the problem is not in the plugins


Em terça-feira, 28 de abril de 2015 16:25:21 UTC-3, Erick Macedo escreveu:
Hi,

I'm using the plugin Publish over SSH to run a remote command maven on a linux machine with properly configured maven.

However when running mvn command is generated an error "bash: mvn: command not found".

The plugin is properly connecting the remote machine, as for testing in the "Exec command" I include the command "ifconfig" and the same printed data from the remote machine.

However, when performing the command echo $ M2_HOME or echo $ PATH in the "Exec command" he printed the local machine where the information jenkins is the created, not the remote machine.

Something very strange.

Someone could help me?

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6314b01c-2b24-476a-b22b-b8ca23cb4e55%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Bug Publish over SSH

Erick Macedo
In reply to this post by Erick Macedo
Hi Richard,

What would this interactive process,

could exemplify?

obrigaod

Em terça-feira, 28 de abril de 2015 16:25:21 UTC-3, Erick Macedo escreveu:
Hi,

I'm using the plugin Publish over SSH to run a remote command maven on a linux machine with properly configured maven.

However when running mvn command is generated an error "bash: mvn: command not found".

The plugin is properly connecting the remote machine, as for testing in the "Exec command" I include the command "ifconfig" and the same printed data from the remote machine.

However, when performing the command echo $ M2_HOME or echo $ PATH in the "Exec command" he printed the local machine where the information jenkins is the created, not the remote machine.

Something very strange.

Someone could help me?

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/d9b2b970-5fed-4df9-8f6c-dfa10e3489e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Bug Publish over SSH

Richard Bywater-2
An interactive process is when you as a person connect to it rather than an system process (like Jenkins).

For instance one of the .bashrc files on one of my systems has this has its first thing:
# If not running interactively, don't do anything
case $- in
  *i*) ;;
  *) return;;
esac

(There are other variants of doing the similar thing that I've seen in other .bashrcs)

Hope that helps
Richard.

On Thu, 30 Apr 2015 at 02:45 Erick Macedo <[hidden email]> wrote:
Hi Richard,

What would this interactive process,

could exemplify?

obrigaod

Em terça-feira, 28 de abril de 2015 16:25:21 UTC-3, Erick Macedo escreveu:
Hi,

I'm using the plugin Publish over SSH to run a remote command maven on a linux machine with properly configured maven.

However when running mvn command is generated an error "bash: mvn: command not found".

The plugin is properly connecting the remote machine, as for testing in the "Exec command" I include the command "ifconfig" and the same printed data from the remote machine.

However, when performing the command echo $ M2_HOME or echo $ PATH in the "Exec command" he printed the local machine where the information jenkins is the created, not the remote machine.

Something very strange.

Someone could help me?

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/d9b2b970-5fed-4df9-8f6c-dfa10e3489e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAMui945NYn3%3D6ZpDhimDZm9_c-AsSLwQ3FHfdeyChCOZ4RBA-A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Bug Publish over SSH

Daniel Beck
In reply to this post by Erick Macedo
If you expect your command to have these values set from .bashrc: .bashrc is only loaded for interactive shells, which the Publish over SSH plugin likely is not. Find another way to define these, or explicitly load (source) .bashrc. 'man bash', section 'invocation'

On 28.04.2015, at 23:16, Erick Macedo <[hidden email]> wrote:

> Hi,
>
> The user I am connecting is the correct user, not root.
>
> Are you referring to .bashrc the right remote machine?
>
> Is remote machine is a Ubuntu and the .bashrc is so.
>
> # JAVA
> export JAVA_HOME = / usr / lib / jvm / java-8-oracle
>
> # MAVEN
> export MAVEN_HOME = / usr / local / apache-maven-3.2.5
> export M2_HOME = / usr / local / apache-maven-3.2.5
> export M2 = $ M2_HOME / bin
> export PATH = $ M2: $ PATH
>
> A very strange thing is that when I run the echo $ PATH in the "Exec command" it prints the variables of the local machine.
>
> Em terça-feira, 28 de abril de 2015 16:25:21 UTC-3, Erick Macedo escreveu:
> Hi,
>
> I'm using the plugin Publish over SSH to run a remote command maven on a linux machine with properly configured maven.
>
> However when running mvn command is generated an error "bash: mvn: command not found".
>
> The plugin is properly connecting the remote machine, as for testing in the "Exec command" I include the command "ifconfig" and the same printed data from the remote machine.
>
> However, when performing the command echo $ M2_HOME or echo $ PATH in the "Exec command" he printed the local machine where the information jenkins is the created, not the remote machine.
>
> Something very strange.
>
> Someone could help me?
>
> --
> 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 [hidden email].
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/d92784d9-0141-4ef1-a240-8570c627e302%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/4BCB3283-4AF9-4E10-9225-A62CFF9A4452%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Bug Publish over SSH

Naveen DN
In reply to this post by Erick Macedo
I had the same problem...export PATH=$PATH:<maven directory/bin> && mvn clean test solved my problem


On Wednesday, April 29, 2015 at 12:55:21 AM UTC+5:30, Erick Macedo wrote:
Hi,

I'm using the plugin Publish over SSH to run a remote command maven on a linux machine with properly configured maven.

However when running mvn command is generated an error "bash: mvn: command not found".

The plugin is properly connecting the remote machine, as for testing in the "Exec command" I include the command "ifconfig" and the same printed data from the remote machine.

However, when performing the command echo $ M2_HOME or echo $ PATH in the "Exec command" he printed the local machine where the information jenkins is the created, not the remote machine.

Something very strange.

Someone could help me?

Disclaimer: This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended addressee, or the person responsible for delivering it to them, you may not copy, forward disclose or otherwise use it or any part of it in any way. To do so may be unlawful. If you receive this e-mail by mistake, please advise the sender immediately.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6293456d-6086-4952-8af3-a4cbd7bc61f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.