Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-27963

Please add support for jenkins pipeline plugin to publish-over-ssh

      Please add support for the Jenkins Workflow plugin. Thanks!

          [JENKINS-27963] Please add support for jenkins pipeline plugin to publish-over-ssh

          Jesse Glick added a comment -

          Not really essential, since you could already write something like

          sshagent(['my-private-key-credentials-ID']) {
            sh 'scp some-file www@somewhere.net:/apps'
          }
          

          Jesse Glick added a comment - Not really essential, since you could already write something like sshagent([ 'my- private -key-credentials-ID' ]) { sh 'scp some-file www@somewhere.net:/apps' }

          R. Tyler Croy added a comment -

          We're doing something similar for the jenkins website deployment Jenkinsfile.

          it's not exactly ideal, but it works on *nix-type systems which provide scp/sftp command line tools (read: non-Windows). The [Publish Over SSH](https://wiki.jenkins-ci.org/display/JENKINS/Publish+Over+SSH+Plugin) plugin does provide a lot of useful advanced features which normal shelling out doesn't.

          I wouldn't say this is critical, but definitely would be nice IMHO.

          R. Tyler Croy added a comment - We're doing something similar for the jenkins website deployment Jenkinsfile . it's not exactly ideal, but it works on *nix-type systems which provide scp/sftp command line tools (read: non-Windows). The [Publish Over SSH] ( https://wiki.jenkins-ci.org/display/JENKINS/Publish+Over+SSH+Plugin ) plugin does provide a lot of useful advanced features which normal shelling out doesn't. I wouldn't say this is critical, but definitely would be nice IMHO.

          vijaysl added a comment -

          The sshagent doesn't appear to support username password authentication

          vijaysl added a comment - The sshagent doesn't appear to support username password authentication

          Peter Marcoen added a comment - - edited

          If anyone else has trouble implementing Jesse's workaround, know that when you enter global credentials you have to press 'Advanced' and enter an ID, this ID should be used, not the name given to the credential.

          Pretty confusing because the name can be used in the Job-step of ssh-agent but not in the Pipeline-step.
          This took me quite some time to figure out

          Peter Marcoen added a comment - - edited If anyone else has trouble implementing Jesse's workaround, know that when you enter global credentials you have to press 'Advanced' and enter an ID, this ID should be used, not the name given to the credential. Pretty confusing because the name can be used in the Job-step of ssh-agent but not in the Pipeline-step. This took me quite some time to figure out

          Hi Jesse, Peter,

          Getting - java.lang.NoSuchMethodError: No such DSL method 'sshagent' found among

          Thanks

          Ashudeep Budhiraja added a comment - Hi Jesse, Peter, Getting - java.lang.NoSuchMethodError: No such DSL method 'sshagent' found among Thanks

          Peter Marcoen added a comment -

          Peter Marcoen added a comment - budhi003 I think you need the SSH Agent Plugin ( https://wiki.jenkins-ci.org/display/JENKINS/SSH+Agent+Plugin )

          Thanks Peter.

          Ashudeep Budhiraja added a comment - Thanks Peter.

          Riccardo Russo added a comment - - edited

          Hello,
          sshagent does not support username and password but only private key + passphrase!

          Moreover now, for me, that plugin is not working because of boucycaste plugin (

          org.bouncycastle.openssl.PEMException: Unable to create OpenSSL PBDKF: PBKDF-OpenSSL SecretKeyFactory not available
          

          ). There is a ticket already opened.

          Just to know: will the plugin be available from Pipeline plugin?

          Riccardo Russo added a comment - - edited Hello, sshagent does not support username and password but only private key + passphrase! Moreover now, for me, that plugin is not working because of boucycaste plugin ( org.bouncycastle.openssl.PEMException: Unable to create OpenSSL PBDKF: PBKDF-OpenSSL SecretKeyFactory not available ). There is a ticket already opened. Just to know: will the plugin be available from Pipeline plugin?

          clausfod added a comment -

          You can of course do it all yourselve with the SSH Agent plugin - but the nice features provided by the Publish Over SSH plugin is not available unless you "code" it yourselve.

          So I would like to know also - Is the plugin planned to be available from the Pipeline plugin ?

          clausfod added a comment - You can of course do it all yourselve with the SSH Agent plugin - but the nice features provided by the Publish Over SSH plugin is not available unless you "code" it yourselve. So I would like to know also - Is the plugin planned to be available from the Pipeline plugin ?

          Code changed in jenkins
          User: Alex Earl
          Path:
          pom.xml
          src/main/java/jenkins/plugins/publish_over_ssh/BapSshHostConfiguration.java
          src/main/java/jenkins/plugins/publish_over_ssh/BapSshPromotionPublisherPlugin.java
          src/main/java/jenkins/plugins/publish_over_ssh/BapSshPublisherPlugin.java
          src/main/java/jenkins/plugins/publish_over_ssh/BapSshTransfer.java
          src/main/java/jenkins/plugins/publish_over_ssh/descriptor/BapSshPublisherDescriptor.java
          src/main/java/jenkins/plugins/publish_over_ssh/descriptor/BapSshTransferDescriptor.java
          http://jenkins-ci.org/commit/publish-over-ssh-plugin/8a78eeb871f60cbfe37a05db1e95500c48badc60
          Log:
          Fix JENKINS-27963

          Added @Symbol annotations and cleaned up the constructors a bit.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Alex Earl Path: pom.xml src/main/java/jenkins/plugins/publish_over_ssh/BapSshHostConfiguration.java src/main/java/jenkins/plugins/publish_over_ssh/BapSshPromotionPublisherPlugin.java src/main/java/jenkins/plugins/publish_over_ssh/BapSshPublisherPlugin.java src/main/java/jenkins/plugins/publish_over_ssh/BapSshTransfer.java src/main/java/jenkins/plugins/publish_over_ssh/descriptor/BapSshPublisherDescriptor.java src/main/java/jenkins/plugins/publish_over_ssh/descriptor/BapSshTransferDescriptor.java http://jenkins-ci.org/commit/publish-over-ssh-plugin/8a78eeb871f60cbfe37a05db1e95500c48badc60 Log: Fix JENKINS-27963 Added @Symbol annotations and cleaned up the constructors a bit.

          Ed Lomonaco added a comment -

          I'm taking a guess this should be available in the very near future?

          Ed Lomonaco added a comment - I'm taking a guess this should be available in the very near future?

          Alex Earl added a comment -

          Yes, I'll be doing a release this week.

          Alex Earl added a comment - Yes, I'll be doing a release this week.

          Alex Earl added a comment -

          Fixed in 1.19

          Alex Earl added a comment - Fixed in 1.19

          Very quickly tested this 1.19 and seams to work OK in pipeline and freestyle jobs. Thanks!

          Tapio Reijonen added a comment - Very quickly tested this 1.19 and seams to work OK in pipeline and freestyle jobs. Thanks!

          Stephan Watermeyer added a comment - - edited

          slide_o_mix: First test was also successful here. Still have two entries in the DropDown List:

          Further: Would it be possible to get the _configNamevalue _from a variable? Currently i need to hardcode this value in my pipeline...

          sshPublisher(publishers: [sshPublisherDe sc(configName: 'swpsci06', transfers: [sshTransfer(execCommand: '', execTimeout: 120000, sourceFiles: '')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])

          I would like to do something like. The variable "ReleaseNumber" is getting populate from my paramterized build.

          #!/usr/bin/env groovy
          
          def call(Map params = [:]) {
          	def serverHostname = "swpsws26"
          	
          	 pipeline {
          		agent any
          		
          		stages {
          			stage('Download') {
          				steps {
          					sshPublisher(publishers: [sshPublisherDesc(configName: $serverHostname, transfers: [sshTransfer(execCommand: '''
          						echo "INFO: Downloading $filename from $ReleaseNumber"
          						echo "INFO: $serverHostname"
          					''', execTimeout: 120000, sourceFiles: '')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])
          				}
          			}
          		}
          	}
          }
          
          

          Stephan Watermeyer added a comment - - edited slide_o_mix : First test was also successful here. Still have two entries in the DropDown List: Further: Would it be possible to get the _configNamevalue _from a variable? Currently i need to hardcode this value in my pipeline... sshPublisher(publishers: [sshPublisherDe sc(configName: 'swpsci06' , transfers: [sshTransfer(execCommand: '', execTimeout: 120000, sourceFiles: ' ')], usePromotionTimestamp: false , useWorkspaceInPromotion: false , verbose: false )]) I would like to do something like. The variable "ReleaseNumber" is getting populate from my paramterized build. #!/usr/bin/env groovy def call(Map params = [:]) { def serverHostname = "swpsws26" pipeline { agent any stages { stage( 'Download' ) { steps { sshPublisher(publishers: [sshPublisherDesc(configName: $serverHostname, transfers: [sshTransfer(execCommand: ''' echo "INFO: Downloading $filename from $ReleaseNumber" echo "INFO: $serverHostname" ''', execTimeout: 120000, sourceFiles: ' ')], usePromotionTimestamp: false , useWorkspaceInPromotion: false , verbose: false )]) } } } } }

          Gemor Roj added a comment - - edited

          after 1.19 settings are not saving (1.18 works fine).

          • Remove prefix
          • Remote directory

          this is important regression

          Gemor Roj added a comment - - edited after 1.19 settings are not saving ( 1.18 works fine). Remove prefix Remote directory this is important regression

          Sorin Sbarnea added a comment -

          As of latest version of the plugin and Jenkins (LTS) 2.89.4 this plugin does not expose any pipeline functionality.

          /pipeline-syntax/ - does not contain any ssh function listed (ticket screenshot is outdated because now the dropdown contains function names)

          /pipeline-syntax/html – does not contain any "ssh" occurence

          Jenkins log does not report any errors or warnings related to ssh plugin, and it was restarted after installation.

          Sorin Sbarnea added a comment - As of latest version of the plugin and Jenkins (LTS) 2.89.4 this plugin does not expose any pipeline functionality. /pipeline-syntax/ - does not contain any ssh function listed (ticket screenshot is outdated because now the dropdown contains function names) /pipeline-syntax/html – does not contain any "ssh" occurence Jenkins log does not report any errors or warnings related to ssh plugin, and it was restarted after installation.

          Alex Earl added a comment -

          gemorroj Please open a new issue.

          ssbarnea I am not able to reproduce your issue. I've attached my screenshot of running under 2.89.4 and using the pipeline syntax to generate snippets.

          Alex Earl added a comment - gemorroj Please open a new issue. ssbarnea I am not able to reproduce your issue. I've attached my screenshot of running under 2.89.4 and using the pipeline syntax to generate snippets.

          For your information, all publish-over-ssh component type JENKINS issues related to the Publish Over SSH plugin have been transferred to Github: https://github.com/jenkinsci/publish-over-ssh-plugin/issues

          Here is the direct link to this issue in Github: https://github.com/jenkinsci/publish-over-ssh-plugin/issues/160
          And here is the link to a search for related issues: https://github.com/jenkinsci/publish-over-ssh-plugin/issues?q=%22JENKINS-27963%22

          (Note: this is an automated bulk comment)

          Gavin McDonald added a comment - For your information, all publish-over-ssh component type JENKINS issues related to the Publish Over SSH plugin have been transferred to Github: https://github.com/jenkinsci/publish-over-ssh-plugin/issues Here is the direct link to this issue in Github: https://github.com/jenkinsci/publish-over-ssh-plugin/issues/160 And here is the link to a search for related issues: https://github.com/jenkinsci/publish-over-ssh-plugin/issues?q=%22JENKINS-27963%22 (Note: this is an automated bulk comment)

            slide_o_mix Alex Earl
            fishnix E Camden Fisher
            Votes:
            38 Vote for this issue
            Watchers:
            50 Start watching this issue

              Created:
              Updated:
              Resolved: