Skip to content

Commit

Permalink
Docs/file transfer protocols (jenkinsci#98)
Browse files Browse the repository at this point in the history
* Update docs with valid file transfer protocols

According to the Groovy docs for fileTransfer protocols the valid
options are in lower case. Reference found here:
https://javadoc.io/doc/org.hidetake/groovy-ssh/latest/org/hidetake/groovy/ssh/session/transfer/FileTransferMethod.html

* Add another sshGet example

Some useful options for the sshGet commands lacked examples, e.g.,
filterRegex, and as such another example stage was added.

---------

Co-authored-by: Daniel Edholm <[email protected]>
  • Loading branch information
yarcod and yarcod-zpt authored Oct 14, 2023
1 parent e0b1aad commit 911bf2a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Most of the steps in this plugin require a common step variable called `remote`,

|fileTransfer
|String
|File transfer method, that is `SFTP` or `SCP`. Defaults to `SFTP`.
|File transfer method, that is `sftp` or `scp`. Defaults to `sftp`.

|encoding
|String
Expand Down Expand Up @@ -373,12 +373,17 @@ node {
def remote = [:]
remote.name = 'test'
remote.host = 'test.domain.com'
remote.fileTransfer = 'scp'
remote.user = 'root'
remote.password = 'password'
remote.allowAnyHosts = true
stage('Remote SSH') {
sshGet remote: remote, from: 'abc.sh', into: 'abc_get.sh', override: true
}
stage('Retrieve files with regex') {
def regexPattern = ".+\\.(log|csv)\$"
sshGet remote: remote, from: '/home/jenkins/', filterRegex: regexPattern, into: 'tests/', override: true
}
}
```

Expand Down

0 comments on commit 911bf2a

Please sign in to comment.