Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jira-importer opened this issue Apr 15, 2015 · 22 comments

Comments

@jira-importer
Copy link
Collaborator

Please add support for the Jenkins Workflow plugin. Thanks!


Originally reported by fishnix, imported from: Please add support for jenkins pipeline plugin to publish-over-ssh
  • assignee: slide_o_mix
  • status: Resolved
  • priority: Critical
  • resolution: Fixed
  • resolved: 2018-04-29T09:22:01+10:00
  • imported: 2022/01/10
@jira-importer
Copy link
Collaborator Author

jglick:

Not really essential, since you could already write something like

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

@jira-importer
Copy link
Collaborator Author

rtyler:

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.

@jira-importer
Copy link
Collaborator Author

vijaysl:

The sshagent doesn't appear to support username password authentication

@jira-importer
Copy link
Collaborator Author

pmarcoen:

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

@jira-importer
Copy link
Collaborator Author

budhi003:

Hi Jesse, Peter,

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

Thanks

@jira-importer
Copy link
Collaborator Author

pmarcoen:

Ashudeep Budhiraja I think you need the SSH Agent Plugin (https://wiki.jenkins-ci.org/display/JENKINS/SSH+Agent+Plugin)

@jira-importer
Copy link
Collaborator Author

budhi003:

Thanks Peter.

@jira-importer
Copy link
Collaborator Author

russo79:

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?

@jira-importer
Copy link
Collaborator Author

clausfod:

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 ?

@jira-importer
Copy link
Collaborator Author

scm_issue_link:

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.

@jira-importer
Copy link
Collaborator Author

eman:

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

@jira-importer
Copy link
Collaborator Author

slide_o_mix:

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

@jira-importer
Copy link
Collaborator Author

slide_o_mix:

Fixed in 1.19

@jira-importer
Copy link
Collaborator Author

tapsa:

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

@jira-importer
Copy link
Collaborator Author

phreakadelle:

Alex Earl: 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(<span class="code-quote">'Download'</span>) {
			steps {
				sshPublisher(publishers: [sshPublisherDesc(configName: $serverHostname, transfers: [sshTransfer(execCommand: '''
					echo <span class="code-quote">"INFO: Downloading $filename from $ReleaseNumber"</span>
					echo <span class="code-quote">"INFO: $serverHostname"</span>
				<span class="code-quote">''', execTimeout: 120000, sourceFiles: '</span>')], usePromotionTimestamp: <span class="code-keyword">false</span>, useWorkspaceInPromotion: <span class="code-keyword">false</span>, verbose: <span class="code-keyword">false</span>)])
			}
		}
	}
}

}

@jira-importer
Copy link
Collaborator Author

gemorroj:

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

  • Remove prefix
  • Remote directory

this is important regression

@jira-importer
Copy link
Collaborator Author

ssbarnea:

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.

@jira-importer
Copy link
Collaborator Author

slide_o_mix:

Gemor Roj Please open a new issue.

Sorin Sbarnea 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.

@jira-importer
Copy link
Collaborator Author

[Originally duplicated by: JENKINS-49716]

@jira-importer
Copy link
Collaborator Author

[Originally duplicated by: JENKINS-49728]

@jira-importer
Copy link
Collaborator Author

[Originally related to: JENKINS-49770]

@jira-importer
Copy link
Collaborator Author

[Originally related to: JENKINS-49716]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant