├── .editorconfig
├── .github
├── dependabot.yml
└── workflows
│ ├── cd.yaml
│ └── jenkins-security-scan.yml
├── .gitignore
├── .mvn
├── extensions.xml
└── maven.config
├── CHANGELOG.md
├── Jenkinsfile
├── README.md
├── docs
└── images
│ ├── global_ssh.png
│ ├── global_ssh_advanced.png
│ ├── pos-default.png
│ ├── pos-promotion.png
│ ├── pos-publisher-advanced.png
│ ├── pos-server-advanced.png
│ ├── ssh_builder.png
│ ├── ssh_global_configured.png
│ ├── ssh_publish_not_configured.png
│ └── transfer-adv.png
├── pom.xml
└── src
├── main
├── java
│ └── jenkins
│ │ └── plugins
│ │ └── publish_over_ssh
│ │ ├── BapSshAlwaysRunPublisherPlugin.java
│ │ ├── BapSshBuilderPlugin.java
│ │ ├── BapSshClient.java
│ │ ├── BapSshCommonConfiguration.java
│ │ ├── BapSshCredentials.java
│ │ ├── BapSshHostConfiguration.java
│ │ ├── BapSshKeyInfo.java
│ │ ├── BapSshParamPublish.java
│ │ ├── BapSshPostBuildWrapper.java
│ │ ├── BapSshPreBuildWrapper.java
│ │ ├── BapSshPromotionPublisherPlugin.java
│ │ ├── BapSshPublisher.java
│ │ ├── BapSshPublisherLabel.java
│ │ ├── BapSshPublisherPlugin.java
│ │ ├── BapSshRetry.java
│ │ ├── BapSshSftpSetupException.java
│ │ ├── BapSshTransfer.java
│ │ ├── BapSshTransferCache.java
│ │ ├── BapSshUtil.java
│ │ ├── descriptor
│ │ ├── BapSshCommonConfigurationDescriptor.java
│ │ ├── BapSshCredentialsDescriptor.java
│ │ ├── BapSshHostConfigurationDescriptor.java
│ │ ├── BapSshPublisherDescriptor.java
│ │ ├── BapSshPublisherPluginDescriptor.java
│ │ └── BapSshTransferDescriptor.java
│ │ └── options
│ │ ├── SshDefaults.java
│ │ ├── SshOptions.java
│ │ ├── SshOverrideDefaults.java
│ │ ├── SshOverrideInstanceConfigDefaults.java
│ │ ├── SshOverrideParamPublishDefaults.java
│ │ ├── SshOverridePublisherDefaults.java
│ │ ├── SshOverridePublisherLabelDefaults.java
│ │ ├── SshOverrideRetryDefaults.java
│ │ ├── SshOverrideTransferDefaults.java
│ │ ├── SshPluginDefaults.java
│ │ ├── SshPluginDefaultsHandler.java
│ │ └── SshTransferOptions.java
├── resources
│ ├── index.jelly
│ ├── jenkins
│ │ └── plugins
│ │ │ └── publish_over_ssh
│ │ │ ├── BapSshBuilderPlugin
│ │ │ ├── config.jelly
│ │ │ └── help.html
│ │ │ ├── BapSshCommonConfiguration
│ │ │ ├── config.jelly
│ │ │ ├── config.properties
│ │ │ ├── config_no_BV.properties
│ │ │ ├── help-disableAllExec.html
│ │ │ ├── help-encryptedPassphrase.html
│ │ │ ├── help-key.html
│ │ │ └── help-keyPath.html
│ │ │ ├── BapSshCredentials
│ │ │ ├── config.jelly
│ │ │ ├── config.properties
│ │ │ ├── config_no_BV.properties
│ │ │ ├── help-encryptedPassphrase.html
│ │ │ ├── help-key.html
│ │ │ ├── help-keyPath.html
│ │ │ └── help-username.html
│ │ │ ├── BapSshHostConfiguration
│ │ │ ├── config.jelly
│ │ │ ├── config.properties
│ │ │ ├── config_no_BV.properties
│ │ │ ├── help-avoidSameFileUploads.html
│ │ │ ├── help-disableExec.html
│ │ │ ├── help-encryptedPassword.html
│ │ │ ├── help-hostname.html
│ │ │ ├── help-jumpHost.html
│ │ │ ├── help-key.html
│ │ │ ├── help-keyPath.html
│ │ │ ├── help-name.html
│ │ │ ├── help-overrideKey.html
│ │ │ ├── help-port.html
│ │ │ ├── help-proxyHost.html
│ │ │ ├── help-proxyPassword.html
│ │ │ ├── help-proxyPort.html
│ │ │ ├── help-proxyType.html
│ │ │ ├── help-proxyUser.html
│ │ │ ├── help-remoteRootDir.html
│ │ │ ├── help-timeout.html
│ │ │ └── help-username.html
│ │ │ ├── BapSshParamPublish
│ │ │ ├── config.jelly
│ │ │ └── help-parameterName.html
│ │ │ ├── BapSshPostBuildWrapper
│ │ │ ├── config.jelly
│ │ │ └── help.html
│ │ │ ├── BapSshPreBuildWrapper
│ │ │ ├── config.jelly
│ │ │ └── help.html
│ │ │ ├── BapSshPromotionPublisherPlugin
│ │ │ ├── config.jelly
│ │ │ └── help.html
│ │ │ ├── BapSshPublisher
│ │ │ ├── config.jelly
│ │ │ ├── config.properties
│ │ │ ├── config_no_BV.properties
│ │ │ ├── help-configName.html
│ │ │ ├── help-sshCredentials.html
│ │ │ ├── help-sshLabel.html
│ │ │ ├── help-sshRetry.html
│ │ │ ├── help-usePromotionTimestamp.html
│ │ │ ├── help-useWorkspaceInPromotion.html
│ │ │ ├── help-useWorkspaceInPromotionForMatrix.html
│ │ │ └── help-verbose.html
│ │ │ ├── BapSshPublisherLabel
│ │ │ ├── config.jelly
│ │ │ └── help-label.html
│ │ │ ├── BapSshPublisherPlugin
│ │ │ ├── config.jelly
│ │ │ ├── config.properties
│ │ │ ├── config_no_BV.properties
│ │ │ ├── global.jelly
│ │ │ ├── global.properties
│ │ │ ├── global_no_BV.properties
│ │ │ ├── help-alwaysPublishFromMaster.html
│ │ │ ├── help-continueOnError.html
│ │ │ ├── help-defaultKeySummary.html
│ │ │ ├── help-failOnError.html
│ │ │ ├── help-masterNodeName.html
│ │ │ ├── help-paramPublish.jelly
│ │ │ └── help.html
│ │ │ ├── BapSshRetry
│ │ │ ├── config.jelly
│ │ │ ├── help-retries.html
│ │ │ └── help-retryDelay.html
│ │ │ ├── BapSshTransfer
│ │ │ ├── config.jelly
│ │ │ ├── config.properties
│ │ │ ├── config_no_BV.properties
│ │ │ ├── help-excludes.html
│ │ │ ├── help-execCommand.html
│ │ │ ├── help-execTimeout.html
│ │ │ ├── help-flatten.html
│ │ │ ├── help-keepFilePermissions.html
│ │ │ ├── help-makeEmptyDirs.html
│ │ │ ├── help-noDefaultExcludes.jelly
│ │ │ ├── help-patternSeparator.html
│ │ │ ├── help-remoteDirectory.html
│ │ │ ├── help-remoteDirectorySDF.html
│ │ │ ├── help-removePrefix.html
│ │ │ ├── help-sourceFiles.html
│ │ │ ├── help-sourceFilesForPromotion.html
│ │ │ ├── help-useAgentForwarding.html
│ │ │ ├── help-usePty.html
│ │ │ └── help-useSftpForExec.html
│ │ │ ├── Messages.properties
│ │ │ ├── Messages_no_BV.properties
│ │ │ └── options
│ │ │ ├── SshOverrideDefaults
│ │ │ └── config.jelly
│ │ │ ├── SshOverrideInstanceConfigDefaults
│ │ │ └── config.jelly
│ │ │ ├── SshOverridePublisherDefaults
│ │ │ ├── config.jelly
│ │ │ ├── config.properties
│ │ │ └── config_no_BV.properties
│ │ │ ├── SshOverrideTransferDefaults
│ │ │ ├── config.jelly
│ │ │ ├── config.properties
│ │ │ └── config_no_BV.properties
│ │ │ └── SshPluginDefaults
│ │ │ └── config.jelly
│ └── lib
│ │ └── publishoverssh
│ │ ├── blockWrapper.jelly
│ │ └── taglib
└── webapp
│ ├── LICENCE.html
│ └── js
│ └── pos.js
└── test
├── java
└── jenkins
│ └── plugins
│ └── publish_over_ssh
│ ├── BapSshClientTest.java
│ ├── BapSshHostConfigurationTest.java
│ ├── HostsHelperTest.java
│ ├── MySecretHelper.java
│ ├── SftpForExecTest.java
│ ├── helper
│ ├── BapSshTestHelper.java
│ └── RandomFile.java
│ └── jenkins
│ ├── IntegrationTest.java
│ ├── JenkinsTestHelper.java
│ └── LegacyConfigurationTest.java
└── resources
└── jenkins
└── plugins
└── publish_over_ssh
└── jenkins
└── LegacyConfigurationTest
├── testLoadR0x1
├── config.xml
├── jenkins.plugins.publish_over_ssh.BapSshPublisherPlugin.xml
└── jobs
│ └── test job
│ └── config.xml
├── testLoadR0x12
├── config.xml
├── identity.key
├── jenkins.plugins.publish_over_ssh.BapSshPublisherPlugin.xml
├── jobs
│ └── test job
│ │ ├── config.xml
│ │ └── nextBuildNumber
└── secret.key
└── testLoadR0x1Minimal
├── config.xml
├── jenkins.plugins.publish_over_ssh.BapSshPublisherPlugin.xml
└── jobs
└── test job
└── config.xml
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | indent_style = space
5 | indent_size = 2
6 | charset = utf-8
7 | trim_trailing_whitespace = true
8 | insert_final_newline = true
9 |
10 | [*.md]
11 | trim_trailing_whitespace = false
12 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: "maven"
4 | directory: "/"
5 | schedule:
6 | interval: "weekly"
7 |
8 | - package-ecosystem: "github-actions"
9 | directory: "/"
10 | schedule:
11 | interval: "weekly"
12 |
--------------------------------------------------------------------------------
/.github/workflows/cd.yaml:
--------------------------------------------------------------------------------
1 | # Note: additional setup is required, see https://www.jenkins.io/redirect/continuous-delivery-of-plugins
2 |
3 | name: cd
4 | on:
5 | workflow_dispatch:
6 | check_run:
7 | types:
8 | - completed
9 |
10 | jobs:
11 | maven-cd:
12 | uses: jenkins-infra/github-reusable-workflows/.github/workflows/maven-cd.yml@v1 # TODO main after https://github.com/jenkins-infra/github-reusable-workflows/pull/1
13 | secrets:
14 | MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
15 | MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
16 |
--------------------------------------------------------------------------------
/.github/workflows/jenkins-security-scan.yml:
--------------------------------------------------------------------------------
1 | name: Jenkins Security Scan
2 | on:
3 | push:
4 | branches:
5 | - main
6 | pull_request:
7 | types: [ opened, synchronize, reopened ]
8 | workflow_dispatch:
9 |
10 | permissions:
11 | security-events: write
12 | contents: read
13 | actions: read
14 |
15 | jobs:
16 | security-scan:
17 | uses: jenkins-infra/jenkins-security-scan/.github/workflows/jenkins-security-scan.yaml@v2
18 | with:
19 | java-cache: 'maven' # Optionally enable use of a build dependency cache. Specify 'maven' or 'gradle' as appropriate.
20 | # java-version: 21 # Optionally specify what version of Java to set up for the build, or remove to use a recent default.
21 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | #
2 | # The MIT License
3 | #
4 | # Copyright (C) 2010-2011 by Anthony Robinson
5 | #
6 | # Permission is hereby granted, free of charge, to any person obtaining a copy
7 | # of this software and associated documentation files (the "Software"), to deal
8 | # in the Software without restriction, including without limitation the rights
9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | # copies of the Software, and to permit persons to whom the Software is
11 | # furnished to do so, subject to the following conditions:
12 | #
13 | # The above copyright notice and this permission notice shall be included in
14 | # all copies or substantial portions of the Software.
15 | #
16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | # THE SOFTWARE.
23 | #
24 |
25 | .idea/
26 | target/
27 | *.iml
28 | out/
29 | *~
30 | work/
31 |
32 | /target
33 | .settings/
34 | .classpath
35 | .project
36 | **/.DS_Store
--------------------------------------------------------------------------------
/.mvn/extensions.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | io.jenkins.tools.incrementals
4 | git-changelist-maven-extension
5 | 1.8
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.mvn/maven.config:
--------------------------------------------------------------------------------
1 | -Pconsume-incrementals
2 | -Pmight-produce-incrementals
3 | -Dchangelist.format=%d.v%s
4 |
--------------------------------------------------------------------------------
/Jenkinsfile:
--------------------------------------------------------------------------------
1 | // Build the plugin using https://github.com/jenkins-infra/pipeline-library
2 | buildPlugin(useContainerAgent: true, configurations: [
3 | [platform: 'linux', jdk: 21],
4 | [platform: 'windows', jdk: 17],
5 | ])
6 |
--------------------------------------------------------------------------------
/docs/images/global_ssh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jenkinsci/publish-over-ssh-plugin/4ed3e8b7d739bab63fb3ce607bf17e9bb5b2c606/docs/images/global_ssh.png
--------------------------------------------------------------------------------
/docs/images/global_ssh_advanced.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jenkinsci/publish-over-ssh-plugin/4ed3e8b7d739bab63fb3ce607bf17e9bb5b2c606/docs/images/global_ssh_advanced.png
--------------------------------------------------------------------------------
/docs/images/pos-default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jenkinsci/publish-over-ssh-plugin/4ed3e8b7d739bab63fb3ce607bf17e9bb5b2c606/docs/images/pos-default.png
--------------------------------------------------------------------------------
/docs/images/pos-promotion.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jenkinsci/publish-over-ssh-plugin/4ed3e8b7d739bab63fb3ce607bf17e9bb5b2c606/docs/images/pos-promotion.png
--------------------------------------------------------------------------------
/docs/images/pos-publisher-advanced.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jenkinsci/publish-over-ssh-plugin/4ed3e8b7d739bab63fb3ce607bf17e9bb5b2c606/docs/images/pos-publisher-advanced.png
--------------------------------------------------------------------------------
/docs/images/pos-server-advanced.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jenkinsci/publish-over-ssh-plugin/4ed3e8b7d739bab63fb3ce607bf17e9bb5b2c606/docs/images/pos-server-advanced.png
--------------------------------------------------------------------------------
/docs/images/ssh_builder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jenkinsci/publish-over-ssh-plugin/4ed3e8b7d739bab63fb3ce607bf17e9bb5b2c606/docs/images/ssh_builder.png
--------------------------------------------------------------------------------
/docs/images/ssh_global_configured.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jenkinsci/publish-over-ssh-plugin/4ed3e8b7d739bab63fb3ce607bf17e9bb5b2c606/docs/images/ssh_global_configured.png
--------------------------------------------------------------------------------
/docs/images/ssh_publish_not_configured.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jenkinsci/publish-over-ssh-plugin/4ed3e8b7d739bab63fb3ce607bf17e9bb5b2c606/docs/images/ssh_publish_not_configured.png
--------------------------------------------------------------------------------
/docs/images/transfer-adv.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jenkinsci/publish-over-ssh-plugin/4ed3e8b7d739bab63fb3ce607bf17e9bb5b2c606/docs/images/transfer-adv.png
--------------------------------------------------------------------------------
/src/main/java/jenkins/plugins/publish_over_ssh/BapSshParamPublish.java:
--------------------------------------------------------------------------------
1 | /*
2 | * The MIT License
3 | *
4 | * Copyright (C) 2010-2011 by Anthony Robinson
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | * THE SOFTWARE.
23 | */
24 |
25 | package jenkins.plugins.publish_over_ssh;
26 |
27 | import hudson.Extension;
28 | import hudson.model.Describable;
29 | import hudson.model.Descriptor;
30 | import jenkins.model.Jenkins;
31 | import jenkins.plugins.publish_over.ParamPublish;
32 | import org.apache.commons.lang.builder.EqualsBuilder;
33 | import org.apache.commons.lang.builder.HashCodeBuilder;
34 | import org.apache.commons.lang.builder.ToStringBuilder;
35 | import org.apache.commons.lang.builder.ToStringStyle;
36 | import org.kohsuke.stapler.DataBoundConstructor;
37 |
38 | public class BapSshParamPublish extends ParamPublish implements Describable {
39 |
40 | private static final long serialVersionUID = 1L;
41 |
42 | @DataBoundConstructor
43 | public BapSshParamPublish(final String parameterName) {
44 | super(parameterName);
45 | }
46 |
47 | public BapSshParamPublishDescriptor getDescriptor() {
48 | return Jenkins.getInstance().getDescriptorByType(BapSshParamPublishDescriptor.class);
49 | }
50 |
51 | public boolean equals(final Object that) {
52 | if (this == that) return true;
53 | if (that == null || getClass() != that.getClass()) return false;
54 |
55 | return addToEquals(new EqualsBuilder(), (BapSshParamPublish) that).isEquals();
56 | }
57 |
58 | public int hashCode() {
59 | return addToHashCode(new HashCodeBuilder()).toHashCode();
60 | }
61 |
62 | public String toString() {
63 | return addToToString(new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)).toString();
64 | }
65 |
66 | @Extension
67 | public static class BapSshParamPublishDescriptor extends Descriptor {
68 |
69 | @Override
70 | public String getDisplayName() {
71 | return Messages.paramPublish_descriptor_displayName();
72 | }
73 |
74 | public jenkins.plugins.publish_over.view_defaults.ParamPublish.Messages getCommonFieldNames() {
75 | return new jenkins.plugins.publish_over.view_defaults.ParamPublish.Messages();
76 | }
77 |
78 | }
79 |
80 | }
81 |
--------------------------------------------------------------------------------
/src/main/java/jenkins/plugins/publish_over_ssh/BapSshPublisherLabel.java:
--------------------------------------------------------------------------------
1 | /*
2 | * The MIT License
3 | *
4 | * Copyright (C) 2010-2011 by Anthony Robinson
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | * THE SOFTWARE.
23 | */
24 |
25 | package jenkins.plugins.publish_over_ssh;
26 |
27 | import hudson.Extension;
28 | import hudson.model.Describable;
29 | import hudson.model.Descriptor;
30 | import jenkins.model.Jenkins;
31 | import jenkins.plugins.publish_over.PublisherLabel;
32 | import org.apache.commons.lang.builder.EqualsBuilder;
33 | import org.apache.commons.lang.builder.HashCodeBuilder;
34 | import org.apache.commons.lang.builder.ToStringBuilder;
35 | import org.apache.commons.lang.builder.ToStringStyle;
36 | import org.kohsuke.stapler.DataBoundConstructor;
37 |
38 | public class BapSshPublisherLabel extends PublisherLabel implements Describable {
39 |
40 | private static final long serialVersionUID = 1L;
41 |
42 | @DataBoundConstructor
43 | public BapSshPublisherLabel(final String label) {
44 | super(label);
45 | }
46 |
47 | public BapSshPublisherLabelDescriptor getDescriptor() {
48 | return Jenkins.getInstance().getDescriptorByType(BapSshPublisherLabelDescriptor.class);
49 | }
50 |
51 | public boolean equals(final Object that) {
52 | if (this == that) return true;
53 | if (that == null || getClass() != that.getClass()) return false;
54 |
55 | return addToEquals(new EqualsBuilder(), (BapSshPublisherLabel) that).isEquals();
56 | }
57 |
58 | public int hashCode() {
59 | return addToHashCode(new HashCodeBuilder()).toHashCode();
60 | }
61 |
62 | public String toString() {
63 | return addToToString(new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)).toString();
64 | }
65 |
66 | @Extension
67 | public static class BapSshPublisherLabelDescriptor extends Descriptor {
68 |
69 | @Override
70 | public String getDisplayName() {
71 | return Messages.publisherLabel_descriptor_displayName();
72 | }
73 |
74 | public jenkins.plugins.publish_over.view_defaults.PublisherLabel.Messages getCommonFieldNames() {
75 | return new jenkins.plugins.publish_over.view_defaults.PublisherLabel.Messages();
76 | }
77 |
78 | }
79 |
80 | }
81 |
--------------------------------------------------------------------------------
/src/main/java/jenkins/plugins/publish_over_ssh/BapSshSftpSetupException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * The MIT License
3 | *
4 | * Copyright (C) 2010-2011 by Anthony Robinson
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | * THE SOFTWARE.
23 | */
24 |
25 | package jenkins.plugins.publish_over_ssh;
26 |
27 | import jenkins.plugins.publish_over.BapPublisherException;
28 |
29 | public class BapSshSftpSetupException extends BapPublisherException {
30 |
31 | public BapSshSftpSetupException(final Throwable throwable) {
32 | super(throwable);
33 | }
34 |
35 | public BapSshSftpSetupException(final String message) {
36 | super(message);
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/src/main/java/jenkins/plugins/publish_over_ssh/BapSshUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * The MIT License
3 | *
4 | * Copyright (C) 2010-2011 by Anthony Robinson
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | * THE SOFTWARE.
23 | */
24 |
25 | package jenkins.plugins.publish_over_ssh;
26 |
27 | import java.nio.charset.StandardCharsets;
28 |
29 | public class BapSshUtil {
30 |
31 | public static final int EXTENSION_ORDINAL_POST_BUILD_WRAPPER = 10;
32 | public static final int EXTENSION_ORDINAL_PRE_BUILD_WRAPPER = EXTENSION_ORDINAL_POST_BUILD_WRAPPER + 1;
33 |
34 | private BapSshUtil() {}
35 |
36 | public static byte[] toBytes(final String string) {
37 | if (string == null) {
38 | return new byte[]{};
39 | } else {
40 | return string.getBytes(StandardCharsets.UTF_8);
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/java/jenkins/plugins/publish_over_ssh/descriptor/BapSshCommonConfigurationDescriptor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * The MIT License
3 | *
4 | * Copyright (C) 2010-2011 by Anthony Robinson
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | * THE SOFTWARE.
23 | */
24 |
25 | package jenkins.plugins.publish_over_ssh.descriptor;
26 |
27 | import hudson.Extension;
28 | import hudson.model.Descriptor;
29 | import hudson.util.FormValidation;
30 | import jenkins.plugins.publish_over.BPValidators;
31 | import jenkins.plugins.publish_over_ssh.BapSshCommonConfiguration;
32 | import jenkins.plugins.publish_over_ssh.Messages;
33 | import org.kohsuke.stapler.QueryParameter;
34 |
35 | @Extension
36 | public class BapSshCommonConfigurationDescriptor extends Descriptor {
37 |
38 | public BapSshCommonConfigurationDescriptor() {
39 | super(BapSshCommonConfiguration.class);
40 | }
41 |
42 | @Override
43 | public String getDisplayName() {
44 | return Messages.global_common_descriptor();
45 | }
46 |
47 | public FormValidation doCheckKeyPath(@QueryParameter final String value) {
48 | return BPValidators.validateFileOnMaster(value);
49 | }
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/src/main/java/jenkins/plugins/publish_over_ssh/descriptor/BapSshPublisherDescriptor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * The MIT License
3 | *
4 | * Copyright (C) 2010-2011 by Anthony Robinson
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | * THE SOFTWARE.
23 | */
24 |
25 | package jenkins.plugins.publish_over_ssh.descriptor;
26 |
27 | import hudson.Extension;
28 | import hudson.model.Descriptor;
29 | import jenkins.model.Jenkins;
30 | import jenkins.plugins.publish_over_ssh.BapSshPublisher;
31 | import jenkins.plugins.publish_over_ssh.BapSshPublisherPlugin;
32 | import jenkins.plugins.publish_over_ssh.Messages;
33 | import org.jenkinsci.Symbol;
34 |
35 | @Extension @Symbol("sshPublisherDesc")
36 | public class BapSshPublisherDescriptor extends Descriptor {
37 |
38 | public BapSshPublisherDescriptor() {
39 | super(BapSshPublisher.class);
40 | }
41 |
42 | @Override
43 | public String getDisplayName() {
44 | return Messages.publisher_descriptor_displayName();
45 | }
46 |
47 | public BapSshPublisherPlugin.Descriptor getPublisherPluginDescriptor() {
48 | return Jenkins.getActiveInstance().getDescriptorByType(BapSshPublisherPlugin.Descriptor.class);
49 | }
50 |
51 | public BapSshTransferDescriptor getTransferDescriptor() {
52 | return Jenkins.getActiveInstance().getDescriptorByType(BapSshTransferDescriptor.class);
53 | }
54 |
55 | public jenkins.plugins.publish_over.view_defaults.BapPublisher.Messages getCommonFieldNames() {
56 | return new jenkins.plugins.publish_over.view_defaults.BapPublisher.Messages();
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/src/main/java/jenkins/plugins/publish_over_ssh/options/SshDefaults.java:
--------------------------------------------------------------------------------
1 | /*
2 | * The MIT License
3 | *
4 | * Copyright (C) 2010-2011 by Anthony Robinson
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | * THE SOFTWARE.
23 | */
24 |
25 | package jenkins.plugins.publish_over_ssh.options;
26 |
27 | import hudson.DescriptorExtensionList;
28 | import hudson.ExtensionPoint;
29 | import hudson.model.Describable;
30 | import hudson.model.Descriptor;
31 | import jenkins.model.Jenkins;
32 |
33 | public abstract class SshDefaults implements Describable, ExtensionPoint, SshOptions {
34 |
35 | public static DescriptorExtensionList all() {
36 | return Jenkins.getInstance().getDescriptorList(SshDefaults.class);
37 | }
38 |
39 | public SshDefaultsDescriptor getDescriptor() {
40 | return (SshDefaultsDescriptor) Jenkins.getInstance().getDescriptor(getClass());
41 | }
42 |
43 | public abstract static class SshDefaultsDescriptor extends Descriptor {
44 |
45 | protected SshDefaultsDescriptor() { }
46 |
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/src/main/java/jenkins/plugins/publish_over_ssh/options/SshOptions.java:
--------------------------------------------------------------------------------
1 | /*
2 | * The MIT License
3 | *
4 | * Copyright (C) 2010-2011 by Anthony Robinson
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | * THE SOFTWARE.
23 | */
24 |
25 | package jenkins.plugins.publish_over_ssh.options;
26 |
27 | import jenkins.plugins.publish_over.options.InstanceConfigOptions;
28 | import jenkins.plugins.publish_over.options.ParamPublishOptions;
29 | import jenkins.plugins.publish_over.options.PublisherLabelOptions;
30 | import jenkins.plugins.publish_over.options.PublisherOptions;
31 | import jenkins.plugins.publish_over.options.RetryOptions;
32 |
33 | public interface SshOptions {
34 |
35 | InstanceConfigOptions getInstanceConfig();
36 | ParamPublishOptions getParamPublish();
37 | PublisherOptions getPublisher();
38 | PublisherLabelOptions getPublisherLabel();
39 | RetryOptions getRetry();
40 | SshTransferOptions getTransfer();
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/src/main/java/jenkins/plugins/publish_over_ssh/options/SshOverrideInstanceConfigDefaults.java:
--------------------------------------------------------------------------------
1 | /*
2 | * The MIT License
3 | *
4 | * Copyright (C) 2010-2011 by Anthony Robinson
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | * THE SOFTWARE.
23 | */
24 |
25 | package jenkins.plugins.publish_over_ssh.options;
26 |
27 | import hudson.Extension;
28 | import hudson.model.Describable;
29 | import hudson.model.Descriptor;
30 | import jenkins.model.Jenkins;
31 | import jenkins.plugins.publish_over.options.InstanceConfigOptions;
32 | import org.kohsuke.stapler.DataBoundConstructor;
33 |
34 | public class SshOverrideInstanceConfigDefaults implements InstanceConfigOptions, Describable {
35 |
36 | private final boolean continueOnError;
37 | private final boolean failOnError;
38 | private final boolean alwaysPublishFromMaster;
39 |
40 | @DataBoundConstructor
41 | public SshOverrideInstanceConfigDefaults(final boolean alwaysPublishFromMaster, final boolean continueOnError,
42 | final boolean failOnError) {
43 | this.alwaysPublishFromMaster = alwaysPublishFromMaster;
44 | this.continueOnError = continueOnError;
45 | this.failOnError = failOnError;
46 | }
47 |
48 | public boolean isContinueOnError() {
49 | return continueOnError;
50 | }
51 |
52 | public boolean isFailOnError() {
53 | return failOnError;
54 | }
55 |
56 | public boolean isAlwaysPublishFromMaster() {
57 | return alwaysPublishFromMaster;
58 | }
59 |
60 | public SshOverrideInstanceConfigDefaultsDescriptor getDescriptor() {
61 | return Jenkins.getActiveInstance().getDescriptorByType(SshOverrideInstanceConfigDefaultsDescriptor.class);
62 | }
63 |
64 | @Extension
65 | public static class SshOverrideInstanceConfigDefaultsDescriptor extends Descriptor {
66 |
67 | @Override
68 | public String getDisplayName() {
69 | return "SshOverrideInstanceConfigDefaultsDescriptor - not visible ...";
70 | }
71 |
72 | public jenkins.plugins.publish_over.view_defaults.BPInstanceConfig.Messages getCommonFieldNames() {
73 | return new jenkins.plugins.publish_over.view_defaults.BPInstanceConfig.Messages();
74 | }
75 |
76 | }
77 |
78 | }
79 |
--------------------------------------------------------------------------------
/src/main/java/jenkins/plugins/publish_over_ssh/options/SshOverrideParamPublishDefaults.java:
--------------------------------------------------------------------------------
1 | /*
2 | * The MIT License
3 | *
4 | * Copyright (C) 2010-2011 by Anthony Robinson
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | * THE SOFTWARE.
23 | */
24 |
25 | package jenkins.plugins.publish_over_ssh.options;
26 |
27 | import hudson.Extension;
28 | import hudson.model.Describable;
29 | import hudson.model.Descriptor;
30 | import jenkins.model.Jenkins;
31 | import jenkins.plugins.publish_over.options.ParamPublishOptions;
32 | import jenkins.plugins.publish_over_ssh.BapSshParamPublish;
33 | import org.kohsuke.stapler.DataBoundConstructor;
34 |
35 | public class SshOverrideParamPublishDefaults implements ParamPublishOptions, Describable {
36 |
37 | private final String parameterName;
38 |
39 | @DataBoundConstructor
40 | public SshOverrideParamPublishDefaults(final String parameterName) {
41 | this.parameterName = parameterName;
42 | }
43 |
44 | public String getParameterName() {
45 | return parameterName;
46 | }
47 |
48 | public SshOverrideParamPublishDefaultsDescriptor getDescriptor() {
49 | return Jenkins.getActiveInstance().getDescriptorByType(SshOverrideParamPublishDefaultsDescriptor.class);
50 | }
51 |
52 | @Extension
53 | public static class SshOverrideParamPublishDefaultsDescriptor extends Descriptor {
54 |
55 | @Override
56 | public String getDisplayName() {
57 | return "SshOverrideParamPublishDefaultsDescriptor - not visible ...";
58 | }
59 |
60 | public jenkins.plugins.publish_over.view_defaults.ParamPublish.Messages getCommonFieldNames() {
61 | return new jenkins.plugins.publish_over.view_defaults.ParamPublish.Messages();
62 | }
63 |
64 | @Override
65 | public String getConfigPage() {
66 | return getViewPage(BapSshParamPublish.class, "config.jelly");
67 | }
68 |
69 | }
70 |
71 | }
72 |
--------------------------------------------------------------------------------
/src/main/java/jenkins/plugins/publish_over_ssh/options/SshOverridePublisherLabelDefaults.java:
--------------------------------------------------------------------------------
1 | /*
2 | * The MIT License
3 | *
4 | * Copyright (C) 2010-2011 by Anthony Robinson
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | * THE SOFTWARE.
23 | */
24 |
25 | package jenkins.plugins.publish_over_ssh.options;
26 |
27 | import hudson.Extension;
28 | import hudson.model.Describable;
29 | import hudson.model.Descriptor;
30 | import jenkins.model.Jenkins;
31 | import jenkins.plugins.publish_over.options.PublisherLabelOptions;
32 | import jenkins.plugins.publish_over_ssh.BapSshPublisherLabel;
33 | import org.kohsuke.stapler.DataBoundConstructor;
34 |
35 | public class SshOverridePublisherLabelDefaults implements PublisherLabelOptions, Describable {
36 |
37 | private final String label;
38 |
39 | @DataBoundConstructor
40 | public SshOverridePublisherLabelDefaults(final String label) {
41 | this.label = label;
42 | }
43 |
44 | public String getLabel() {
45 | return label;
46 | }
47 |
48 | public SshOverridePublisherLabelDefaultsDescriptor getDescriptor() {
49 | return Jenkins.getActiveInstance().getDescriptorByType(SshOverridePublisherLabelDefaultsDescriptor.class);
50 | }
51 |
52 | @Extension
53 | public static class SshOverridePublisherLabelDefaultsDescriptor extends Descriptor {
54 |
55 | @Override
56 | public String getDisplayName() {
57 | return "SshOverridePublisherLabelDefaultsDescriptor - not visible ...";
58 | }
59 |
60 | public jenkins.plugins.publish_over.view_defaults.PublisherLabel.Messages getCommonFieldNames() {
61 | return new jenkins.plugins.publish_over.view_defaults.PublisherLabel.Messages();
62 | }
63 |
64 | public String getConfigPage() {
65 | return getViewPage(BapSshPublisherLabel.class, "config.jelly");
66 | }
67 |
68 | }
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/src/main/java/jenkins/plugins/publish_over_ssh/options/SshPluginDefaultsHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * The MIT License
3 | *
4 | * Copyright (C) 2010-2011 by Anthony Robinson
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | * THE SOFTWARE.
23 | */
24 |
25 | package jenkins.plugins.publish_over_ssh.options;
26 |
27 | import java.lang.reflect.InvocationHandler;
28 | import java.lang.reflect.Method;
29 |
30 | public final class SshPluginDefaultsHandler implements InvocationHandler {
31 |
32 | private static final String GET_EXEC_COMMAND = "getExecCommand";
33 | private static final String GET_EXEC_TIMEOUT = "getExecTimeout";
34 | private static final String IS_USE_PTY = "isUsePty";
35 | private static final String IS_USE_AGENT_FORWARDING = "isUseAgentForwarding";
36 |
37 | public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable {
38 | if (method.getName().equals(GET_EXEC_COMMAND))
39 | return getExecCommand();
40 | else if (method.getName().equals(GET_EXEC_TIMEOUT))
41 | return getExecTimeout();
42 | else if (method.getName().equals(IS_USE_PTY))
43 | return isPseudoTty();
44 | else if (method.getName().equals(IS_USE_AGENT_FORWARDING))
45 | return isAgentForwarding();
46 | return method.invoke(SshPluginDefaults.GLOBAL_DEFAULTS, args);
47 | }
48 |
49 | public String getExecCommand() {
50 | return null;
51 | }
52 |
53 | public int getExecTimeout() {
54 | return SshTransferOptions.DEFAULT_EXEC_TIMEOUT;
55 | }
56 |
57 | public boolean isPseudoTty() {
58 | return SshTransferOptions.DEFAULT_USE_PTY;
59 | }
60 |
61 | public boolean isAgentForwarding() {
62 | return SshTransferOptions.DEFAULT_USE_AGENT_FORWARDING;
63 | }
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/src/main/java/jenkins/plugins/publish_over_ssh/options/SshTransferOptions.java:
--------------------------------------------------------------------------------
1 | /*
2 | * The MIT License
3 | *
4 | * Copyright (C) 2010-2011 by Anthony Robinson
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | * THE SOFTWARE.
23 | */
24 |
25 | package jenkins.plugins.publish_over_ssh.options;
26 |
27 | import jenkins.plugins.publish_over.options.TransferOptions;
28 |
29 | public interface SshTransferOptions extends TransferOptions {
30 |
31 | int DEFAULT_EXEC_TIMEOUT = 120000;
32 | boolean DEFAULT_USE_PTY = false;
33 | boolean DEFAULT_USE_AGENT_FORWARDING = false;
34 |
35 | String getExecCommand();
36 |
37 | int getExecTimeout();
38 |
39 | boolean isUsePty();
40 |
41 | boolean isUseAgentForwarding();
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/resources/index.jelly:
--------------------------------------------------------------------------------
1 |
2 |
3 |
26 |
27 |
Send files or execute commands over SSH as a build step during the build.
26 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/publish_over_ssh/BapSshCommonConfiguration/config.jelly:
--------------------------------------------------------------------------------
1 |
2 |
3 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/publish_over_ssh/BapSshCommonConfiguration/config.properties:
--------------------------------------------------------------------------------
1 | #
2 | # The MIT License
3 | #
4 | # Copyright (C) 2010-2011 by Anthony Robinson
5 | #
6 | # Permission is hereby granted, free of charge, to any person obtaining a copy
7 | # of this software and associated documentation files (the "Software"), to deal
8 | # in the Software without restriction, including without limitation the rights
9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | # copies of the Software, and to permit persons to whom the Software is
11 | # furnished to do so, subject to the following conditions:
12 | #
13 | # The above copyright notice and this permission notice shall be included in
14 | # all copies or substantial portions of the Software.
15 | #
16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | # THE SOFTWARE.
23 | #
24 |
25 | passphrase=Passphrase
26 | keyPath=Path to key
27 | key=Key
28 | disableAllExec=Disable exec
29 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/publish_over_ssh/BapSshCommonConfiguration/config_no_BV.properties:
--------------------------------------------------------------------------------
1 | #
2 | # The MIT License
3 | #
4 | # Copyright (C) 2010-2011 by Anthony Robinson
5 | #
6 | # Permission is hereby granted, free of charge, to any person obtaining a copy
7 | # of this software and associated documentation files (the "Software"), to deal
8 | # in the Software without restriction, including without limitation the rights
9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | # copies of the Software, and to permit persons to whom the Software is
11 | # furnished to do so, subject to the following conditions:
12 | #
13 | # The above copyright notice and this permission notice shall be included in
14 | # all copies or substantial portions of the Software.
15 | #
16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | # THE SOFTWARE.
23 | #
24 |
25 | passphrase=P*s*p*r*s*
26 | keyPath=P*t* t* k*y
27 | key=K*y
28 | disableAllExec=D*s*b*e e*e*
29 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/publish_over_ssh/BapSshCommonConfiguration/help-disableAllExec.html:
--------------------------------------------------------------------------------
1 |
24 |
25 |
Remove the ability to run Exec commands from this plugin.
26 |
The Disable exec in the advanced settings for individual configurations will be ignored.
Either supply the path to the file containing the key, or paste the key into the Key box.
28 | The Path to key can be absolute, or relative to $JENKINS_HOME
29 |
30 |
31 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/publish_over_ssh/BapSshCredentials/config.jelly:
--------------------------------------------------------------------------------
1 |
2 |
3 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/publish_over_ssh/BapSshCredentials/config.properties:
--------------------------------------------------------------------------------
1 | #
2 | # The MIT License
3 | #
4 | # Copyright (C) 2010-2011 by Anthony Robinson
5 | #
6 | # Permission is hereby granted, free of charge, to any person obtaining a copy
7 | # of this software and associated documentation files (the "Software"), to deal
8 | # in the Software without restriction, including without limitation the rights
9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | # copies of the Software, and to permit persons to whom the Software is
11 | # furnished to do so, subject to the following conditions:
12 | #
13 | # The above copyright notice and this permission notice shall be included in
14 | # all copies or substantial portions of the Software.
15 | #
16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | # THE SOFTWARE.
23 | #
24 |
25 | username=Username
26 | passphrase=Passphrase / Password
27 | keyPath=Path to key
28 | key=Key
29 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/publish_over_ssh/BapSshCredentials/config_no_BV.properties:
--------------------------------------------------------------------------------
1 | #
2 | # The MIT License
3 | #
4 | # Copyright (C) 2010-2011 by Anthony Robinson
5 | #
6 | # Permission is hereby granted, free of charge, to any person obtaining a copy
7 | # of this software and associated documentation files (the "Software"), to deal
8 | # in the Software without restriction, including without limitation the rights
9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | # copies of the Software, and to permit persons to whom the Software is
11 | # furnished to do so, subject to the following conditions:
12 | #
13 | # The above copyright notice and this permission notice shall be included in
14 | # all copies or substantial portions of the Software.
15 | #
16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | # THE SOFTWARE.
23 | #
24 |
25 | username=U*e*n*m*
26 | passphrase=P*s*p*r*s* / P*s*w*r*
27 | keyPath=P*t* t* k*y
28 | key=K*y
29 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/publish_over_ssh/BapSshCredentials/help-encryptedPassphrase.html:
--------------------------------------------------------------------------------
1 |
24 |
25 |
The passphrase for the private key, or the password for password authentication if no Key or Path to key is
26 | configured.
27 | Leave blank if the key is not encrypted.
Either supply the path to the file containing the key, or paste the key into the Key box.
28 | The Path to key can be absolute, or relative to $JENKINS_HOME
29 |
26 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/publish_over_ssh/BapSshHostConfiguration/config.properties:
--------------------------------------------------------------------------------
1 | #
2 | # The MIT License
3 | #
4 | # Copyright (C) 2010-2011 by Anthony Robinson
5 | #
6 | # Permission is hereby granted, free of charge, to any person obtaining a copy
7 | # of this software and associated documentation files (the "Software"), to deal
8 | # in the Software without restriction, including without limitation the rights
9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | # copies of the Software, and to permit persons to whom the Software is
11 | # furnished to do so, subject to the following conditions:
12 | #
13 | # The above copyright notice and this permission notice shall be included in
14 | # all copies or substantial portions of the Software.
15 | #
16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | # THE SOFTWARE.
23 | #
24 |
25 | override.default.key=Use password authentication, or use a different key
26 | password=Passphrase / Password
27 | keyPath=Path to key
28 | key=Key
29 | disableExec=Disable exec
30 | jumpHost=Jump host
31 | proxyType=Proxy type
32 | proxyHTTP=HTTP
33 | proxySocks4=SOCKS4
34 | proxySocks5=SOCKS5
35 | proxyHost=Proxy host
36 | proxyPort=Proxy port
37 | proxyUser=Proxy user
38 | proxyPassword=Proxy password
39 | avoidSameFileUploads=Avoid sending files that have not changed
40 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/publish_over_ssh/BapSshHostConfiguration/config_no_BV.properties:
--------------------------------------------------------------------------------
1 | #
2 | # The MIT License
3 | #
4 | # Copyright (C) 2010-2011 by Anthony Robinson
5 | #
6 | # Permission is hereby granted, free of charge, to any person obtaining a copy
7 | # of this software and associated documentation files (the "Software"), to deal
8 | # in the Software without restriction, including without limitation the rights
9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | # copies of the Software, and to permit persons to whom the Software is
11 | # furnished to do so, subject to the following conditions:
12 | #
13 | # The above copyright notice and this permission notice shall be included in
14 | # all copies or substantial portions of the Software.
15 | #
16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | # THE SOFTWARE.
23 | #
24 |
25 | override.default.key=U*e p*s*w*r* a*t*e*t*c*t*o*, o* u*e a d*f*e*e*t k*y
26 | password=P*s*p*r*s* / P*s*w*r*
27 | keyPath=P*t* t* k*y
28 | key=K*y
29 | disableExec=D*s*b*e e*e*
30 | jumpHost=j*m* *o*t
31 | proxyType=P*o*y t*p*
32 | proxyHTTP=H*T*
33 | proxySocks4=S*c*s4
34 | proxySocks5=S*c*s5
35 | proxyHost=P*o*y h*s*
36 | proxyPort=P*o*y p*r*
37 | proxyUser=P*o*y u*e*
38 | proxyPassword=P*o*y p*s*w*r*
39 | avoidSameFileUploads=A*o*d s*n*i*g f*l*s t*a* h*v* n*t c*a*g*d
40 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/publish_over_ssh/BapSshHostConfiguration/help-avoidSameFileUploads.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Avoids to send files to remote target if they are still the same.
4 |
Based on checking last modification time and MD5 hash of the resource to be uploaded
The jump host is used to tunnel the SSH connection to the target host. You can provide a list of jump hosts by separating them by space, comma or semicolon.
Either supply the path to the file containing the key, or paste the key into the Key box.
28 | The Path to key can be absolute, or relative to $JENKINS_HOME
29 |
The key is specified by pasting into the Key section, or by providing the file path to the key
28 | in the Path to key. If both are provided, then the pasted Key will take precedence.
29 |
If no key is set then the Passphrase / Password will be used for password authentication, else it is
30 | used for decrypting the key.
31 |
Send files or execute commands over SSH after the build runs.
26 |
This will run the SSH publishers after the build has finished and will run no matter what the status of the build was.
27 | Note that if the build fails before the builders are executed (ie in a pre build step) then the post build steps will not run.
28 |
Send files or execute commands over SSH before the build runs.
27 |
This will run the SSH publishers after the workspace has been checked out, but before the build starts.
28 | If the publish fails, then the build will be marked as unstable, but still continue. To fail the build set the
29 | Advanced option "Fail the build if an error occurs". This will also prevent post build steps from being run.
30 |
Send files or execute commands over SSH as a build step during a promotion process.
26 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/publish_over_ssh/BapSshPublisher/config.properties:
--------------------------------------------------------------------------------
1 | #
2 | # The MIT License
3 | #
4 | # Copyright (C) 2010-2011 by Anthony Robinson
5 | #
6 | # Permission is hereby granted, free of charge, to any person obtaining a copy
7 | # of this software and associated documentation files (the "Software"), to deal
8 | # in the Software without restriction, including without limitation the rights
9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | # copies of the Software, and to permit persons to whom the Software is
11 | # furnished to do so, subject to the following conditions:
12 | #
13 | # The above copyright notice and this permission notice shall be included in
14 | # all copies or substantial portions of the Software.
15 | #
16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | # THE SOFTWARE.
23 | #
24 |
25 | hostconfig.noexec.suffix=\ [No Exec]
26 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/publish_over_ssh/BapSshPublisher/config_no_BV.properties:
--------------------------------------------------------------------------------
1 | #
2 | # The MIT License
3 | #
4 | # Copyright (C) 2010-2011 by Anthony Robinson
5 | #
6 | # Permission is hereby granted, free of charge, to any person obtaining a copy
7 | # of this software and associated documentation files (the "Software"), to deal
8 | # in the Software without restriction, including without limitation the rights
9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | # copies of the Software, and to permit persons to whom the Software is
11 | # furnished to do so, subject to the following conditions:
12 | #
13 | # The above copyright notice and this permission notice shall be included in
14 | # all copies or substantial portions of the Software.
15 | #
16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | # THE SOFTWARE.
23 | #
24 |
25 | hostconfig.noexec.suffix=\ [N* E*e*]
26 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/publish_over_ssh/BapSshPublisher/help-configName.html:
--------------------------------------------------------------------------------
1 |
24 |
25 |
26 |
Select an SSH configuration from the list configured in the global configuration of this Jenkins.
27 |
The configuration defines the connection properties and base directory of the SSH server.
26 | Set the credentials to use with this connection.
27 |
If you want to use different credentials from those configured for this server, or if the credentials have not been specified
28 | for this server, then enable this option and set them here.
If publishing to this server or command execution fails, try again.
27 |
Files that were successfully transferred will not be re-sent.
28 | If Exec command is configured, but fails in any way (including a non zero exit code), then it will be retried.
29 |
Use the build time of the promotion when the remote directory is a date format.
27 |
By default this plugin uses the time of the original build (the one that is being promoted) when formatting the
28 | remote directory. Setting this option will mean that if you use the remote directory is a date format option,
29 | it will use the time that the promotion process runs, instead of the original build.
Set the root directory for the Source files to the workspace.
27 |
By default this plugin uses the artifacts directory (where archived artifacts are stored). This allows the artifacts
28 | from the build number that you are promoting to be sent somewhere else.
29 |
If you run tasks that produce files in the workspace during the promotion and you want to publish them, then set this
30 | option.
31 |
If you need to send files from both the workspace and the archive directory, then you need to add a second server,
32 | even if you want to send the files to the same place. This is due to the fact that the workspace is not necessarily
33 | on the same host as the archive directory.
Set the label for this Server instance - for use with Parameterized publishing.
27 |
Expand the help for Parameterized publishing for more details.
28 |
29 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/publish_over_ssh/BapSshPublisherPlugin/config.properties:
--------------------------------------------------------------------------------
1 | #
2 | # The MIT License
3 | #
4 | # Copyright (C) 2010-2011 by Anthony Robinson
5 | #
6 | # Permission is hereby granted, free of charge, to any person obtaining a copy
7 | # of this software and associated documentation files (the "Software"), to deal
8 | # in the Software without restriction, including without limitation the rights
9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | # copies of the Software, and to permit persons to whom the Software is
11 | # furnished to do so, subject to the following conditions:
12 | #
13 | # The above copyright notice and this permission notice shall be included in
14 | # all copies or substantial portions of the Software.
15 | #
16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | # THE SOFTWARE.
23 | #
24 |
25 | publishers.section=SSH Publishers
26 | publisher.dragAndDropLabel=SSH Server
27 | continueOnError=Publish to other SSH servers if an error occurs
28 | alwaysPublishFromMaster=Always SSH from master
29 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/publish_over_ssh/BapSshPublisherPlugin/config_no_BV.properties:
--------------------------------------------------------------------------------
1 | #
2 | # The MIT License
3 | #
4 | # Copyright (C) 2010-2011 by Anthony Robinson
5 | #
6 | # Permission is hereby granted, free of charge, to any person obtaining a copy
7 | # of this software and associated documentation files (the "Software"), to deal
8 | # in the Software without restriction, including without limitation the rights
9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | # copies of the Software, and to permit persons to whom the Software is
11 | # furnished to do so, subject to the following conditions:
12 | #
13 | # The above copyright notice and this permission notice shall be included in
14 | # all copies or substantial portions of the Software.
15 | #
16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | # THE SOFTWARE.
23 | #
24 |
25 | publishers.section=S*H P*b*i*h*r*
26 | publisher.dragAndDropLabel=S*H S*r*e*
27 | continueOnError=P*b*i*h t* o*h*r S*H s*r*e*s i* a* e*r*r o*c*r*
28 | alwaysPublishFromMaster=A*w*y* S*H f*o* m*s*e*
29 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/publish_over_ssh/BapSshPublisherPlugin/global.jelly:
--------------------------------------------------------------------------------
1 |
2 |
3 |
26 |
27 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/publish_over_ssh/BapSshPublisherPlugin/global.properties:
--------------------------------------------------------------------------------
1 | #
2 | # The MIT License
3 | #
4 | # Copyright (C) 2010-2011 by Anthony Robinson
5 | #
6 | # Permission is hereby granted, free of charge, to any person obtaining a copy
7 | # of this software and associated documentation files (the "Software"), to deal
8 | # in the Software without restriction, including without limitation the rights
9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | # copies of the Software, and to permit persons to whom the Software is
11 | # furnished to do so, subject to the following conditions:
12 | #
13 | # The above copyright notice and this permission notice shall be included in
14 | # all copies or substantial portions of the Software.
15 | #
16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | # THE SOFTWARE.
23 | #
24 |
25 | section.title=Publish over SSH
26 | section.description=A configuration to use to connect to a SSH server
27 | common.entry=Jenkins SSH Key
28 | hostconfig.entry=SSH Servers
29 | hostconfig.dragAndDrop=SSH Server
30 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/publish_over_ssh/BapSshPublisherPlugin/global_no_BV.properties:
--------------------------------------------------------------------------------
1 | #
2 | # The MIT License
3 | #
4 | # Copyright (C) 2010-2011 by Anthony Robinson
5 | #
6 | # Permission is hereby granted, free of charge, to any person obtaining a copy
7 | # of this software and associated documentation files (the "Software"), to deal
8 | # in the Software without restriction, including without limitation the rights
9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | # copies of the Software, and to permit persons to whom the Software is
11 | # furnished to do so, subject to the following conditions:
12 | #
13 | # The above copyright notice and this permission notice shall be included in
14 | # all copies or substantial portions of the Software.
15 | #
16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | # THE SOFTWARE.
23 | #
24 |
25 | section.title=P*b*i*h o*e* S*H
26 | section.description=A c*n*i*u*a*i*n t* u*e t* c*n*e*t t* a S*H s*r*e*
27 | common.entry=J*n*i*s S*H K*y
28 | hostconfig.entry=S*H S*r*e*s
29 | hostconfig.dragAndDrop=S*H S*r*e*
30 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/publish_over_ssh/BapSshPublisherPlugin/help-alwaysPublishFromMaster.html:
--------------------------------------------------------------------------------
1 |
24 |
25 |
26 |
Select to publish from the Jenkins master.
27 |
The default is to publish from the server that holds the files to transfer (workspace on the agent, or artifacts directory on the master).
28 | Enabling this option could help dealing with strict network configurations and firewall rules.
29 | This option will cause the files to be transferred through the master before being sent to the remote server, this may
30 | increase network traffic, and could increase the build time.
Configure the private key for connecting to SSH servers.
27 |
The key configured here is a default key which can be overridden for an individual host.
28 |
The key is specified by pasting into the Key section, or by providing the file path to the key
29 | in the Path to key. If both are provided, then the pasted Key will take precedence.
30 |
If Passphrase is provided then it will be used to decrypt the private key.
Set this option to give a value to the NODE_NAME environment variable when the value is missing (the Jenkins
28 | master).
29 | This is useful if you use the NODE_NAME variable in the remote directory
30 | option and the build may occur on the master.
The time to wait, in milliseconds, before attempting another transfer.
26 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/publish_over_ssh/BapSshTransfer/config.properties:
--------------------------------------------------------------------------------
1 | #
2 | # The MIT License
3 | #
4 | # Copyright (C) 2010-2011 by Anthony Robinson
5 | #
6 | # Permission is hereby granted, free of charge, to any person obtaining a copy
7 | # of this software and associated documentation files (the "Software"), to deal
8 | # in the Software without restriction, including without limitation the rights
9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | # copies of the Software, and to permit persons to whom the Software is
11 | # furnished to do so, subject to the following conditions:
12 | #
13 | # The above copyright notice and this permission notice shall be included in
14 | # all copies or substantial portions of the Software.
15 | #
16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | # THE SOFTWARE.
23 | #
24 |
25 | execCommand=Exec command
26 | transfers.envVars=All of the transfer fields (except for Exec timeout) support substitution of \
27 | Jenkins environment variables
28 | execTimeout=Exec timeout (ms)
29 | usePty=Exec in pty
30 | useAgentForwarding=Exec using Agent Forwarding
31 | useSftpForExec=Use SFTP for Exec
32 | keepFilePermissions=Keep file permissions
33 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/publish_over_ssh/BapSshTransfer/config_no_BV.properties:
--------------------------------------------------------------------------------
1 | #
2 | # The MIT License
3 | #
4 | # Copyright (C) 2010-2011 by Anthony Robinson
5 | #
6 | # Permission is hereby granted, free of charge, to any person obtaining a copy
7 | # of this software and associated documentation files (the "Software"), to deal
8 | # in the Software without restriction, including without limitation the rights
9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | # copies of the Software, and to permit persons to whom the Software is
11 | # furnished to do so, subject to the following conditions:
12 | #
13 | # The above copyright notice and this permission notice shall be included in
14 | # all copies or substantial portions of the Software.
15 | #
16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | # THE SOFTWARE.
23 | #
24 |
25 | execCommand=E*e* c*m*a*d
26 | transfers.envVars=A*l o* t*e t*a*s*e* f*e*d* (e*c*p* f*r E*e* t*m*o*t) s*p*o*t s*b*t*t*t*o* o* \
27 | J*n*i*s e*v*r*n*e*t v*r*a*l*s
28 | execTimeout=E*e* t*m*o*t (m*)
29 | usePty=C*e*t* * *s*u*o*t*y
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/publish_over_ssh/BapSshTransfer/help-excludes.html:
--------------------------------------------------------------------------------
1 |
24 |
25 |
26 |
Exclude files from the Transfer set.
27 |
The string is a comma separated list of excludes for an Ant fileset eg. '**/*.log,**/*.tmp,.git/'
28 | (see Patterns in the Ant manual)
29 |
This command will be executed on the remote server after any files are transferred.
28 | The SSH Transfer Set must include either a Source Files pattern, an Exec command, or both. If both are present, the files are
29 | transferred before the command is executed. If you want to Exec before the files are transferred, use 2 Transfer Sets and move the
30 | Exec command before the Transfer set that includes a Source files pattern.
31 |
Only create files on the server, don't create directories (except for the remote directory, if present).
27 |
All files that have been selected to transfer must have unique filenames. The publisher will stop and fail as
28 | soon as a duplicate filename is found when using the flatten option.
The default behaviour of this plugin is to match files, and then create any directories required to preserve the paths to the files.
27 | Selecting this option will create any directories that match the Source files pattern, even if empty.
28 |
29 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/publish_over_ssh/BapSshTransfer/help-noDefaultExcludes.jelly:
--------------------------------------------------------------------------------
1 |
2 |
3 |
26 |
27 |
28 |
29 | Select this option to disable the default exclude patterns.
30 |
The regular expression that is used to separate the Source files and Exclude files patterns.
27 |
The Source files and Exclude files both accept multiple patterns that by default are split using
[, ]+
28 | which is how Ant, by default, handles multiple patterns in a single string.
29 |
30 |
The above expression makes it difficult to reference files or directories that contain spaces. This option allows
31 | the expression to be set to something that will preserve the spaces in a pattern eg. a single comma.
32 |
Select this to include the timestamp in the remote directory.
27 |
The timestamp is the date of build. If this publisher is being used during a promotion, then the timestamp is that of the build that is being promoted.
28 | This setting turns the remote directory option into a java SimpleDateFormat.
29 | The SimpleDateFormat(SDF) uses letters to represent components of the date, like the month, year, or day of the week. Click here for more information about the date patterns.
30 | As the SDF reserves all of the letters [A-Z][a-z], any that you want to appear literally in the directory that is created will need to be quoted.
31 |
Some examples follow - all examples are based on a build with a timestamp of 3:45 pm and 55 seconds on the 7th November 2010.
32 |
33 |
34 |
35 |
Remote directory
36 |
Directories created
37 |
38 |
39 |
'qa-approved/'yyyyMMddHHmmss
40 |
qa-approved/20101107154555
41 |
42 |
43 |
'builds/'yyyy/MM/dd/'build-${BUILD_NUMBER}'
44 |
builds/2010/11/07/build-456 (if the build was number 456)
First part of the file path that should not be created on the remote server.
27 |
Directory structures are created relative to the base directory, which is usually the workspace.
28 | You normally do not want the full path to these files to be created on the server.
29 | For example if Source files were target/deployment/images/**/ then you may want Remove prefix to be
30 | target/deployment This would create the images folder under the remote directory, and not target/deployment
31 | Jenkins environment variables can be used in this path.
32 |
If you use remove prefix, then ALL source file paths MUST start with the prefix.
The string is a comma separated list of includes for an Ant fileset eg. '**/*.jar'
28 | (see Patterns
29 | in the Ant manual).
30 | The base directory for this fileset is the workspace.
31 |
The string is a comma separated list of includes for an Ant fileset eg. '**/*.jar'
28 | (see Patterns in the Ant manual).
29 | The base directory for this fileset is the artifacts directory of the build that is being promoted. Ensure that you
30 | "Archive the artifacts" in the Post-build Actions to make your artifacts available during a promotion
31 | Change the base directory to the workspace by setting the "Use the workspace" checkbox.
32 |
Allows a chain of ssh connections to forward key challenges back to the original agent, thus eliminating the need
4 | for using a password or public/private keys for these connections.
5 |
From the ssh(1) man page:
6 |
7 | Enables forwarding of the authentication agent connection. This can also be specified on a per-host basis in a configuration file.
8 |
9 | Agent forwarding should be enabled with caution. Users with the ability to bypass file permissions on the remote host (for the agent's UNIX-domain socket) can access the local agent through the forwarded connection.
10 | An attacker cannot obtain key material from the agent, however they can perform operations on the keys that enable them to authenticate using the identities loaded into the agent.
11 |
This will enable the execution of sudo commands that require a tty (and possibly help in other scenarios too.)
28 | From the sudoers(5) man page:
29 |
requiretty If set, sudo will only run when the user is logged in
30 | to a real tty. When this flag is set, sudo can only be
31 | run from a login session and not via other means such
32 | as cron(8) or cgi-bin scripts. This flag is off by
33 | default.
34 |
Using SFTP protocol instead of SSH for Exec command.
4 |
Supported commands: mkdir, ln, symlink, rm, rmdir, cd, get, ls
5 |
6 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/publish_over_ssh/options/SshOverrideDefaults/config.jelly:
--------------------------------------------------------------------------------
1 |
2 |
3 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/publish_over_ssh/options/SshOverrideInstanceConfigDefaults/config.jelly:
--------------------------------------------------------------------------------
1 |
2 |
3 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/publish_over_ssh/options/SshOverridePublisherDefaults/config.jelly:
--------------------------------------------------------------------------------
1 |
2 |
3 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/publish_over_ssh/options/SshOverridePublisherDefaults/config.properties:
--------------------------------------------------------------------------------
1 | #
2 | # The MIT License
3 | #
4 | # Copyright (C) 2010-2011 by Anthony Robinson
5 | #
6 | # Permission is hereby granted, free of charge, to any person obtaining a copy
7 | # of this software and associated documentation files (the "Software"), to deal
8 | # in the Software without restriction, including without limitation the rights
9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | # copies of the Software, and to permit persons to whom the Software is
11 | # furnished to do so, subject to the following conditions:
12 | #
13 | # The above copyright notice and this permission notice shall be included in
14 | # all copies or substantial portions of the Software.
15 | #
16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | # THE SOFTWARE.
23 | #
24 |
25 | configName=Server name
26 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/publish_over_ssh/options/SshOverridePublisherDefaults/config_no_BV.properties:
--------------------------------------------------------------------------------
1 | #
2 | # The MIT License
3 | #
4 | # Copyright (C) 2010-2011 by Anthony Robinson
5 | #
6 | # Permission is hereby granted, free of charge, to any person obtaining a copy
7 | # of this software and associated documentation files (the "Software"), to deal
8 | # in the Software without restriction, including without limitation the rights
9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | # copies of the Software, and to permit persons to whom the Software is
11 | # furnished to do so, subject to the following conditions:
12 | #
13 | # The above copyright notice and this permission notice shall be included in
14 | # all copies or substantial portions of the Software.
15 | #
16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | # THE SOFTWARE.
23 | #
24 |
25 | configName=S*r*e* n*m*
26 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/publish_over_ssh/options/SshOverrideTransferDefaults/config.properties:
--------------------------------------------------------------------------------
1 | #
2 | # The MIT License
3 | #
4 | # Copyright (C) 2010-2011 by Anthony Robinson
5 | #
6 | # Permission is hereby granted, free of charge, to any person obtaining a copy
7 | # of this software and associated documentation files (the "Software"), to deal
8 | # in the Software without restriction, including without limitation the rights
9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | # copies of the Software, and to permit persons to whom the Software is
11 | # furnished to do so, subject to the following conditions:
12 | #
13 | # The above copyright notice and this permission notice shall be included in
14 | # all copies or substantial portions of the Software.
15 | #
16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | # THE SOFTWARE.
23 | #
24 |
25 | execCommand=Exec command
26 | execTimeout=Exec timeout (ms)
27 | usePty=Exec in pty
28 | useAgentForwarding=Exec using Agent Forwarding
29 | avoidSameFileUploads=Avoid sending files that have not changed
30 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/publish_over_ssh/options/SshOverrideTransferDefaults/config_no_BV.properties:
--------------------------------------------------------------------------------
1 | #
2 | # The MIT License
3 | #
4 | # Copyright (C) 2010-2011 by Anthony Robinson
5 | #
6 | # Permission is hereby granted, free of charge, to any person obtaining a copy
7 | # of this software and associated documentation files (the "Software"), to deal
8 | # in the Software without restriction, including without limitation the rights
9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | # copies of the Software, and to permit persons to whom the Software is
11 | # furnished to do so, subject to the following conditions:
12 | #
13 | # The above copyright notice and this permission notice shall be included in
14 | # all copies or substantial portions of the Software.
15 | #
16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | # THE SOFTWARE.
23 | #
24 |
25 | execCommand=E*e* c*m*a*d
26 | execTimeout=E*e* t*m*o*t (m*)
27 | usePty=C*e*t* * *s*u*o*t*y
28 | avoidSameFileUploads=A*o*d s*n*i*g *i*e* t*a* h*v* c*a*g*d
29 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/publish_over_ssh/options/SshPluginDefaults/config.jelly:
--------------------------------------------------------------------------------
1 |
2 |
3 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/main/resources/lib/publishoverssh/blockWrapper.jelly:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/main/resources/lib/publishoverssh/taglib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jenkinsci/publish-over-ssh-plugin/4ed3e8b7d739bab63fb3ce607bf17e9bb5b2c606/src/main/resources/lib/publishoverssh/taglib
--------------------------------------------------------------------------------
/src/test/java/jenkins/plugins/publish_over_ssh/HostsHelperTest.java:
--------------------------------------------------------------------------------
1 | package jenkins.plugins.publish_over_ssh;
2 |
3 | import static org.hamcrest.CoreMatchers.is;
4 | import static org.hamcrest.CoreMatchers.not;
5 | import static org.hamcrest.Matchers.arrayContaining;
6 | import static org.junit.Assert.assertThat;
7 |
8 | import org.junit.Test;
9 |
10 | /** Tests evaluation of combinations for jumphost, implemented in the HostsHelper-class.
11 | *
12 | * @author Christian Langmann
13 | *
14 | */
15 | public class HostsHelperTest {
16 |
17 | @Test
18 | public void testGetHostsEmptyJumpHosts() {
19 | String[] hosts = BapSshHostConfiguration.HostsHelper.getHosts("hostname", "");
20 | assertThat(hosts, is(not((String[]) null)));
21 | assertThat(hosts, arrayContaining("hostname"));
22 | }
23 |
24 | @Test
25 | public void testGetHostsOneJumpHosts() {
26 | String[] hosts = BapSshHostConfiguration.HostsHelper.getHosts("hostname", "jumphost");
27 | assertThat(hosts, is(not((String[]) null)));
28 | assertThat(hosts, arrayContaining("jumphost", "hostname"));
29 | }
30 |
31 | @Test
32 | public void testGetHostsTwoJumpHosts() {
33 | String[] hosts = BapSshHostConfiguration.HostsHelper.getHosts("hostname", "jumphost jumphost2");
34 | assertThat(hosts, is(not((String[]) null)));
35 | assertThat(hosts, arrayContaining("jumphost", "jumphost2", "hostname"));
36 | }
37 |
38 | @Test
39 | public void testGetHostsTwoJumpHostsSeparator() {
40 | String[] hosts = BapSshHostConfiguration.HostsHelper.getHosts("hostname", "jumphost, jumphost2");
41 | assertThat(hosts, is(not((String[]) null)));
42 | assertThat(hosts, arrayContaining("jumphost", "jumphost2", "hostname"));
43 | }
44 |
45 | @Test
46 | public void testGetHostsTwoJumpHostsSeparatorSemicolon() {
47 | String[] hosts = BapSshHostConfiguration.HostsHelper.getHosts("hostname", "jumphost;jumphost2");
48 | assertThat(hosts, is(not((String[]) null)));
49 | assertThat(hosts, arrayContaining("jumphost", "jumphost2", "hostname"));
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/src/test/java/jenkins/plugins/publish_over_ssh/MySecretHelper.java:
--------------------------------------------------------------------------------
1 | package jenkins.plugins.publish_over_ssh;
2 |
3 | import hudson.util.SecretHelper;
4 |
5 | public class MySecretHelper extends SecretHelper {
6 | private static final String KEY = "7b41d2675f759b479460a41a9758bd0f6049a23ac685dc739bf7bb2d2319472d";
7 |
8 | public static void setSecretKey() {
9 | set(KEY);
10 | }
11 |
12 | public static void clearSecretKey() {
13 | set(null);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/test/java/jenkins/plugins/publish_over_ssh/SftpForExecTest.java:
--------------------------------------------------------------------------------
1 | package jenkins.plugins.publish_over_ssh;
2 |
3 | import com.jcraft.jsch.Session;
4 | import jenkins.plugins.publish_over.BPBuildInfo;
5 | import org.easymock.classextension.EasyMock;
6 | import org.easymock.classextension.IMocksControl;
7 | import jenkins.plugins.publish_over_ssh.helper.BapSshTestHelper;
8 | import org.junit.Test;
9 | import java.util.ArrayList;
10 | import java.util.Arrays;
11 | import static org.junit.Assert.assertEquals;
12 |
13 |
14 | public class SftpForExecTest {
15 |
16 | private final IMocksControl mockControl = EasyMock.createStrictControl();
17 | private final Session mockSession = mockControl.createMock(Session.class);
18 | private final BPBuildInfo buildInfo = BapSshTestHelper.createEmpty(true);
19 | private final BapSshClient bapSshClient = new BapSshClient(buildInfo, mockSession);
20 |
21 | @Test public void testSftpExecCommandsParsing() throws Exception {
22 | final String inputCommands = " ln -s ./mainFile ./symlinkFile \n"
23 | + "\n"
24 | + " ln ./mainFile ./hardlinkFile \n"
25 | + " \n"
26 | + " mkdir testDirectory \n cd testDirectory \n"
27 | + "rmdir testAnotherDirectory";
28 |
29 | final String[] expectedInputCommands = {"ln", "-s", "./mainFile", "./symlinkFile", "ln", "./mainFile", "./hardlinkFile",
30 | "mkdir", "testDirectory", "cd", "testDirectory", "rmdir", "testAnotherDirectory"};
31 |
32 | BapSshTransfer transfer = new BapSshTransfer("", "", "", false, false, inputCommands, 20000);
33 |
34 | ArrayList expectedInputCommandList = new ArrayList<>(Arrays.asList(expectedInputCommands));
35 | ArrayList parsedCommand = new ArrayList<>();
36 |
37 | for (String command:bapSshClient.parseAllCommands(transfer)) {
38 | for (String commandPart:bapSshClient.parseCommand(command)) {
39 | parsedCommand.add(commandPart);
40 | }
41 | }
42 |
43 | assertEquals(expectedInputCommandList, parsedCommand);
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/test/java/jenkins/plugins/publish_over_ssh/helper/RandomFile.java:
--------------------------------------------------------------------------------
1 | /*
2 | * The MIT License
3 | *
4 | * Copyright (C) 2010-2011 by Anthony Robinson
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | * THE SOFTWARE.
23 | */
24 |
25 | package jenkins.plugins.publish_over_ssh.helper;
26 |
27 | import org.apache.commons.io.FileUtils;
28 |
29 | import java.io.File;
30 | import java.io.IOException;
31 | import java.util.Arrays;
32 | import java.util.Random;
33 |
34 | public class RandomFile {
35 |
36 | private static final int DEFAULT_FILE_SIZE = 200;
37 | private static Random random = new Random();
38 |
39 | private final File file;
40 | private final byte[] contents;
41 |
42 | public RandomFile(final File directory, final String filename) {
43 | this(new File(directory, filename));
44 | }
45 |
46 | public RandomFile(final File file) {
47 | this(file, DEFAULT_FILE_SIZE);
48 | }
49 |
50 | public RandomFile(final File file, final int size) {
51 | this.file = file;
52 |
53 | contents = new byte[size];
54 | random.nextBytes(contents);
55 | final File parent = file.getParentFile();
56 | if (!parent.exists() && !parent.mkdirs())
57 | throw new RuntimeException("Failed to make parent directory [" + parent.getAbsolutePath() + "]");
58 | try {
59 | FileUtils.writeByteArrayToFile(file, contents);
60 | } catch (IOException ioe) {
61 | throw new RuntimeException("Failed to create file [" + file.getAbsolutePath() + "]", ioe);
62 | }
63 | }
64 |
65 | public File getFile() {
66 | return file;
67 | }
68 |
69 | public byte[] getContents() {
70 | return Arrays.copyOf(contents, contents.length);
71 | }
72 |
73 | public String getFileName() {
74 | return file.getName();
75 | }
76 |
77 | }
78 |
--------------------------------------------------------------------------------
/src/test/resources/jenkins/plugins/publish_over_ssh/jenkins/LegacyConfigurationTest/testLoadR0x1/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1.388
4 | 2
5 | NORMAL
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | 5
14 | 0
15 |
16 |
17 |
18 | All
19 | false
20 | false
21 |
22 |
23 | All
24 | 0
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/test/resources/jenkins/plugins/publish_over_ssh/jenkins/LegacyConfigurationTest/testLoadR0x12/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1.406
4 | 2
5 | NORMAL
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | 5
14 | 0
15 |
16 |
17 |
18 | All
19 | false
20 | false
21 |
22 |
23 | All
24 | 0
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/test/resources/jenkins/plugins/publish_over_ssh/jenkins/LegacyConfigurationTest/testLoadR0x12/identity.key:
--------------------------------------------------------------------------------
1 | -----BEGIN RSA PRIVATE KEY-----
2 | MIIEpQIBAAKCAQEAqP14Avq3pRLDN3IS68bdaOJXZLKCNWFV8wiY9bbamvuHIGzM
3 | j33akG7O6lVJloDz9UbOADfEUfzdW1prjFUtCYvSvu908Ieue6Yd5eb9a5uG/yn2
4 | WmleyWjYxE4HTgsCqjhtrUv+TXZzpEV3wW0y8uF3f78/5NJRiKBB2RNEp7pEOD/G
5 | bXGh3oiKVxo2S15jUBkjZo8dmd9rCY6vQZDbFBv5veqItepRsD8/1ZSruMsZoWsb
6 | led2VGVyFR5mTgDGBj/1JxfpfUG2ShgNV/ows1TuqWYvXypQxxsDCOXD2LxboFx6
7 | 4fUjAnwseF0x+eQJe5dJ5x2NEZYrbJyLRLD/ywIDAQABAoIBAA3hW+UqwMDPTLeW
8 | KBWzrOX7iWAdBXLq/stKjn3IOiZ2uH+iUB8NIFGyuE4pGTVCfEdOPIdqDTcKxQfG
9 | 4oSRTnS1Rmcmdf13t44yc8w5b+FR0gHNaY29j+qNMRjWq+TuJJbksaWFU2r7ar44
10 | coCxvniSqmUUyWO7HrVRLHdvDLmWAZUS9YD/uCKu+EVg9/n+QKVTLFVVHEM4j1FB
11 | PxhqLt5EU4+Q6nkMUEETRLk+I1FQyFA32CtjF+B+1tA2BV3WLviuzlB09v/h3E0w
12 | Cuxw+H2LOm8Ih8ovHnNUYJ/XCunzhFwj68UF3wYyu1Ib7K+QS9pYCPhFyqEVlLIi
13 | xVde5qECgYEA8BncNvxyyo8QA6WQ0saL6xBgdDuuyL7aWsp26GVlprjnhbhc7Un3
14 | 8ajIU5abUOcAhDdsq7K2fuFum1hvDarWrwnMWwYAP0iLCX6XuE7KnQeanVhfrxkV
15 | OygwSEYXGjwr2q5TZhG3oPsU6aG2BqG0SM+HyJMTrK3hHHMmu8pFIXsCgYEAtC4m
16 | 8e8nZqDiM0MApSZEh2RlhelSTC80T0S5sTCqHvtSCrw+tT80p8Y9JobW5ZHSfutj
17 | qvFBdNRHk30oEPm9YiH8F1WtZooV0/rN5H4iQ5uSXufIfrfLuKARA+S7OS/UEUww
18 | v4vSmOaNkUSLvRV2+S/k7TiDrMvAk+j7tWkBAfECgYEAsKp2jMcIN984a1aBz3Vk
19 | MpwkPKJFo1Q7Gp7rC2jAeQKI6K2VQswwclI8xLSGp+qxSJf3kAa5nXaGiitx216f
20 | BMBy627o86ePFnddb7IaB502uRvzm8UbCCI0FJnuGdG4evnWR741nW/iHV5tr0eA
21 | fiqlwIHn8iEnCGX6VCcq4s0CgYEAsXxo9pb7O/gs+gv9XbFVff0imIeeftdc8tyj
22 | Am0Kl1w/k72dE9MAHmiDoijfFOLQ9B8RXbkrHldhbmKyDg7ERB9wANhv5/sLx3Ve
23 | Tb8GJ4ze4Uf20wRf1C0wtaIh3xJDFwrzViv4to8dUsSv1gGH4a0RF7A83QEUYV72
24 | W9vklzECgYEAumwGOHipwQ49+DFpleXpT6wyrqFVVf+mDnINklInknZKtCNnfcdN
25 | 2J1CbxAxuIsnRE79pA+UNgGLE110wkRTaayHA8jF7dUSaUuyhk02RD4i0RzonoM/
26 | 1G7ZtJrjopJg3pWcYMza8JPeB1TxAMBsq/xH0XZj0JCzJG5Uca8rZlY=
27 | -----END RSA PRIVATE KEY-----
28 |
--------------------------------------------------------------------------------
/src/test/resources/jenkins/plugins/publish_over_ssh/jenkins/LegacyConfigurationTest/testLoadR0x12/jobs/test job/nextBuildNumber:
--------------------------------------------------------------------------------
1 | 1
2 |
--------------------------------------------------------------------------------
/src/test/resources/jenkins/plugins/publish_over_ssh/jenkins/LegacyConfigurationTest/testLoadR0x12/secret.key:
--------------------------------------------------------------------------------
1 | 5ce5f429648f55d23048bdce4cd60d27c5d667989b2c38e9ee1e7b3c9e43d596
--------------------------------------------------------------------------------
/src/test/resources/jenkins/plugins/publish_over_ssh/jenkins/LegacyConfigurationTest/testLoadR0x1Minimal/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
25 |
26 |
27 | 1.388
28 | 2
29 | NORMAL
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | 5
38 | 0
39 |
40 |
41 |
42 | All
43 | false
44 | false
45 |
46 |
47 | All
48 | 0
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/src/test/resources/jenkins/plugins/publish_over_ssh/jenkins/LegacyConfigurationTest/testLoadR0x1Minimal/jenkins.plugins.publish_over_ssh.BapSshPublisherPlugin.xml:
--------------------------------------------------------------------------------
1 |
2 |
25 |
26 |
27 |
28 | jenkins.plugins.publish_over_ssh.BapSshCommonConfiguration
29 | jenkins.plugins.publish_over_ssh.BapSshHostConfiguration
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | default
38 | hostname
39 | username
40 |
41 | 22
42 |
43 | 300000
44 | true
45 |
46 | password
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/src/test/resources/jenkins/plugins/publish_over_ssh/jenkins/LegacyConfigurationTest/testLoadR0x1Minimal/jobs/test job/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
25 |
26 |
27 |
28 |
29 | false
30 |
31 |
32 | true
33 | false
34 | false
35 |
36 | false
37 |
38 |
39 |
40 |
41 |
42 |
43 | default
44 | false
45 |
46 |
47 |
48 | **/*
49 |
50 | false
51 | false
52 |
53 | 120000
54 |
55 |
56 |
57 |
58 | false
59 | false
60 | false
61 |
62 |
63 |
64 | SSH:
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------