├── src ├── main │ ├── resources │ │ ├── lib │ │ │ └── publish_over_cifs │ │ │ │ ├── taglib │ │ │ │ └── blockWrapper.jelly │ │ ├── jenkins │ │ │ └── plugins │ │ │ │ └── publish_over_cifs │ │ │ │ ├── CifsNodeProperties │ │ │ │ ├── config.properties │ │ │ │ ├── config_no_BV.properties │ │ │ │ ├── help-winsServer.html │ │ │ │ ├── config.jelly │ │ │ │ └── help.html │ │ │ │ ├── options │ │ │ │ ├── CifsOverridePublisherDefaults │ │ │ │ │ ├── config.properties │ │ │ │ │ ├── config_no_BV.properties │ │ │ │ │ └── config.jelly │ │ │ │ ├── CifsPluginDefaults │ │ │ │ │ └── config.jelly │ │ │ │ ├── CifsOverridePublisherLabelDefaults │ │ │ │ │ └── config.jelly │ │ │ │ ├── CifsOverrideParamPublishDefaults │ │ │ │ │ └── config.jelly │ │ │ │ ├── CifsOverrideRetryDefaults │ │ │ │ │ └── config.jelly │ │ │ │ ├── CifsOverrideDefaults │ │ │ │ │ └── config.jelly │ │ │ │ ├── CifsOverrideInstanceConfigDefaults │ │ │ │ │ └── config.jelly │ │ │ │ └── CifsOverrideTransferDefaults │ │ │ │ │ └── config.jelly │ │ │ │ ├── CifsPublisherPlugin │ │ │ │ ├── help.html │ │ │ │ ├── global_no_BV.properties │ │ │ │ ├── global.properties │ │ │ │ ├── config_no_BV.properties │ │ │ │ ├── config.properties │ │ │ │ ├── help-noDefaultExcludes.jelly │ │ │ │ ├── help-paramPublish.jelly │ │ │ │ └── global.groovy │ │ │ │ ├── CifsPromotionPublisherPlugin │ │ │ │ └── help.html │ │ │ │ ├── Messages_no_BV.properties │ │ │ │ └── Messages.properties │ │ └── index.jelly │ ├── webapp │ │ └── help │ │ │ ├── global │ │ │ ├── port.html │ │ │ ├── password.html │ │ │ ├── bufferSize.html │ │ │ ├── hostname.html │ │ │ ├── timeOut.html │ │ │ ├── smbVersion.html │ │ │ ├── name.html │ │ │ ├── username.html │ │ │ ├── defaultWinsServer.html │ │ │ └── remoteRootDir.html │ │ │ └── config │ │ │ ├── retries.html │ │ │ ├── retryDelay.html │ │ │ ├── continueOnError.html │ │ │ ├── verbose.html │ │ │ ├── cleanRemote.html │ │ │ ├── failOnError.html │ │ │ ├── parameterName.html │ │ │ ├── label.html │ │ │ ├── publishWhenFailed.html │ │ │ ├── configName.html │ │ │ ├── retry.html │ │ │ ├── useWorkspaceInPromotionForMatrix.html │ │ │ ├── remoteDirectory.html │ │ │ ├── masterNodeName.html │ │ │ ├── flatten.html │ │ │ ├── excludes.html │ │ │ ├── sourceFiles.html │ │ │ ├── usePromotionTimestamp.html │ │ │ ├── alwaysTxfrFromMaster.html │ │ │ ├── sourceFilesForPromotion.html │ │ │ ├── useWorkspaceInPromotion.html │ │ │ ├── removePrefix.html │ │ │ └── remoteDirectorySDF.html │ └── java │ │ └── jenkins │ │ └── plugins │ │ └── publish_over_cifs │ │ ├── CifsCleanNodeProperties.java │ │ ├── options │ │ ├── CifsOptions.java │ │ ├── CifsDefaults.java │ │ ├── CifsOverridePublisherLabelDefaults.java │ │ ├── CifsOverrideParamPublishDefaults.java │ │ ├── CifsPluginDefaults.java │ │ ├── CifsOverrideRetryDefaults.java │ │ ├── CifsOverridePublisherDefaults.java │ │ ├── CifsOverrideInstanceConfigDefaults.java │ │ ├── CifsOverrideTransferDefaults.java │ │ └── CifsOverrideDefaults.java │ │ ├── CifsRetry.java │ │ ├── CifsPublisherLabel.java │ │ ├── CifsParamPublish.java │ │ ├── CifsNodeProperties.java │ │ ├── CifsTransfer.java │ │ ├── CifsHelper.java │ │ ├── CifsPublisher.java │ │ ├── CifsBuilderPlugin.java │ │ ├── CifsPromotionPublisherPlugin.java │ │ ├── CifsClient.java │ │ └── CifsPublisherPlugin.java └── test │ └── java │ ├── hudson │ └── util │ │ └── SecretHelper.java │ └── jenkins │ └── plugins │ └── publish_over_cifs │ ├── CifsTestHelper.java │ └── CifsPublisherTest.java ├── .mvn ├── maven.config └── extensions.xml ├── .github ├── release-drafter.yml ├── dependabot.yml └── workflows │ ├── release-drafter.yml │ └── jenkins-security-scan.yml ├── docs └── images │ ├── cifs_advanced.png │ ├── cifs_builder.png │ ├── cifs_configured.png │ ├── cifs_promotions.png │ ├── cifs_unconfigured.png │ ├── cifs_global_advanced.png │ ├── cifs_global_configured.png │ ├── cifs_node_props_global.png │ ├── cifs_publisher_advanced.png │ └── cifs_global_unconfigured.png ├── Jenkinsfile ├── .gitignore ├── pom.xml └── README.md /src/main/resources/lib/publish_over_cifs/taglib: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.mvn/maven.config: -------------------------------------------------------------------------------- 1 | -Pconsume-incrementals 2 | -Pmight-produce-incrementals 3 | -------------------------------------------------------------------------------- /.github/release-drafter.yml: -------------------------------------------------------------------------------- 1 | _extends: .github 2 | tag-template: publish-over-cifs-$NEXT_MINOR_VERSION 3 | 4 | -------------------------------------------------------------------------------- /docs/images/cifs_advanced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkinsci/publish-over-cifs-plugin/HEAD/docs/images/cifs_advanced.png -------------------------------------------------------------------------------- /docs/images/cifs_builder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkinsci/publish-over-cifs-plugin/HEAD/docs/images/cifs_builder.png -------------------------------------------------------------------------------- /docs/images/cifs_configured.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkinsci/publish-over-cifs-plugin/HEAD/docs/images/cifs_configured.png -------------------------------------------------------------------------------- /docs/images/cifs_promotions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkinsci/publish-over-cifs-plugin/HEAD/docs/images/cifs_promotions.png -------------------------------------------------------------------------------- /docs/images/cifs_unconfigured.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkinsci/publish-over-cifs-plugin/HEAD/docs/images/cifs_unconfigured.png -------------------------------------------------------------------------------- /docs/images/cifs_global_advanced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkinsci/publish-over-cifs-plugin/HEAD/docs/images/cifs_global_advanced.png -------------------------------------------------------------------------------- /docs/images/cifs_global_configured.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkinsci/publish-over-cifs-plugin/HEAD/docs/images/cifs_global_configured.png -------------------------------------------------------------------------------- /docs/images/cifs_node_props_global.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkinsci/publish-over-cifs-plugin/HEAD/docs/images/cifs_node_props_global.png -------------------------------------------------------------------------------- /docs/images/cifs_publisher_advanced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkinsci/publish-over-cifs-plugin/HEAD/docs/images/cifs_publisher_advanced.png -------------------------------------------------------------------------------- /docs/images/cifs_global_unconfigured.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkinsci/publish-over-cifs-plugin/HEAD/docs/images/cifs_global_unconfigured.png -------------------------------------------------------------------------------- /.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 | 13 | -------------------------------------------------------------------------------- /.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | io.jenkins.tools.incrementals 4 | git-changelist-maven-extension 5 | 1.8 6 | 7 | 8 | -------------------------------------------------------------------------------- /.github/workflows/release-drafter.yml: -------------------------------------------------------------------------------- 1 | name: Release Drafter 2 | 3 | on: 4 | push: 5 | # branches to consider in the event; optional, defaults to all 6 | branches: 7 | - main 8 | 9 | jobs: 10 | update_release_draft: 11 | runs-on: ubuntu-latest 12 | steps: 13 | # Drafts your next Release notes as Pull Requests are merged into "main" 14 | - uses: release-drafter/release-drafter@v5 15 | env: 16 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 17 | 18 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | /* 2 | See the documentation for more options: 3 | https://github.com/jenkins-infra/pipeline-library/ 4 | */ 5 | buildPlugin( 6 | forkCount: '1C', // run this number of tests in parallel for faster feedback. If the number terminates with a 'C', the value will be multiplied by the number of available CPU cores 7 | useContainerAgent: true, // Set to `false` if you need to use Docker for containerized tests 8 | configurations: [ 9 | [platform: 'linux', jdk: 21], 10 | [platform: 'windows', jdk: 17], 11 | ]) 12 | -------------------------------------------------------------------------------- /src/main/resources/lib/publish_over_cifs/blockWrapper.jelly: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 |
9 |
10 | 11 | 12 | 13 |
14 |
15 |
16 |
17 | -------------------------------------------------------------------------------- /.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 | 22 | -------------------------------------------------------------------------------- /.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 | .DS_Store -------------------------------------------------------------------------------- /src/main/resources/jenkins/plugins/publish_over_cifs/CifsNodeProperties/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 | winsServer=WINS server -------------------------------------------------------------------------------- /src/main/resources/jenkins/plugins/publish_over_cifs/CifsNodeProperties/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 | winsServer=W*N* s*r*e* -------------------------------------------------------------------------------- /src/main/resources/jenkins/plugins/publish_over_cifs/options/CifsOverridePublisherDefaults/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=Share name 26 | -------------------------------------------------------------------------------- /src/main/webapp/help/global/port.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
The port the server is listening on.
26 | -------------------------------------------------------------------------------- /src/main/resources/jenkins/plugins/publish_over_cifs/options/CifsOverridePublisherDefaults/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*a*e n*m* 26 | -------------------------------------------------------------------------------- /src/main/webapp/help/global/password.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
The (optional) password to log in with.
26 | -------------------------------------------------------------------------------- /src/main/webapp/help/global/bufferSize.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
The size of buffer that plugin shall use.
26 | -------------------------------------------------------------------------------- /src/main/webapp/help/global/hostname.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
Hostname, IP address or servername to connect to.
26 | -------------------------------------------------------------------------------- /src/main/webapp/help/config/retries.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
The number of times to retry this server in the event of failure.
26 | -------------------------------------------------------------------------------- /src/main/webapp/help/config/retryDelay.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
The time to wait, in milliseconds, before attempting another transfer.
26 | -------------------------------------------------------------------------------- /src/main/webapp/help/global/timeOut.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
26 |

Timeout in milliseconds for a server response.

27 |
28 | -------------------------------------------------------------------------------- /src/main/resources/jenkins/plugins/publish_over_cifs/CifsPublisherPlugin/help.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
Send build artifacts to a windows share
26 | -------------------------------------------------------------------------------- /src/main/webapp/help/global/smbVersion.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
Highest version of SMB to use in negotiation. Some servers only support specific versions.
26 | -------------------------------------------------------------------------------- /src/main/webapp/help/global/name.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
The name of this configuration. This will be appear in the drop down list in the job configuration.
26 | -------------------------------------------------------------------------------- /src/main/resources/index.jelly: -------------------------------------------------------------------------------- 1 | 2 | 3 | 26 | 27 |
28 | Send build artifacts to a windows share (CIFS/SMB/samba) 29 |
30 | -------------------------------------------------------------------------------- /src/main/webapp/help/config/continueOnError.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
Select to continue publishing to the other shares after a problem publishing to a previous share.
26 | -------------------------------------------------------------------------------- /src/main/webapp/help/config/verbose.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
Select to enable an obscene amount of information to the Jenkins console - only really useful to help track down problems.
26 | -------------------------------------------------------------------------------- /src/main/webapp/help/config/cleanRemote.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
26 |

Select to delete all files and directories within the remote directory before transferring files.

27 |
28 | -------------------------------------------------------------------------------- /src/main/resources/jenkins/plugins/publish_over_cifs/CifsPromotionPublisherPlugin/help.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
Send build artifacts to a windows share as a build step during a promotion process
26 | -------------------------------------------------------------------------------- /src/main/resources/jenkins/plugins/publish_over_cifs/options/CifsPluginDefaults/config.jelly: -------------------------------------------------------------------------------- 1 | 2 | 3 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/main/webapp/help/config/failOnError.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
Select to mark the build as a failure if there is a problem publishing to a share. The default is to mark the build as unstable.
26 | -------------------------------------------------------------------------------- /src/main/webapp/help/config/parameterName.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
26 | The name of the parameter or environment variable that will contain the expression for matching the labels. 27 |
28 | -------------------------------------------------------------------------------- /src/main/webapp/help/global/username.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
26 | Either username or domain\username
27 | e.g. sullivanr or CRUCIBLE\sullivanr 28 |
29 | -------------------------------------------------------------------------------- /src/main/webapp/help/global/defaultWinsServer.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
26 | Set the IP address of a WINS server.
27 | This is the default IP address which can be overridden for individual nodes. 28 |
29 | -------------------------------------------------------------------------------- /src/main/resources/jenkins/plugins/publish_over_cifs/CifsNodeProperties/help-winsServer.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
26 |

The IP address of a WINS server

27 |

Leave empty to disable WINS resolution

28 |
29 | -------------------------------------------------------------------------------- /src/main/webapp/help/config/label.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
26 |

Set the label for this share instance - for use with Parameterized publishing.

27 |

Expand the help for Parameterized publishing for more details.

28 |
29 | -------------------------------------------------------------------------------- /src/main/webapp/help/config/publishWhenFailed.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
26 |

Select to publish artifacts even when the build state is failure.

27 |

The default is to only publish if the build is unstable or better.

28 |
29 | -------------------------------------------------------------------------------- /src/main/resources/jenkins/plugins/publish_over_cifs/CifsPublisherPlugin/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 | hostconfig.section.title=P*b*i*h o*e* C*F* 26 | hostconfig.section.description=A c*n*i*u*a*i*n t* u*e t* c*n*e*t t* a w*n*o*s s*a*e 27 | hostconfig.entry=C*F* S*a*e* 28 | hostconfig.dragAndDrop=C*F* S*a*e 29 | remotePath=S*a*e 30 | -------------------------------------------------------------------------------- /src/main/webapp/help/config/configName.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
26 |

Select a share configuration from the list configured in the global configuration of this Jenkins.

27 |

The configuration defines the connection properties, share name and an optional base directory.

28 |
29 | -------------------------------------------------------------------------------- /src/main/webapp/help/config/retry.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
26 |

If publishing to this share fails, try again.

27 |

Files that were successfully transferred will not be re-sent.
28 | If the Clean remote option is selected, and succeeds, it will not be attempted again.

29 |
30 | -------------------------------------------------------------------------------- /src/main/webapp/help/config/useWorkspaceInPromotionForMatrix.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
26 |

Matrix jobs will always use the workspace as the base directory for Source files - even in promotions.

27 |

The promotion process will only run once and the build artifacts are stored beneath each configuration.

28 |
29 | -------------------------------------------------------------------------------- /src/main/resources/jenkins/plugins/publish_over_cifs/CifsNodeProperties/config.jelly: -------------------------------------------------------------------------------- 1 | 2 | 3 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/main/resources/jenkins/plugins/publish_over_cifs/CifsPublisherPlugin/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 | hostconfig.section.title=Publish over CIFS 26 | hostconfig.section.description=A configuration to use to connect to a windows share 27 | hostconfig.entry=CIFS Shares 28 | hostconfig.dragAndDrop=CIFS Share 29 | remotePath=Share 30 | hostconfig.field.bufferSize=Buffer size (Bytes) 31 | hostconfig.field.smbVersion=SMB Version 32 | -------------------------------------------------------------------------------- /src/main/webapp/help/config/remoteDirectory.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
26 |

Optional destination folder.

27 |

This folder will be below the one in the global configuration, if present.
28 | The folder will be created if it does not exist.
29 | The path can also use the Jenkins environment variables eg. $JOB_NAME or $BUILD_NUMBER.

30 |
31 | -------------------------------------------------------------------------------- /src/main/webapp/help/config/masterNodeName.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
26 |

Set the NODE_NAME for the master Jenkins.

27 |

Set this option to give a value to the NODE_NAME environment variable when the value is missing (the Jenkins master).
28 | This is useful if you use the NODE_NAME variable in the remoteDirectory option and the build may occur on the master.

29 |
30 | -------------------------------------------------------------------------------- /src/main/webapp/help/global/remoteRootDir.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
26 |

The share name and optional base directory for this configuration.

27 |

This directory must exist, it will not be created.
28 | The publisher will only be able to place files below this directory.

29 |

e.g. myShare or myShare\subdir1\subdir2

30 |
31 | -------------------------------------------------------------------------------- /src/main/webapp/help/config/flatten.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
26 |

Only create files on the share, 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.

29 |
30 | -------------------------------------------------------------------------------- /src/test/java/hudson/util/SecretHelper.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 hudson.util; 26 | 27 | public class SecretHelper { 28 | 29 | private static final String KEY = "7b41d2675f759b479460a41a9758bd0f6049a23ac685dc739bf7bb2d2319472d"; 30 | 31 | public static void setSecretKey() { 32 | Secret.SECRET = KEY; 33 | } 34 | 35 | public static void clearSecretKey() { 36 | Secret.SECRET = null; 37 | } 38 | 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/resources/jenkins/plugins/publish_over_cifs/CifsPublisherPlugin/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=C*F* P*b*i*h*r* 26 | publisher.dragAndDropLabel=C*F* S*a*e 27 | hostconfig.description=S*l*c* a h*s* c*n*i*u*a*i*n f*o* t*e l*s* c*n*i*u*e* i* t*e g*o*a* J*n*i*s s*t*i*g* 28 | addPublisher=A*d S*a*e 29 | deletePublisher=D*l*t* S*a*e 30 | continueOnError=P*b*i*h t* o*h*r s*a*e* i* a* e*r*r o*c*r* 31 | alwaysTxfrFromMaster=A*w*y* t*a*s*e* f*o* m*s*e* 32 | -------------------------------------------------------------------------------- /src/main/resources/jenkins/plugins/publish_over_cifs/options/CifsOverridePublisherLabelDefaults/config.jelly: -------------------------------------------------------------------------------- 1 | 2 | 3 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/main/webapp/help/config/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 29 | in the Ant manual) and can also use the Jenkins environment variables eg. $JOB_NAME or $BUILD_NUMBER.
30 |

31 |
32 | -------------------------------------------------------------------------------- /src/main/resources/jenkins/plugins/publish_over_cifs/options/CifsOverrideParamPublishDefaults/config.jelly: -------------------------------------------------------------------------------- 1 | 2 | 3 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/main/resources/jenkins/plugins/publish_over_cifs/CifsPublisherPlugin/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=CIFS Publishers 26 | publisher.dragAndDropLabel=CIFS Share 27 | hostconfig.description=Select a host configuration from the list configured in the global Jenkins settings 28 | addPublisher=Add Share 29 | deletePublisher=Delete Share 30 | continueOnError=Publish to other shares if an error occurs 31 | alwaysTxfrFromMaster=Always transfer from master 32 | publishWhenFailed=Publish even when build state is failure 33 | -------------------------------------------------------------------------------- /src/main/webapp/help/config/sourceFiles.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
26 |

Files to upload to a share.

27 |

The string is a comma separated list of includes for an Ant fileset eg. '**/*.jar' 28 | (see Patterns 29 | in the Ant manual) and can also use the Jenkins environment variables eg. $JOB_NAME or $BUILD_NUMBER.
30 | The base directory for this fileset is the workspace. 31 |

32 |
33 | -------------------------------------------------------------------------------- /src/main/resources/jenkins/plugins/publish_over_cifs/CifsNodeProperties/help.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
26 |

Set node specific properties for use with the Publish Over CIFS Plugin

27 |

Set the values for the master server and defaults for the agents in the Global properties 28 | section of the main Jenkins configuration. Individual agents are configured separately.
29 | To use the default values, do not check the box in the agent config.

30 |
31 | -------------------------------------------------------------------------------- /src/main/webapp/help/config/usePromotionTimestamp.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
26 |

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.

30 |
31 | -------------------------------------------------------------------------------- /src/main/java/jenkins/plugins/publish_over_cifs/CifsCleanNodeProperties.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_cifs; 26 | 27 | import java.io.Serializable; 28 | 29 | public class CifsCleanNodeProperties implements Serializable { 30 | 31 | private static final long serialVersionUID = 1L; 32 | private final String winsServer; 33 | 34 | public CifsCleanNodeProperties(final String winsServer) { 35 | this.winsServer = winsServer; 36 | } 37 | 38 | public String getWinsServer() { 39 | return winsServer; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/resources/jenkins/plugins/publish_over_cifs/options/CifsOverrideRetryDefaults/config.jelly: -------------------------------------------------------------------------------- 1 | 2 | 3 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/main/webapp/help/config/alwaysTxfrFromMaster.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
26 |

Select to always connect from the Jenkins master.

27 |

The default is to connect 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 windows share, this may 30 | increase network traffic, and could increase the build time.

31 |
32 | -------------------------------------------------------------------------------- /src/main/resources/jenkins/plugins/publish_over_cifs/options/CifsOverrideDefaults/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_cifs/CifsPublisherPlugin/help-noDefaultExcludes.jelly: -------------------------------------------------------------------------------- 1 | 2 | 3 | 26 | 27 | 28 | 29 | Select this option to disable the default exclude patterns. 30 |

The default exclude patterns are: 31 | 32 |

33 |             
34 |                 ${pattern}
35 |
36 |
37 |

38 | 39 |
-------------------------------------------------------------------------------- /src/main/webapp/help/config/sourceFilesForPromotion.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
26 |

Files to upload to a share.

27 |

The string is a comma separated list of includes for an Ant fileset eg. '**/*.jar' 28 | (see Patterns 29 | in the Ant manual) and can also use the Jenkins environment variables eg. $JOB_NAME or $BUILD_NUMBER.
30 | The base directory for this fileset is the artifacts directory of the build that is being promoted.
31 | Change the base directory to the workspace by setting the "Use the workspace" checkbox. 32 |

33 |
34 | -------------------------------------------------------------------------------- /src/main/webapp/help/config/useWorkspaceInPromotion.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
26 |

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 share, 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

34 |
35 | -------------------------------------------------------------------------------- /src/main/java/jenkins/plugins/publish_over_cifs/options/CifsOptions.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_cifs.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 | import jenkins.plugins.publish_over.options.TransferOptions; 33 | 34 | public interface CifsOptions { 35 | 36 | InstanceConfigOptions getInstanceConfig(); 37 | ParamPublishOptions getParamPublish(); 38 | PublisherOptions getPublisher(); 39 | PublisherLabelOptions getPublisherLabel(); 40 | RetryOptions getRetry(); 41 | TransferOptions getTransfer(); 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/webapp/help/config/removePrefix.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
26 |

First part of the file path that should not be created on the remote share.

27 |

If this prefix matches the start of a path to a file, then it will be removed from the file path.
28 | Directory structures are created relative to the base directory, which is usually the workspace.
29 | You normally do not want the full path to these files to be created on the server.
30 | For example if Source files were target/deployment/images/**/* then you may want Remove prefix to be target/deployment 31 | This would create the images folder under the remote directory, and not target/deployment
32 | Jenkins environment variables can be used in this path.

33 |

If you use remove prefix, then ALL source file paths MUST start with the prefix.

34 |
35 | -------------------------------------------------------------------------------- /src/main/java/jenkins/plugins/publish_over_cifs/options/CifsDefaults.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_cifs.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 CifsDefaults implements Describable, ExtensionPoint, CifsOptions { 34 | 35 | public static DescriptorExtensionList all() { 36 | return Jenkins.getInstance().getDescriptorList(CifsDefaults.class); 37 | } 38 | 39 | public CifsDefaultsDescriptor getDescriptor() { 40 | return (CifsDefaultsDescriptor) Jenkins.getInstance().getDescriptor(getClass()); 41 | } 42 | 43 | public abstract static class CifsDefaultsDescriptor extends Descriptor { 44 | 45 | protected CifsDefaultsDescriptor() { } 46 | 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/resources/jenkins/plugins/publish_over_cifs/options/CifsOverrideInstanceConfigDefaults/config.jelly: -------------------------------------------------------------------------------- 1 | 2 | 3 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /src/main/java/jenkins/plugins/publish_over_cifs/CifsRetry.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_cifs; 26 | 27 | import jenkins.plugins.publish_over.Retry; 28 | import org.apache.commons.lang.builder.EqualsBuilder; 29 | import org.apache.commons.lang.builder.HashCodeBuilder; 30 | import org.apache.commons.lang.builder.ToStringBuilder; 31 | import org.apache.commons.lang.builder.ToStringStyle; 32 | import org.kohsuke.stapler.DataBoundConstructor; 33 | 34 | public class CifsRetry extends Retry { 35 | 36 | private static final long serialVersionUID = 1L; 37 | 38 | @DataBoundConstructor 39 | public CifsRetry(final int retries, final long retryDelay) { 40 | super(retries, retryDelay); 41 | } 42 | 43 | public boolean equals(final Object that) { 44 | if (this == that) return true; 45 | if (that == null || getClass() != that.getClass()) return false; 46 | 47 | return addToEquals(new EqualsBuilder(), (CifsRetry) that).isEquals(); 48 | } 49 | 50 | public int hashCode() { 51 | return addToHashCode(new HashCodeBuilder()).toHashCode(); 52 | } 53 | 54 | public String toString() { 55 | return addToToString(new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)).toString(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/jenkins/plugins/publish_over_cifs/CifsPublisherLabel.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_cifs; 26 | 27 | import jenkins.plugins.publish_over.PublisherLabel; 28 | import org.apache.commons.lang.builder.EqualsBuilder; 29 | import org.apache.commons.lang.builder.HashCodeBuilder; 30 | import org.apache.commons.lang.builder.ToStringBuilder; 31 | import org.apache.commons.lang.builder.ToStringStyle; 32 | import org.kohsuke.stapler.DataBoundConstructor; 33 | 34 | public class CifsPublisherLabel extends PublisherLabel { 35 | 36 | private static final long serialVersionUID = 1L; 37 | 38 | @DataBoundConstructor 39 | public CifsPublisherLabel(final String label) { 40 | super(label); 41 | } 42 | 43 | public boolean equals(final Object that) { 44 | if (this == that) return true; 45 | if (that == null || getClass() != that.getClass()) return false; 46 | 47 | return addToEquals(new EqualsBuilder(), (CifsPublisherLabel) that).isEquals(); 48 | } 49 | 50 | public int hashCode() { 51 | return addToHashCode(new HashCodeBuilder()).toHashCode(); 52 | } 53 | 54 | public String toString() { 55 | return addToToString(new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)).toString(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/jenkins/plugins/publish_over_cifs/CifsParamPublish.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_cifs; 26 | 27 | import jenkins.plugins.publish_over.ParamPublish; 28 | import org.apache.commons.lang.builder.EqualsBuilder; 29 | import org.apache.commons.lang.builder.HashCodeBuilder; 30 | import org.apache.commons.lang.builder.ToStringBuilder; 31 | import org.apache.commons.lang.builder.ToStringStyle; 32 | import org.kohsuke.stapler.DataBoundConstructor; 33 | 34 | public class CifsParamPublish extends ParamPublish { 35 | 36 | private static final long serialVersionUID = 1L; 37 | 38 | @DataBoundConstructor 39 | public CifsParamPublish(final String parameterName) { 40 | super(parameterName); 41 | } 42 | 43 | public boolean equals(final Object that) { 44 | if (this == that) return true; 45 | if (that == null || getClass() != that.getClass()) return false; 46 | 47 | return addToEquals(new EqualsBuilder(), (CifsParamPublish) that).isEquals(); 48 | } 49 | 50 | public int hashCode() { 51 | return addToHashCode(new HashCodeBuilder()).toHashCode(); 52 | } 53 | 54 | public String toString() { 55 | return addToToString(new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)).toString(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/resources/jenkins/plugins/publish_over_cifs/options/CifsOverridePublisherDefaults/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/java/jenkins/plugins/publish_over_cifs/CifsNodeProperties.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_cifs; 26 | 27 | import hudson.Extension; 28 | import hudson.model.Node; 29 | import hudson.slaves.NodeProperty; 30 | import hudson.slaves.NodePropertyDescriptor; 31 | import hudson.util.FormValidation; 32 | import jenkins.plugins.publish_over.BPValidators; 33 | import org.kohsuke.stapler.DataBoundConstructor; 34 | import org.kohsuke.stapler.QueryParameter; 35 | 36 | public class CifsNodeProperties extends NodeProperty { 37 | 38 | private static final long serialVersionUID = 1L; 39 | public static final String FORM_PREFIX = "poc-np."; 40 | private String winsServer; 41 | 42 | @DataBoundConstructor 43 | public CifsNodeProperties(final String winsServer) { 44 | this.winsServer = winsServer; 45 | } 46 | 47 | public String getWinsServer() { return winsServer; } 48 | public void setWinsServer(final String winsServer) { this.winsServer = winsServer; } 49 | 50 | @Extension 51 | public static class CifsWinsNodePropertyDescriptor extends NodePropertyDescriptor { 52 | @Override 53 | public String getDisplayName() { 54 | return Messages.winsNodeProperty_descriptor_displayName(); 55 | } 56 | public FormValidation doCheckWinsServer(@QueryParameter final String value) { 57 | return BPValidators.validateOptionalIp(value); 58 | } 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/jenkins/plugins/publish_over_cifs/options/CifsOverridePublisherLabelDefaults.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_cifs.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 org.kohsuke.stapler.DataBoundConstructor; 33 | 34 | public class CifsOverridePublisherLabelDefaults implements PublisherLabelOptions, Describable { 35 | 36 | private final String label; 37 | 38 | @DataBoundConstructor 39 | public CifsOverridePublisherLabelDefaults(final String label) { 40 | this.label = label; 41 | } 42 | 43 | public String getLabel() { 44 | return label; 45 | } 46 | 47 | public CifsOverridePublisherLabelDefaultsDescriptor getDescriptor() { 48 | return Jenkins.getInstance().getDescriptorByType(CifsOverridePublisherLabelDefaultsDescriptor.class); 49 | } 50 | 51 | @Extension 52 | public static class CifsOverridePublisherLabelDefaultsDescriptor extends Descriptor { 53 | 54 | @Override 55 | public String getDisplayName() { 56 | return "CifsOverridePublisherLabelDefaultsDescriptor - not visible ..."; 57 | } 58 | 59 | public jenkins.plugins.publish_over.view_defaults.PublisherLabel.Messages getCommonFieldNames() { 60 | return new jenkins.plugins.publish_over.view_defaults.PublisherLabel.Messages(); 61 | } 62 | 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/jenkins/plugins/publish_over_cifs/options/CifsOverrideParamPublishDefaults.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_cifs.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 org.kohsuke.stapler.DataBoundConstructor; 33 | 34 | public class CifsOverrideParamPublishDefaults implements ParamPublishOptions, Describable { 35 | 36 | private final String parameterName; 37 | 38 | @DataBoundConstructor 39 | public CifsOverrideParamPublishDefaults(final String parameterName) { 40 | this.parameterName = parameterName; 41 | } 42 | 43 | public String getParameterName() { 44 | return parameterName; 45 | } 46 | 47 | public CifsOverrideParamPublishDefaultsDescriptor getDescriptor() { 48 | return Jenkins.getInstance().getDescriptorByType(CifsOverrideParamPublishDefaultsDescriptor.class); 49 | } 50 | 51 | @Extension 52 | public static class CifsOverrideParamPublishDefaultsDescriptor extends Descriptor { 53 | 54 | @Override 55 | public String getDisplayName() { 56 | return "CifsOverrideParamPublishDefaultsDescriptor - not visible ..."; 57 | } 58 | 59 | public jenkins.plugins.publish_over.view_defaults.ParamPublish.Messages getCommonFieldNames() { 60 | return new jenkins.plugins.publish_over.view_defaults.ParamPublish.Messages(); 61 | } 62 | 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /src/main/webapp/help/config/remoteDirectorySDF.html: -------------------------------------------------------------------------------- 1 | 24 | 25 |
26 |

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 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 |
Remote directoryDirectories created
'qa-approved/'yyyyMMddHHmmssqa-approved/20101107154555
'builds/'yyyy/MM/dd/'build-${BUILD_NUMBER}'builds/2010/11/07/build-456 (if the build was number 456)
yyyy_MM/'build'-EEE-d-HHmmss2010_11/build-Sun-7-154555
yyyy-MM-dd_HH-mm-ss2010-11-07_15-45-55
55 |

56 |
57 | -------------------------------------------------------------------------------- /src/main/java/jenkins/plugins/publish_over_cifs/CifsTransfer.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_cifs; 26 | 27 | import jenkins.plugins.publish_over.BPTransfer; 28 | import org.apache.commons.lang.StringUtils; 29 | import org.apache.commons.lang.builder.EqualsBuilder; 30 | import org.apache.commons.lang.builder.HashCodeBuilder; 31 | import org.apache.commons.lang.builder.ToStringBuilder; 32 | import org.apache.commons.lang.builder.ToStringStyle; 33 | import org.kohsuke.stapler.DataBoundConstructor; 34 | 35 | public class CifsTransfer extends BPTransfer { 36 | 37 | private static final long serialVersionUID = 1L; 38 | 39 | @DataBoundConstructor 40 | public CifsTransfer(final String sourceFiles, final String excludes, final String remoteDirectory, final String removePrefix, 41 | final boolean remoteDirectorySDF, final boolean flatten, final boolean cleanRemote, final boolean noDefaultExcludes, 42 | final boolean makeEmptyDirs, final String patternSeparator) { 43 | super(sourceFiles, excludes, remoteDirectory, removePrefix, remoteDirectorySDF, flatten, cleanRemote, 44 | noDefaultExcludes, makeEmptyDirs, StringUtils.isEmpty(patternSeparator) ? null : patternSeparator); 45 | } 46 | 47 | public boolean equals(final Object that) { 48 | if (this == that) return true; 49 | if (that == null || getClass() != that.getClass()) return false; 50 | 51 | return addToEquals(new EqualsBuilder(), (CifsTransfer) that).isEquals(); 52 | } 53 | 54 | public int hashCode() { 55 | return addToHashCode(new HashCodeBuilder()).toHashCode(); 56 | } 57 | 58 | public String toString() { 59 | return addToToString(new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)).toString(); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/main/resources/jenkins/plugins/publish_over_cifs/options/CifsOverrideTransferDefaults/config.jelly: -------------------------------------------------------------------------------- 1 | 2 | 3 | 26 | 27 | 28 | 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 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /src/main/java/jenkins/plugins/publish_over_cifs/options/CifsPluginDefaults.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_cifs.options; 26 | 27 | import hudson.Extension; 28 | import jenkins.plugins.publish_over.options.GlobalDefaults; 29 | import jenkins.plugins.publish_over.options.InstanceConfigOptions; 30 | import jenkins.plugins.publish_over.options.ParamPublishOptions; 31 | import jenkins.plugins.publish_over.options.PublisherLabelOptions; 32 | import jenkins.plugins.publish_over.options.PublisherOptions; 33 | import jenkins.plugins.publish_over.options.RetryOptions; 34 | import jenkins.plugins.publish_over.options.TransferOptions; 35 | import jenkins.plugins.publish_over.view_defaults.manage_jenkins.Messages; 36 | import org.kohsuke.stapler.DataBoundConstructor; 37 | 38 | public final class CifsPluginDefaults extends CifsDefaults { 39 | 40 | public static final GlobalDefaults GLOBAL_DEFAULTS = new GlobalDefaults(); 41 | 42 | @DataBoundConstructor 43 | public CifsPluginDefaults() { } 44 | 45 | public InstanceConfigOptions getInstanceConfig() { 46 | return GLOBAL_DEFAULTS; 47 | } 48 | 49 | public ParamPublishOptions getParamPublish() { 50 | return GLOBAL_DEFAULTS; 51 | } 52 | 53 | public PublisherOptions getPublisher() { 54 | return GLOBAL_DEFAULTS; 55 | } 56 | 57 | public PublisherLabelOptions getPublisherLabel() { 58 | return GLOBAL_DEFAULTS; 59 | } 60 | 61 | public RetryOptions getRetry() { 62 | return GLOBAL_DEFAULTS; 63 | } 64 | 65 | public TransferOptions getTransfer() { 66 | return GLOBAL_DEFAULTS; 67 | } 68 | 69 | @Extension 70 | public static final class CifsPluginDefaultsDescriptor extends CifsDefaultsDescriptor { 71 | 72 | @Override 73 | public String getDisplayName() { 74 | return Messages.defaults_pluginDefaults(); 75 | } 76 | 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /src/test/java/jenkins/plugins/publish_over_cifs/CifsTestHelper.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_cifs; 26 | 27 | import hudson.FilePath; 28 | import hudson.model.TaskListener; 29 | import jenkins.plugins.publish_over.BPBuildEnv; 30 | import jenkins.plugins.publish_over.BPBuildInfo; 31 | 32 | import java.io.File; 33 | import java.util.Calendar; 34 | import java.util.TreeMap; 35 | 36 | public class CifsTestHelper { 37 | 38 | public static BPBuildEnv createEmptyBuildEnv() { 39 | return new BPBuildEnv(new TreeMap(), new FilePath(new File("")), Calendar.getInstance()); 40 | } 41 | 42 | public static BPBuildInfo createEmpty() { 43 | return createEmpty(true); 44 | } 45 | 46 | public static BPBuildInfo createEmpty(final boolean setEffectiveEnvironment) { 47 | final BPBuildInfo buildInfo = new FakeBuildInfo(); 48 | if (setEffectiveEnvironment) { 49 | buildInfo.setBuildTime(buildInfo.getCurrentBuildEnv().getBuildTime()); 50 | buildInfo.setBaseDirectory(buildInfo.getCurrentBuildEnv().getBaseDirectory()); 51 | buildInfo.setEnvVars(buildInfo.getCurrentBuildEnv().getEnvVars()); 52 | } 53 | return buildInfo; 54 | } 55 | 56 | public static void setOnMaster(final BPBuildInfo buildInfo) { 57 | if (!(buildInfo instanceof FakeBuildInfo)) throw new IllegalArgumentException(); 58 | ((FakeBuildInfo) buildInfo).isOnMaster = true; 59 | } 60 | 61 | public static class FakeBuildInfo extends BPBuildInfo { 62 | private static final long serialVersionUID = 1L; 63 | private boolean isOnMaster; 64 | public FakeBuildInfo() { 65 | super(TaskListener.NULL, "", new FilePath(new File("")), createEmptyBuildEnv(), null); 66 | } 67 | @Override 68 | public boolean onMaster() { 69 | return isOnMaster; 70 | } 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /src/main/resources/jenkins/plugins/publish_over_cifs/Messages_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 | builder.descriptor.displayName=S*n* f*l*s t* a w*n*o*s s*a*e 26 | promotion.descriptor.displayName=S*n* b*i*d a*t*f*c*s t* a w*n*o*s s*a*e 27 | descriptor.displayName=S*n* b*i*d a*t*f*c*s t* a w*n*o*s s*a*e 28 | descriptor.testConnection.ok=S*c*e*s 29 | descriptor.testConnection.error=C*n*o* r*a* s*a*e (o* d*r*c*o*y o* s*a*e) 30 | 31 | console.message.prefix=C*F*: 32 | console.mkdir=mkdir [{0}] 33 | console.copy=copy [{0}] 34 | console.clean=c*e*n*n* [{0}] 35 | console.delete=del [{0}] 36 | console.config.noWins=R*m*v*n* W*N* f*o* n*m* r*s*l*t*o* 37 | console.config.wins=S*t*i*g W*N* s*r*e* [{0}] 38 | console.config.timout=S*t*i*g r*s*o*s* t*m*o*t [{0}] 39 | console.config.soTimeout=S*t*i*g s*c*e* t*m*o*t [{0}] 40 | 41 | exception.hostnameRequired=H*s*n*m* i* r*q*i*e* 42 | exception.shareRequired=S*a*e*a*e i* r*q*i*e* 43 | exception.malformedUrlException=M*l*o*m*d*r*E*c*p*i*n c*u*h* f*o* U*L [{0}] 44 | exception.jCifsException.testConfig=E*c*p*i*n w*e* t*s*i*g c*n*i*. U*L [{0}], M*s*a*e: [{1}] 45 | exception.jCifsException.exists=E*c*p*i*n w*e* t*s*i*g f*r t*e e*i*t*n*e o* d*r*c*o*y. U*L [{0}], M*s*a*e: [{1}] 46 | exception.jCifsException.canRead=E*c*p*i*n w*e* c*e*k*n* w*e*h*r c*n r*a* d*r*c*o*y. U*L [{0}], M*s*a*e: [{1}] 47 | exception.jCifsException.mkdirs=F*i*e* t* m*k* d*r*c*o*i*s U*L [{0}], M*s*a*e: [{1}] 48 | exception.jCifsException.delete=F*i*e* t* d*l*t* U*L [{0}], M*s*a*e: [{1}] 49 | exception.jCifsException.listFiles=F*i*e* t* l*s*F*l*s a* [{0}], M*s*a*e: [{1}] 50 | exception.listFilesReturnedNull=L*s*F*l*s w*s n*l*. U*L [{0}] 51 | exception.shareNotExist=T*e s*a*e o* d*r*c*o*y d*e* n*t e*i*t [{0}] 52 | exception.cannotReadShare=T*e s*a*e o* d*r*c*o*y i* n*t r*a*a*l* [{0}] 53 | exception.mkdir.directoryExists=D*r*c*o*y a*r*a*y e*i*t* [{0}] 54 | exception.noSourceFiles=A T*a*s*e* S*t m*s* c*n*a*n S*u*c* f*l*s - i* y*u r*a*l* w*n* t* i*c*u*e e*e*y*h*n*, s*t S*u*c* f*l*s t* **/ or **\\ 55 | exception.encode.cce=F*i*e* t* e*c*d* u*e* c*e*e*t*a*s, M*s*a*e [{0}] 56 | 57 | winsNodeProperty.descriptor.displayName=P*b*i*h O*e* C*F* 58 | -------------------------------------------------------------------------------- /src/main/java/jenkins/plugins/publish_over_cifs/options/CifsOverrideRetryDefaults.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_cifs.options; 26 | 27 | import hudson.Extension; 28 | import hudson.model.Describable; 29 | import hudson.model.Descriptor; 30 | import hudson.util.FormValidation; 31 | import jenkins.model.Jenkins; 32 | import jenkins.plugins.publish_over.options.RetryOptions; 33 | import org.kohsuke.stapler.DataBoundConstructor; 34 | import org.kohsuke.stapler.QueryParameter; 35 | 36 | public class CifsOverrideRetryDefaults implements RetryOptions, Describable { 37 | 38 | private final int retries; 39 | private final long retryDelay; 40 | 41 | @DataBoundConstructor 42 | public CifsOverrideRetryDefaults(final int retries, final long retryDelay) { 43 | this.retries = retries; 44 | this.retryDelay = retryDelay; 45 | } 46 | 47 | public int getRetries() { 48 | return retries; 49 | } 50 | 51 | public long getRetryDelay() { 52 | return retryDelay; 53 | } 54 | 55 | public CifsOverrideRetryDefaultsDescriptor getDescriptor() { 56 | return Jenkins.getInstance().getDescriptorByType(CifsOverrideRetryDefaultsDescriptor.class); 57 | } 58 | 59 | @Extension 60 | public static class CifsOverrideRetryDefaultsDescriptor extends Descriptor { 61 | 62 | @Override 63 | public String getDisplayName() { 64 | return "CifsOverrideRetryDefaultsDescriptor - not visible ..."; 65 | } 66 | 67 | public FormValidation doCheckRetries(@QueryParameter final String value) { 68 | return FormValidation.validateNonNegativeInteger(value); 69 | } 70 | 71 | public FormValidation doCheckRetryDelay(@QueryParameter final String value) { 72 | return FormValidation.validatePositiveInteger(value); 73 | } 74 | 75 | public jenkins.plugins.publish_over.view_defaults.Retry.Messages getCommonFieldNames() { 76 | return new jenkins.plugins.publish_over.view_defaults.Retry.Messages(); 77 | } 78 | 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /src/main/resources/jenkins/plugins/publish_over_cifs/Messages.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 | builder.descriptor.displayName=Send files to a windows share 26 | promotion.descriptor.displayName=Send build artifacts to a windows share 27 | descriptor.displayName=Send build artifacts to a windows share 28 | descriptor.testConnection.ok=Success 29 | descriptor.testConnection.error=Cannot read share (or directory on share) 30 | 31 | console.message.prefix=CIFS: 32 | console.mkdir=mkdir [{0}] 33 | console.copy=copy [{0}] 34 | console.clean=cleaning [{0}] 35 | console.delete=del [{0}] 36 | console.config.noWins=Removing WINS from name resolution 37 | console.config.wins=Setting WINS server [{0}] 38 | console.config.timout=Setting response timeout [{0}] 39 | console.config.soTimeout=Setting socket timeout [{0}] 40 | console.config.bufferSize=Setting buffer size to: [{0}] Bytes 41 | 42 | exception.hostnameRequired=Hostname is required 43 | exception.shareRequired=Sharename is required 44 | exception.malformedUrlException=MalformedUrlException caught from URL [{0}] 45 | exception.jCifsException.testConfig=Exception when testing config. URL [{0}], Message: [{1}] 46 | exception.jCifsException.exists=Exception when testing for the existence of directory. URL [{0}], Message: [{1}] 47 | exception.jCifsException.canRead=Exception when checking whether can read directory. URL [{0}], Message: [{1}] 48 | exception.jCifsException.mkdirs=Failed to make directories URL [{0}], Message: [{1}] 49 | exception.jCifsException.delete=Failed to delete URL [{0}], Message: [{1}] 50 | exception.jCifsException.listFiles=Failed to listFiles at [{0}], Message: [{1}] 51 | exception.listFilesReturnedNull=ListFiles was null. URL [{0}] 52 | exception.shareNotExist=The share or directory does not exist [{0}] 53 | exception.cannotReadShare=The share or directory is not readable [{0}] 54 | exception.mkdir.directoryExists=Directory already exists [{0}] 55 | exception.noSourceFiles=A Transfer Set must contain Source files - if you really want to include everything, set Source files to **/ or **\\ 56 | exception.encode.cce=Failed to encode user credentials, Message [{0}] 57 | 58 | winsNodeProperty.descriptor.displayName=Publish Over CIFS 59 | -------------------------------------------------------------------------------- /src/main/java/jenkins/plugins/publish_over_cifs/options/CifsOverridePublisherDefaults.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_cifs.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.PublisherOptions; 32 | import org.kohsuke.stapler.DataBoundConstructor; 33 | 34 | public class CifsOverridePublisherDefaults implements PublisherOptions, Describable { 35 | 36 | private final String configName; 37 | private final boolean useWorkspaceInPromotion; 38 | private final boolean usePromotionTimestamp; 39 | private final boolean verbose; 40 | 41 | @DataBoundConstructor 42 | public CifsOverridePublisherDefaults(final String configName, final boolean useWorkspaceInPromotion, 43 | final boolean usePromotionTimestamp, final boolean verbose) { 44 | this.configName = configName; 45 | this.usePromotionTimestamp = usePromotionTimestamp; 46 | this.useWorkspaceInPromotion = useWorkspaceInPromotion; 47 | this.verbose = verbose; 48 | } 49 | 50 | public String getConfigName() { 51 | return configName; 52 | } 53 | 54 | public boolean isUseWorkspaceInPromotion() { 55 | return useWorkspaceInPromotion; 56 | } 57 | 58 | public boolean isUsePromotionTimestamp() { 59 | return usePromotionTimestamp; 60 | } 61 | 62 | public boolean isVerbose() { 63 | return verbose; 64 | } 65 | 66 | public CifsOverridePublisherDefaultsDescriptor getDescriptor() { 67 | return Jenkins.getInstance().getDescriptorByType(CifsOverridePublisherDefaultsDescriptor.class); 68 | } 69 | 70 | @Extension 71 | public static class CifsOverridePublisherDefaultsDescriptor extends Descriptor { 72 | 73 | @Override 74 | public String getDisplayName() { 75 | return "CifsOverridePublisherDefaultsDescriptor - not visible ..."; 76 | } 77 | 78 | public jenkins.plugins.publish_over.view_defaults.BapPublisher.Messages getCommonFieldNames() { 79 | return new jenkins.plugins.publish_over.view_defaults.BapPublisher.Messages(); 80 | } 81 | 82 | } 83 | 84 | } 85 | -------------------------------------------------------------------------------- /src/main/java/jenkins/plugins/publish_over_cifs/options/CifsOverrideInstanceConfigDefaults.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_cifs.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 CifsOverrideInstanceConfigDefaults implements InstanceConfigOptions, Describable { 35 | 36 | private final boolean continueOnError; 37 | private final boolean failOnError; 38 | private final boolean alwaysPublishFromMaster; 39 | private final boolean publishWhenFailed; 40 | 41 | @DataBoundConstructor 42 | public CifsOverrideInstanceConfigDefaults(final boolean alwaysPublishFromMaster, final boolean continueOnError, 43 | final boolean failOnError, final boolean publishWhenFailed) { 44 | this.alwaysPublishFromMaster = alwaysPublishFromMaster; 45 | this.continueOnError = continueOnError; 46 | this.failOnError = failOnError; 47 | this.publishWhenFailed = publishWhenFailed; 48 | } 49 | 50 | public boolean isContinueOnError() { 51 | return continueOnError; 52 | } 53 | 54 | public boolean isFailOnError() { 55 | return failOnError; 56 | } 57 | 58 | public boolean isAlwaysPublishFromMaster() { 59 | return alwaysPublishFromMaster; 60 | } 61 | 62 | public boolean isPublishWhenFailed() { 63 | return publishWhenFailed; 64 | } 65 | public CifsOverrideInstanceConfigDefaultsDescriptor getDescriptor() { 66 | return Jenkins.getInstance().getDescriptorByType(CifsOverrideInstanceConfigDefaultsDescriptor.class); 67 | } 68 | 69 | @Extension 70 | public static class CifsOverrideInstanceConfigDefaultsDescriptor extends Descriptor { 71 | 72 | @Override 73 | public String getDisplayName() { 74 | return "CifsOverrideInstanceConfigDefaultsDescriptor - not visible ..."; 75 | } 76 | 77 | public jenkins.plugins.publish_over.view_defaults.BPInstanceConfig.Messages getCommonFieldNames() { 78 | return new jenkins.plugins.publish_over.view_defaults.BPInstanceConfig.Messages(); 79 | } 80 | 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /src/main/resources/jenkins/plugins/publish_over_cifs/CifsPublisherPlugin/help-paramPublish.jelly: -------------------------------------------------------------------------------- 1 | 2 | 3 | 26 | 27 | 28 |
29 |

Publish to shares by matching labels against a regular expression provided by a parameter or an environment variable.

30 |
31 |

For each share instance the label will be matched against the expression, and if matched, the publish will continue, otherwise that share will be skipped.
32 |
33 | If a label is not set for a share instance it will default to the empty string. Configured labels have whitespace removed from the start and end of them, which means that an all whitespace label will be evaluated as an empty string.
34 |
35 | The same label can be used multiple times, e.g. UAT for a database server and again for the web server.
36 |
37 | The regular expression syntax is the java syntax.
38 |
39 | The labels can use the standard Jenkins environment variables e.g. $NODE_NAME, or build variables such as a matrix axis. 40 |

41 |
42 |

43 | Some simple examples follow:
44 |
45 | [AC] will match A and C, but not B or D
46 | There appears to be an issue with strings which begin and end with brackets which will cause the string [AC] to turn into "[AC]"
47 | To counter this add an anchor to the start or end of the expression i.e. ^[AC] or [AC]$

48 |
49 | PERF|TEST will match PERF and TEST, but not LATEST, UAT or PROD
50 |
51 | .* will match all shares including those with no labels
52 |
53 | .+ will match any share that has a label - a share with no label configured will be tested with an empty (zero length) string
54 |
55 | An empty string will only match shares that do not have labels
56 |

57 |
58 |
59 | -------------------------------------------------------------------------------- /src/main/java/jenkins/plugins/publish_over_cifs/CifsHelper.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_cifs; 26 | 27 | import jcifs.smb.SmbException; 28 | import jcifs.smb.SmbFile; 29 | import jenkins.plugins.publish_over.BapPublisherException; 30 | 31 | public class CifsHelper { 32 | 33 | private static final long serialVersionUID = 1L; 34 | 35 | public SmbFile[] listFiles(final SmbFile file, final String url) { 36 | try { 37 | return file.listFiles(); 38 | } catch (final SmbException smbe) { 39 | throw new BapPublisherException(Messages.exception_jCifsException_listFiles( 40 | hideUserInfo(url), smbe.getLocalizedMessage()), smbe); 41 | } 42 | } 43 | 44 | public void delete(final SmbFile file) { 45 | try { 46 | file.delete(); 47 | } catch (final SmbException smbe) { 48 | throw new BapPublisherException(Messages.exception_jCifsException_delete( 49 | hideUserInfo(file.getCanonicalPath()), smbe.getLocalizedMessage()), smbe); 50 | } 51 | } 52 | 53 | public boolean exists(final SmbFile file, final String url) { 54 | try { 55 | return file.exists(); 56 | } catch (final SmbException smbe) { 57 | throw new BapPublisherException(Messages.exception_jCifsException_exists( 58 | hideUserInfo(url), smbe.getLocalizedMessage()), smbe); 59 | } 60 | } 61 | 62 | public boolean canRead(final SmbFile file, final String url) { 63 | try { 64 | return file.canRead(); 65 | } catch (final SmbException smbe) { 66 | throw new BapPublisherException(Messages.exception_jCifsException_canRead( 67 | hideUserInfo(url), smbe.getLocalizedMessage()), smbe); 68 | } 69 | } 70 | 71 | public void mkdirs(final SmbFile file, final String url) { 72 | try { 73 | file.mkdirs(); 74 | } catch (final SmbException smbe) { 75 | throw new BapPublisherException(Messages.exception_jCifsException_mkdirs( 76 | hideUserInfo(url), smbe.getLocalizedMessage()), smbe); 77 | } 78 | } 79 | 80 | public String hideUserInfo(final String url) { 81 | if (url.contains("@")) 82 | return CifsHostConfiguration.SMB_URL_PREFIX + "******" + url.substring(url.indexOf('@')); 83 | else 84 | return url; 85 | } 86 | 87 | } 88 | -------------------------------------------------------------------------------- /src/main/resources/jenkins/plugins/publish_over_cifs/CifsPublisherPlugin/global.groovy: -------------------------------------------------------------------------------- 1 | // Namespaces 2 | xml = namespace("http://www.w3.org/XML/1998/namespace") 3 | j = namespace("jelly:core") 4 | f = namespace("/lib/form") 5 | poc = namespace("/lib/publish_over_cifs") 6 | 7 | 8 | def m = descriptor.hostConfigurationFieldNames 9 | def helpUrl = "/plugin/publish-over-cifs/help/global/" 10 | def defaultPort = jenkins.plugins.publish_over_cifs.CifsHostConfiguration.getDefaultPort() 11 | def defaultTimeout = jenkins.plugins.publish_over_cifs.CifsHostConfiguration.getDefaultTimeout() 12 | def defaultBufferSize = jenkins.plugins.publish_over_cifs.CifsHostConfiguration.getDefaultBufferSize() 13 | 14 | f.section(description: _("hostconfig.section.description"), title: _("hostconfig.section.title")) { 15 | f.entry(title: _("hostconfig.entry")) { 16 | f.repeatable(var: "instance", header: _("hostconfig.dragAndDrop"), items: descriptor.hostConfigurations) { 17 | poc.blockWrapper { 18 | f.entry(help: "${helpUrl}name.html", title: m.name()) { 19 | f.textbox(name: "_.name", checkUrl: "${descriptor.getCheckUrl('name')}" checkDependsOn="", value: instance?.name) 20 | } 21 | f.entry(help: "${helpUrl}hostname.html", title: m.hostname()) { 22 | f.textbox(name: "_.hostname", checkUrl: "${descriptor.getCheckUrl('hostname')}" checkDependsOn="", value: instance?.hostname) 23 | } 24 | f.entry(help: "${helpUrl}username.html", title: m.username()) { 25 | f.textbox(name: "_.username", value: instance?.username) 26 | } 27 | f.entry(help: "${helpUrl}password.html", title: m.password()) { 28 | input(name: "_.password", type: "password", value: instance?.encryptedPassword, class: "setting-input") 29 | } 30 | f.entry(help: "${helpUrl}remoteRootDir.html", title: _("remotePath")) { 31 | f.textbox(name: "_.remoteRootDir", checkUrl: "${descriptor.getCheckUrl('remoteRootDir')}" checkDependsOn="", value: instance?.remoteRootDir) 32 | } 33 | f.advanced() { 34 | f.entry(help: "${helpUrl}port.html", title: m.port()) { 35 | f.textbox(default: defaultPort, name: "_.port", checkUrl: "${descriptor.getCheckUrl('port')}" checkDependsOn="", value: instance?.port) 36 | } 37 | f.entry(help: "${helpUrl}timeOut.html", title: m.timeout()) { 38 | f.textbox(default: defaultTimeout, name: "_.timeout", checkUrl: "${descriptor.getCheckUrl('timeout')}" checkDependsOn="", value: instance?.timeout) 39 | } 40 | f.entry(help: "${helpUrl}bufferSize.html", title: _("hostconfig.field.bufferSize")) { 41 | f.textbox(default: defaultBufferSize, name: "_.bufferSize", checkUrl: "${descriptor.getCheckUrl('bufferSize')}" checkDependsOn="", value: instance?.bufferSize) 42 | } 43 | f.entry(help: "${helpUrl}smbVersion.html", title: _("hostconfig.field.smbVersion")) { 44 | select(name: "_.smbVersion", class: "setting-input") { 45 | jenkins.plugins.publish_over_cifs.CifsHostConfiguration.SmbVersions.values().each { ver -> 46 | if(ver == instance?.smbVersion) { 47 | option(value: ver.name(), ver.description, selected: '') 48 | } else { 49 | option(value: ver.name(), ver.description) 50 | } 51 | } 52 | } 53 | } 54 | } 55 | f.validateButton(with: "name,hostname,username,password,remoteRootDir,port,timeout,bufferSize,poc-np.winsServer,smbVersion", method: "testConnection", progress: m.test_progress(), title: m.test_title()) 56 | f.entry(title: "") { 57 | div(align: "right") { 58 | f.repeatableDeleteButton() 59 | } 60 | } 61 | } 62 | } 63 | } 64 | 65 | if(descriptor.enableOverrideDefaults) { 66 | f.advanced() { 67 | f.entry() { 68 | f.dropdownDescriptorSelector(default: descriptor.pluginDefaultsDescriptor, field: "defaults", title: descriptor.commonManageMessages.defaults()) 69 | } 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/jenkins/plugins/publish_over_cifs/CifsPublisher.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_cifs; 26 | 27 | import jenkins.plugins.publish_over.BPBuildInfo; 28 | import jenkins.plugins.publish_over.BPHostConfiguration; 29 | import jenkins.plugins.publish_over.BapPublisher; 30 | import org.apache.commons.lang.builder.EqualsBuilder; 31 | import org.apache.commons.lang.builder.HashCodeBuilder; 32 | import org.apache.commons.lang.builder.ToStringBuilder; 33 | import org.apache.commons.lang.builder.ToStringStyle; 34 | import org.kohsuke.stapler.DataBoundConstructor; 35 | 36 | import java.util.ArrayList; 37 | 38 | @SuppressWarnings("PMD.LooseCoupling") // serializable 39 | public class CifsPublisher extends BapPublisher { 40 | 41 | private static final long serialVersionUID = 1L; 42 | public static final String CTX_KEY_NODE_PROPERTIES_DEFAULT = "cifs.np.default"; 43 | public static final String CTX_KEY_NODE_PROPERTIES_CURRENT = "cifs.np.current"; 44 | public static final String CTX_KEY_WINS_SERVER = "cifs.winsServer"; 45 | 46 | @DataBoundConstructor 47 | public CifsPublisher(final String configName, final boolean verbose, final ArrayList transfers, 48 | final boolean useWorkspaceInPromotion, final boolean usePromotionTimestamp, final CifsRetry retry, 49 | final CifsPublisherLabel label) { 50 | super(configName, verbose, transfers, useWorkspaceInPromotion, usePromotionTimestamp, retry, label, null); 51 | } 52 | 53 | @Override 54 | @SuppressWarnings("PMD.SignatureDeclareThrowsException") 55 | public void perform(final BPHostConfiguration hostConfig, final BPBuildInfo buildInfo) throws Exception { 56 | final CifsCleanNodeProperties defaults = (CifsCleanNodeProperties) buildInfo.get(CTX_KEY_NODE_PROPERTIES_DEFAULT); 57 | if (buildInfo.onMaster()) { 58 | storeWinsServer(buildInfo, defaults); 59 | } else { 60 | final CifsCleanNodeProperties current = (CifsCleanNodeProperties) buildInfo.get(CTX_KEY_NODE_PROPERTIES_CURRENT); 61 | if (!storeWinsServer(buildInfo, current)) storeWinsServer(buildInfo, defaults); 62 | } 63 | super.perform(hostConfig, buildInfo); 64 | } 65 | 66 | private boolean storeWinsServer(final BPBuildInfo buildInfo, final CifsCleanNodeProperties nodeProperties) { 67 | if (nodeProperties != null) { 68 | if (nodeProperties.getWinsServer() != null) 69 | buildInfo.put(CTX_KEY_WINS_SERVER, nodeProperties.getWinsServer()); 70 | return true; 71 | } 72 | return false; 73 | } 74 | 75 | public CifsRetry getRetry() { 76 | return (CifsRetry) super.getRetry(); 77 | } 78 | 79 | public boolean equals(final Object that) { 80 | if (this == that) return true; 81 | if (that == null || getClass() != that.getClass()) return false; 82 | 83 | return addToEquals(new EqualsBuilder(), (CifsPublisher) that).isEquals(); 84 | } 85 | 86 | public int hashCode() { 87 | return addToHashCode(new HashCodeBuilder()).toHashCode(); 88 | } 89 | 90 | public String toString() { 91 | return addToToString(new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)).toString(); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /src/main/java/jenkins/plugins/publish_over_cifs/options/CifsOverrideTransferDefaults.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_cifs.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.TransferOptions; 32 | import org.kohsuke.stapler.DataBoundConstructor; 33 | 34 | public class CifsOverrideTransferDefaults implements TransferOptions, Describable { 35 | 36 | private final String sourceFiles; 37 | private final String removePrefix; 38 | private final String remoteDirectory; 39 | private final String excludes; 40 | private final boolean remoteDirectorySDF; 41 | private final boolean flatten; 42 | private final boolean cleanRemote; 43 | private final boolean noDefaultExcludes; 44 | private final boolean makeEmptyDirs; 45 | private final String patternSeparator; 46 | 47 | @DataBoundConstructor 48 | public CifsOverrideTransferDefaults(final String sourceFiles, final String excludes, final String removePrefix, 49 | final String remoteDirectory, final boolean flatten, final boolean remoteDirectorySDF, 50 | final boolean cleanRemote, final boolean noDefaultExcludes, final boolean makeEmptyDirs, 51 | final String patternSeparator) { 52 | this.cleanRemote = cleanRemote; 53 | this.excludes = excludes; 54 | this.flatten = flatten; 55 | this.remoteDirectory = remoteDirectory; 56 | this.remoteDirectorySDF = remoteDirectorySDF; 57 | this.removePrefix = removePrefix; 58 | this.sourceFiles = sourceFiles; 59 | this.noDefaultExcludes = noDefaultExcludes; 60 | this.makeEmptyDirs = makeEmptyDirs; 61 | this.patternSeparator = patternSeparator; 62 | } 63 | 64 | public String getSourceFiles() { 65 | return sourceFiles; 66 | } 67 | 68 | public String getRemovePrefix() { 69 | return removePrefix; 70 | } 71 | 72 | public String getRemoteDirectory() { 73 | return remoteDirectory; 74 | } 75 | 76 | public String getExcludes() { 77 | return excludes; 78 | } 79 | 80 | public boolean isRemoteDirectorySDF() { 81 | return remoteDirectorySDF; 82 | } 83 | 84 | public boolean isFlatten() { 85 | return flatten; 86 | } 87 | 88 | public boolean isCleanRemote() { 89 | return cleanRemote; 90 | } 91 | 92 | public boolean isNoDefaultExcludes() { 93 | return noDefaultExcludes; 94 | } 95 | 96 | public boolean isMakeEmptyDirs() { 97 | return makeEmptyDirs; 98 | } 99 | 100 | public String getPatternSeparator() { 101 | return patternSeparator; 102 | } 103 | 104 | public CifsOverrideTransferDefaultsDescriptor getDescriptor() { 105 | return Jenkins.getInstance().getDescriptorByType(CifsOverrideTransferDefaultsDescriptor.class); 106 | } 107 | 108 | @Extension 109 | public static class CifsOverrideTransferDefaultsDescriptor extends Descriptor { 110 | 111 | @Override 112 | public String getDisplayName() { 113 | return "CifsOverrideTransferDefaultsDescriptor - not visible ..."; 114 | } 115 | 116 | public jenkins.plugins.publish_over.view_defaults.BPTransfer.Messages getCommonFieldNames() { 117 | return new jenkins.plugins.publish_over.view_defaults.BPTransfer.Messages(); 118 | } 119 | 120 | } 121 | 122 | } 123 | -------------------------------------------------------------------------------- /src/main/java/jenkins/plugins/publish_over_cifs/CifsBuilderPlugin.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_cifs; 26 | 27 | import hudson.Extension; 28 | import hudson.Launcher; 29 | import hudson.model.AbstractBuild; 30 | import hudson.model.AbstractProject; 31 | import hudson.model.BuildListener; 32 | import hudson.tasks.BuildStepDescriptor; 33 | import hudson.tasks.Builder; 34 | import jenkins.model.Jenkins; 35 | import jenkins.plugins.publish_over.BPInstanceConfig; 36 | import jenkins.plugins.publish_over.BPPlugin; 37 | import org.apache.commons.lang.builder.EqualsBuilder; 38 | import org.apache.commons.lang.builder.HashCodeBuilder; 39 | import org.apache.commons.lang.builder.ToStringBuilder; 40 | import org.apache.commons.lang.builder.ToStringStyle; 41 | import org.kohsuke.stapler.DataBoundConstructor; 42 | 43 | import java.io.IOException; 44 | import java.util.ArrayList; 45 | 46 | @SuppressWarnings("PMD.LooseCoupling") // serializable 47 | public class CifsBuilderPlugin extends Builder { 48 | 49 | private final CifsPublisherPlugin delegate; 50 | 51 | @DataBoundConstructor 52 | public CifsBuilderPlugin(final ArrayList publishers, final boolean continueOnError, final boolean failOnError, 53 | final boolean alwaysPublishFromMaster, final String masterNodeName, final CifsParamPublish paramPublish) { 54 | this.delegate = new CifsPublisherPlugin(publishers, continueOnError, failOnError, alwaysPublishFromMaster, masterNodeName, 55 | paramPublish); 56 | } 57 | 58 | @Override 59 | public boolean perform(final AbstractBuild build, final Launcher launcher, final BuildListener listener) 60 | throws InterruptedException, IOException { 61 | return delegate.perform(build, launcher, listener); 62 | } 63 | 64 | protected HashCodeBuilder addToHashCode(final HashCodeBuilder builder) { 65 | return builder.append(delegate); 66 | } 67 | 68 | protected EqualsBuilder addToEquals(final EqualsBuilder builder, final CifsBuilderPlugin that) { 69 | return builder.append(delegate, that.delegate); 70 | } 71 | 72 | protected ToStringBuilder addToToString(final ToStringBuilder builder) { 73 | return builder.append("delegate", delegate); 74 | } 75 | 76 | public boolean equals(final Object that) { 77 | if (this == that) return true; 78 | if (that == null || getClass() != that.getClass()) return false; 79 | 80 | return addToEquals(new EqualsBuilder(), (CifsBuilderPlugin) that).isEquals(); 81 | } 82 | 83 | public int hashCode() { 84 | return addToHashCode(new HashCodeBuilder()).toHashCode(); 85 | } 86 | 87 | public String toString() { 88 | return addToToString(new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)).toString(); 89 | } 90 | 91 | public BPInstanceConfig getInstanceConfig() { 92 | return delegate.getInstanceConfig(); 93 | } 94 | 95 | @Extension 96 | public static class Descriptor extends BuildStepDescriptor { 97 | public boolean isApplicable(final Class aClass) { 98 | return !BPPlugin.PROMOTION_JOB_TYPE.equals(aClass.getCanonicalName()); 99 | } 100 | public String getDisplayName() { 101 | return Messages.builder_descriptor_displayName(); 102 | } 103 | public String getConfigPage() { 104 | return getViewPage(CifsPublisherPlugin.class, "config.jelly"); 105 | } 106 | public CifsPublisherPlugin.Descriptor getPublisherDescriptor() { 107 | return Jenkins.getInstance().getDescriptorByType(CifsPublisherPlugin.Descriptor.class); 108 | } 109 | } 110 | 111 | } 112 | -------------------------------------------------------------------------------- /src/test/java/jenkins/plugins/publish_over_cifs/CifsPublisherTest.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_cifs; 26 | 27 | import jenkins.plugins.publish_over.BPBuildInfo; 28 | import org.easymock.classextension.EasyMock; 29 | import org.easymock.classextension.IMocksControl; 30 | import org.junit.Before; 31 | import org.junit.Test; 32 | 33 | import java.util.ArrayList; 34 | 35 | import static jenkins.plugins.publish_over_cifs.CifsPublisher.CTX_KEY_NODE_PROPERTIES_CURRENT; 36 | import static jenkins.plugins.publish_over_cifs.CifsPublisher.CTX_KEY_NODE_PROPERTIES_DEFAULT; 37 | import static jenkins.plugins.publish_over_cifs.CifsPublisher.CTX_KEY_WINS_SERVER; 38 | import static org.easymock.EasyMock.expect; 39 | import static org.junit.Assert.assertEquals; 40 | import static org.junit.Assert.assertNull; 41 | 42 | @SuppressWarnings({ "PMD.SignatureDeclareThrowsException", "PMD.AvoidUsingHardCodedIP" }) 43 | public class CifsPublisherTest { 44 | 45 | private final BPBuildInfo buildInfo = CifsTestHelper.createEmpty(); 46 | private final IMocksControl mockControl = EasyMock.createNiceControl(); 47 | private final CifsClient mockClient = mockControl.createMock(CifsClient.class); 48 | private final CifsHostConfiguration mockConfig = mockControl.createMock(CifsHostConfiguration.class); 49 | 50 | @Before public void setUp() { 51 | expect(mockConfig.createClient(buildInfo)).andReturn(mockClient); 52 | } 53 | 54 | @Test public void noWinsServerIfNoDefaultsAndNoneForNode() throws Exception { 55 | CifsTestHelper.setOnMaster(buildInfo); 56 | mockControl.replay(); 57 | createPublisher().perform(mockConfig, buildInfo); 58 | assertNull(buildInfo.get(CifsPublisher.CTX_KEY_WINS_SERVER)); 59 | } 60 | 61 | @Test public void noWinsServerIfNoDefaultsAndOnMaster() throws Exception { 62 | mockControl.replay(); 63 | createPublisher().perform(mockConfig, buildInfo); 64 | assertNull(buildInfo.get(CifsPublisher.CTX_KEY_WINS_SERVER)); 65 | } 66 | 67 | @Test public void winsServerFromCurrent() throws Exception { 68 | final String winsServer = "1.2.3.4"; 69 | final CifsCleanNodeProperties current = new CifsCleanNodeProperties(winsServer); 70 | buildInfo.put(CTX_KEY_NODE_PROPERTIES_CURRENT, current); 71 | mockControl.replay(); 72 | createPublisher().perform(mockConfig, buildInfo); 73 | assertEquals(winsServer, buildInfo.get(CTX_KEY_WINS_SERVER)); 74 | } 75 | 76 | @Test public void winsServerDefaultIfOnMaster() throws Exception { 77 | final String defaultServer = "1.2.3.4"; 78 | final String currentServer = "5.6.7.8"; 79 | final CifsCleanNodeProperties current = new CifsCleanNodeProperties(currentServer); 80 | final CifsCleanNodeProperties defaults = new CifsCleanNodeProperties(defaultServer); 81 | buildInfo.put(CTX_KEY_NODE_PROPERTIES_CURRENT, current); 82 | buildInfo.put(CTX_KEY_NODE_PROPERTIES_DEFAULT, defaults); 83 | CifsTestHelper.setOnMaster(buildInfo); 84 | mockControl.replay(); 85 | createPublisher().perform(mockConfig, buildInfo); 86 | assertEquals(defaultServer, buildInfo.get(CTX_KEY_WINS_SERVER)); 87 | } 88 | 89 | @Test public void noWinsServerIfWinsServerEmptyInCurrent() throws Exception { 90 | final String defaultServer = "1.2.3.4"; 91 | final CifsCleanNodeProperties current = new CifsCleanNodeProperties(null); 92 | final CifsCleanNodeProperties defaults = new CifsCleanNodeProperties(defaultServer); 93 | buildInfo.put(CTX_KEY_NODE_PROPERTIES_CURRENT, current); 94 | buildInfo.put(CTX_KEY_NODE_PROPERTIES_DEFAULT, defaults); 95 | mockControl.replay(); 96 | createPublisher().perform(mockConfig, buildInfo); 97 | assertNull(buildInfo.get(CTX_KEY_WINS_SERVER)); 98 | } 99 | 100 | private CifsPublisher createPublisher() { 101 | return new CifsPublisher("abc", false, new ArrayList(0), false, false, null, null); 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /src/main/java/jenkins/plugins/publish_over_cifs/options/CifsOverrideDefaults.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_cifs.options; 26 | 27 | import hudson.Extension; 28 | import jenkins.plugins.publish_over.options.InstanceConfigOptions; 29 | import jenkins.plugins.publish_over.options.ParamPublishOptions; 30 | import jenkins.plugins.publish_over.options.PublisherLabelOptions; 31 | import jenkins.plugins.publish_over.options.PublisherOptions; 32 | import jenkins.plugins.publish_over.options.RetryOptions; 33 | import jenkins.plugins.publish_over.options.TransferOptions; 34 | import jenkins.plugins.publish_over.view_defaults.manage_jenkins.Messages; 35 | import org.kohsuke.stapler.DataBoundConstructor; 36 | 37 | public class CifsOverrideDefaults extends CifsDefaults { 38 | 39 | private final CifsOverrideInstanceConfigDefaults overrideInstanceConfig; 40 | private final CifsOverrideParamPublishDefaults overrideParamPublish; 41 | private final CifsOverridePublisherDefaults overridePublisher; 42 | private final CifsOverridePublisherLabelDefaults overridePublisherLabel; 43 | private final CifsOverrideRetryDefaults overrideRetry; 44 | private final CifsOverrideTransferDefaults overrideTransfer; 45 | 46 | @DataBoundConstructor 47 | public CifsOverrideDefaults(final CifsOverrideInstanceConfigDefaults overrideInstanceConfig, 48 | final CifsOverrideParamPublishDefaults overrideParamPublish, 49 | final CifsOverridePublisherDefaults overridePublisher, 50 | final CifsOverridePublisherLabelDefaults overridePublisherLabel, 51 | final CifsOverrideRetryDefaults overrideRetry, 52 | final CifsOverrideTransferDefaults overrideTransfer) { 53 | this.overrideInstanceConfig = overrideInstanceConfig; 54 | this.overrideParamPublish = overrideParamPublish; 55 | this.overridePublisher = overridePublisher; 56 | this.overridePublisherLabel = overridePublisherLabel; 57 | this.overrideRetry = overrideRetry; 58 | this.overrideTransfer = overrideTransfer; 59 | } 60 | 61 | // prevent the property type being clobbered in the descriptor map by using different names from the IF 62 | public CifsOverrideInstanceConfigDefaults getOverrideInstanceConfig() { 63 | return overrideInstanceConfig; 64 | } 65 | 66 | public CifsOverrideParamPublishDefaults getOverrideParamPublish() { 67 | return overrideParamPublish; 68 | } 69 | 70 | public CifsOverridePublisherDefaults getOverridePublisher() { 71 | return overridePublisher; 72 | } 73 | 74 | public CifsOverridePublisherLabelDefaults getOverridePublisherLabel() { 75 | return overridePublisherLabel; 76 | } 77 | 78 | public CifsOverrideRetryDefaults getOverrideRetry() { 79 | return overrideRetry; 80 | } 81 | 82 | public CifsOverrideTransferDefaults getOverrideTransfer() { 83 | return overrideTransfer; 84 | } 85 | 86 | public InstanceConfigOptions getInstanceConfig() { 87 | return overrideInstanceConfig; 88 | } 89 | 90 | public ParamPublishOptions getParamPublish() { 91 | return overrideParamPublish; 92 | } 93 | 94 | public PublisherOptions getPublisher() { 95 | return overridePublisher; 96 | } 97 | 98 | public PublisherLabelOptions getPublisherLabel() { 99 | return overridePublisherLabel; 100 | } 101 | 102 | public RetryOptions getRetry() { 103 | return overrideRetry; 104 | } 105 | 106 | public TransferOptions getTransfer() { 107 | return overrideTransfer; 108 | } 109 | 110 | @Extension 111 | public static class CifsOverrideDefaultsDescriptor extends CifsDefaultsDescriptor { 112 | 113 | private static final CifsPluginDefaults PLUGIN_DEFAULTS = new CifsPluginDefaults(); 114 | 115 | @Override 116 | public String getDisplayName() { 117 | return Messages.defaults_overrideDefaults(); 118 | } 119 | 120 | public CifsPluginDefaults getPluginDefaults() { 121 | return PLUGIN_DEFAULTS; 122 | } 123 | 124 | } 125 | 126 | } 127 | -------------------------------------------------------------------------------- /src/main/java/jenkins/plugins/publish_over_cifs/CifsPromotionPublisherPlugin.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_cifs; 26 | 27 | import hudson.Extension; 28 | import hudson.FilePath; 29 | import hudson.Launcher; 30 | import hudson.model.AbstractProject; 31 | import hudson.model.Run; 32 | import hudson.model.TaskListener; 33 | import hudson.tasks.BuildStepDescriptor; 34 | import hudson.tasks.BuildStepMonitor; 35 | import hudson.tasks.Notifier; 36 | import hudson.tasks.Publisher; 37 | import jenkins.model.Jenkins; 38 | import jenkins.plugins.publish_over.BPInstanceConfig; 39 | import jenkins.plugins.publish_over.BPPlugin; 40 | import jenkins.plugins.publish_over_cifs.descriptor.CifsPublisherPluginDescriptor; 41 | import jenkins.tasks.SimpleBuildStep; 42 | import org.apache.commons.lang.builder.EqualsBuilder; 43 | import org.apache.commons.lang.builder.HashCodeBuilder; 44 | import org.apache.commons.lang.builder.ToStringBuilder; 45 | import org.apache.commons.lang.builder.ToStringStyle; 46 | import org.kohsuke.stapler.DataBoundConstructor; 47 | 48 | import edu.umd.cs.findbugs.annotations.NonNull; 49 | import java.io.IOException; 50 | import java.util.ArrayList; 51 | 52 | @SuppressWarnings("PMD.LooseCoupling") // serializable 53 | public class CifsPromotionPublisherPlugin extends Notifier implements SimpleBuildStep { 54 | 55 | private final CifsPublisherPlugin delegate; 56 | 57 | @DataBoundConstructor 58 | public CifsPromotionPublisherPlugin(final ArrayList publishers, final boolean continueOnError, 59 | final boolean failOnError, final boolean alwaysPublishFromMaster, final String masterNodeName, 60 | final CifsParamPublish paramPublish) { 61 | this.delegate = new CifsPublisherPlugin(publishers, continueOnError, failOnError, alwaysPublishFromMaster, masterNodeName, 62 | paramPublish); 63 | } 64 | 65 | public BPInstanceConfig getInstanceConfig() { 66 | return delegate.getInstanceConfig(); 67 | } 68 | 69 | @Override 70 | public void perform(@NonNull Run run, @NonNull FilePath workspace, @NonNull Launcher launcher, @NonNull TaskListener listener) throws InterruptedException, IOException { 71 | delegate.perform(run, workspace, launcher, listener); 72 | } 73 | 74 | public BuildStepMonitor getRequiredMonitorService() { 75 | return delegate.getRequiredMonitorService(); 76 | } 77 | 78 | protected HashCodeBuilder createHashCodeBuilder() { 79 | return addToHashCode(new HashCodeBuilder()); 80 | } 81 | 82 | protected HashCodeBuilder addToHashCode(final HashCodeBuilder builder) { 83 | return builder.append(delegate); 84 | } 85 | 86 | protected EqualsBuilder createEqualsBuilder(final CifsPromotionPublisherPlugin that) { 87 | return addToEquals(new EqualsBuilder(), that); 88 | } 89 | 90 | protected EqualsBuilder addToEquals(final EqualsBuilder builder, final CifsPromotionPublisherPlugin that) { 91 | return builder.append(delegate, that.delegate); 92 | } 93 | 94 | protected ToStringBuilder addToToString(final ToStringBuilder builder) { 95 | return builder.append("delegate", delegate); 96 | } 97 | 98 | public boolean equals(final Object that) { 99 | if (this == that) return true; 100 | if (that == null || getClass() != that.getClass()) return false; 101 | 102 | return createEqualsBuilder((CifsPromotionPublisherPlugin) that).isEquals(); 103 | } 104 | 105 | public int hashCode() { 106 | return createHashCodeBuilder().toHashCode(); 107 | } 108 | 109 | public String toString() { 110 | return addToToString(new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)).toString(); 111 | } 112 | 113 | @Extension 114 | public static class Descriptor extends BuildStepDescriptor { 115 | public boolean isApplicable(final Class aClass) { 116 | return BPPlugin.PROMOTION_JOB_TYPE.equals(aClass.getCanonicalName()); 117 | } 118 | public String getDisplayName() { 119 | return Messages.promotion_descriptor_displayName(); 120 | } 121 | public String getConfigPage() { 122 | return getViewPage(CifsPublisherPlugin.class, "config.jelly"); 123 | } 124 | 125 | public CifsPublisherPlugin.Descriptor getPublisherDescriptor() { 126 | return Jenkins.getInstance().getDescriptorByType(CifsPublisherPlugin.Descriptor.class); 127 | } 128 | } 129 | 130 | } 131 | -------------------------------------------------------------------------------- /src/main/java/jenkins/plugins/publish_over_cifs/CifsClient.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_cifs; 26 | 27 | import hudson.FilePath; 28 | import jcifs.CIFSContext; 29 | import jcifs.smb.SmbFile; 30 | import jenkins.plugins.publish_over.BPBuildInfo; 31 | import jenkins.plugins.publish_over.BPDefaultClient; 32 | import jenkins.plugins.publish_over.BapPublisherException; 33 | import org.apache.commons.io.IOUtils; 34 | 35 | import java.io.IOException; 36 | import java.io.InputStream; 37 | import java.io.OutputStream; 38 | import java.net.MalformedURLException; 39 | 40 | public class CifsClient extends BPDefaultClient { 41 | 42 | private final CifsHelper helper = new CifsHelper(); 43 | private final BPBuildInfo buildInfo; 44 | private final String baseUrl; 45 | private String context; 46 | private int bufferSize; 47 | final private CIFSContext cifsContext; 48 | 49 | public CifsClient(final CIFSContext cifsContext, final BPBuildInfo buildInfo, final String baseUrl, final int bufferSize) { 50 | this.buildInfo = buildInfo; 51 | this.baseUrl = baseUrl; 52 | this.bufferSize = bufferSize; 53 | context = baseUrl; 54 | this.cifsContext = cifsContext; 55 | } 56 | 57 | protected String getContext() { return context; } 58 | 59 | CIFSContext getCifsContext() { return cifsContext; } 60 | 61 | @Override 62 | public boolean changeToInitialDirectory() { 63 | context = baseUrl; 64 | return true; 65 | } 66 | 67 | public boolean changeDirectory(final String directory) { 68 | final String newLocation = createUrlForSubDir(directory); 69 | final SmbFile dir = createFile(newLocation); 70 | if (helper.exists(dir, newLocation) && helper.canRead(dir, newLocation)) { 71 | context = newLocation; 72 | return true; 73 | } else { 74 | return false; 75 | } 76 | } 77 | 78 | private String createUrlForSubDir(final String directory) { 79 | return directory.endsWith("/") ? context + directory : context + directory + '/'; 80 | } 81 | 82 | public boolean makeDirectory(final String directory) { 83 | final String newDirectoryUrl = createUrlForSubDir(directory); 84 | final SmbFile dir = createFile(newDirectoryUrl); 85 | if (helper.exists(dir, newDirectoryUrl)) throw new BapPublisherException( 86 | Messages.exception_mkdir_directoryExists(helper.hideUserInfo(newDirectoryUrl))); 87 | if (buildInfo.isVerbose()) buildInfo.println(Messages.console_mkdir(helper.hideUserInfo(newDirectoryUrl))); 88 | helper.mkdirs(dir, newDirectoryUrl); 89 | return true; 90 | } 91 | 92 | public void deleteTree() throws IOException { 93 | if (buildInfo.isVerbose()) buildInfo.println(Messages.console_clean(helper.hideUserInfo(context))); 94 | final SmbFile[] files = helper.listFiles(createFile(context), context); 95 | if (files == null) throw new BapPublisherException(Messages.exception_listFilesReturnedNull(helper.hideUserInfo(context))); 96 | for (final SmbFile file : files) { 97 | if (buildInfo.isVerbose()) buildInfo.println(Messages.console_delete(helper.hideUserInfo(file.getCanonicalPath()))); 98 | helper.delete(file); 99 | } 100 | } 101 | 102 | public void beginTransfers(final CifsTransfer transfer) { 103 | if (!transfer.hasConfiguredSourceFiles()) 104 | throw new BapPublisherException(Messages.exception_noSourceFiles()); 105 | } 106 | 107 | public void transferFile(final CifsTransfer transfer, final FilePath filePath, final InputStream content) throws IOException { 108 | final String newFileUrl = context + filePath.getName(); 109 | if (buildInfo.isVerbose()) buildInfo.println(Messages.console_copy(helper.hideUserInfo(newFileUrl))); 110 | final OutputStream out = createFile(newFileUrl).getOutputStream(); 111 | 112 | try { 113 | IOUtils.copy(content, out, bufferSize); 114 | } finally { 115 | out.close(); 116 | } 117 | } 118 | 119 | public void disconnect() { 120 | } 121 | 122 | public void disconnectQuietly() { 123 | } 124 | 125 | @SuppressWarnings("PMD.PreserveStackTrace") // security 126 | private SmbFile createFile(final String url) { 127 | try { 128 | return createSmbFile(url); 129 | } catch (MalformedURLException mue) { 130 | throw new BapPublisherException(Messages.exception_malformedUrlException(helper.hideUserInfo(url))); 131 | } 132 | } 133 | 134 | protected SmbFile createSmbFile(final String url) throws MalformedURLException { 135 | return new SmbFile(url, cifsContext); 136 | } 137 | 138 | } 139 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 25 | 26 | 27 | 4.0.0 28 | 29 | 30 | org.jenkins-ci.plugins 31 | plugin 32 | 4.50 33 | 34 | 35 | 36 | publish-over-cifs 37 | hpi 38 | Publish Over CIFS 39 | 0.17 40 | Send build artifacts to a windows share (CIFS/SMB/samba) 41 | https://github.com/jenkinsci/${project.artifactId}-plugin 42 | 43 | 44 | 0.17 45 | -SNAPSHOT 46 | jenkinsci/${project.artifactId}-plugin 47 | 48 | 2.289 49 | ${jenkins.baseline}.3 50 | 8 51 | 52 | 53 | 54 | 55 | The MIT license 56 | https://opensource.org/license/mit/ 57 | All source code is under the MIT license. 58 | 59 | 60 | 61 | 62 | 63 | slide_o_mix 64 | slide 65 | -7 66 | slide.o.mix@gmail.com 67 | 68 | 69 | bap 70 | Bap 71 | bap-jenkins@BapIT.co.uk 72 | 73 | 74 | 75 | 76 | 77 | commons-io 78 | commons-io 79 | 2.18.0 80 | 81 | provided 82 | 83 | 84 | org.jenkins-ci.plugins 85 | publish-over 86 | 0.22 87 | 88 | 89 | org.jenkins-ci.plugins 90 | structs 91 | 92 | 93 | eu.agno3.jcifs 94 | jcifs-ng 95 | 2.1.10 96 | 97 | 98 | org.slf4j 99 | slf4j-api 100 | 101 | 102 | 103 | 104 | org.easymock 105 | easymock 106 | 3.2 107 | test 108 | 109 | 110 | org.easymock 111 | easymockclassextension 112 | 3.2 113 | test 114 | 115 | 116 | 117 | 118 | 119 | 120 | io.jenkins.tools.bom 121 | bom-${jenkins.baseline}.x 122 | 1500.ve4d05cd32975 123 | import 124 | pom 125 | 126 | 127 | 128 | 129 | 130 | https://github.com/${gitHubRepo} 131 | scm:git:https://github.com/${gitHubRepo}.git 132 | scm:git:git@github.com:${gitHubRepo}.git 133 | ${scmTag} 134 | 135 | 136 | 137 | Github 138 | https://github.com/jenkinsci/publish-over-cifs-plugin/issues 139 | 140 | 141 | 142 | 143 | repo.jenkins-ci.org 144 | https://repo.jenkins-ci.org/public/ 145 | 146 | 147 | 148 | 149 | 150 | repo.jenkins-ci.org 151 | https://repo.jenkins-ci.org/public/ 152 | 153 | 154 | 155 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Send build artifacts to a windows share (CIFS/SMB/samba) 2 | 3 | # Publish Over ... 4 | 5 | Please read [Publish Over](https://plugins.jenkins.io/publish-over/) first. 6 | Common configuration options that are documented in the [Publish Over ... page](https://plugins.jenkins.io/publish-over/) will not be repeated here. 7 | 8 | [Features](https://plugins.jenkins.io/publish-over/#overview) 9 | 10 | [Configure](https://plugins.jenkins.io/publish-over/#configuration) 11 | 12 | # Features 13 | 14 | - Send files to windows shares 15 | - The plugin is "promotion aware" see 16 | [Promotions](https://plugins.jenkins.io/publish-over/#promotions) 17 | - Publish to multiple shares in the "Post-build Actions" 18 | - Passwords are encrypted in the configuration files and in the UI 19 | - Copy files to a windows share during a build 20 | 21 | # Configure 22 | 23 | ## Configure a WINS server 24 | 25 | From the Jenkins home page, click "Manage Jenkins" and then click on "Configure System" 26 | 27 | In the main Jenkins configuration page, there will be a "Publish Over CIFS" checkbox in the "Global properties" section. 28 | 29 | ![cifs_node_props_global](docs/images/cifs_node_props_global.png) 30 | 31 | ## WINS server 32 | 33 | Set this option to the IP address of a WINS server that will be used by the Jenkins controller, and will be the default for all other agents. 34 | 35 | The WINS server can be set or overridden for individual agents 36 | 37 | A "Publish Over CIFS" checkbox will appear under "Node Properties" in the configuration for a node. 38 | Set the WINS server to an IP address that this node will use for name 39 | resolution. 40 | 41 | If a default WINS server has been specified in the "Global properties", a node can be configured to not use WINS by checking the "Publish Over CIFS" property and leaving the WINS server empty. 42 | 43 | ## Create host configurations in the main Jenkins configuration 44 | 45 | From the Jenkins home page, click "Manage Jenkins" and the click on "Configure System" 46 | 47 | Find the CIFS section (as below) and click on the "Add" button next to "CIFS Servers" 48 | 49 | ![cifs_global_unconfigured](docs/images/cifs_global_unconfigured.png) 50 | 51 | You should now have the configuration options as below 52 | 53 | ![cifs_global_configured](docs/images/cifs_global_configured.png) 54 | 55 | Fill in Name, Hostname, Username, Password and Share. see Publish Over ... for [common options for Host 56 | Configurations](https://plugins.jenkins.io/publish-over/#host) 57 | 58 | ### Hostname 59 | 60 | Hostname is the hostname, IP address or windows servername of the host that contains the share 61 | 62 | ### Username 63 | 64 | To specify a user in a specific windows domain, use a back slash to separate eg `MYDOMAIN\myuser` 65 | 66 | ### Share 67 | 68 | The share is equivalent to the standard Remote directory option, except that the Share is required and there is no concept of the directories being relative. 69 | 70 | The share must be, or begin with, a windows share name on the server named in Hostname. 71 | 72 | ### Advanced 73 | 74 | If you click the "Advanced..." button for a configuration, then you will make more configuration options available (see below) 75 | 76 | ![cifs_global_advanced](docs/images/cifs_global_advanced.png) 77 | 78 | see Publish Over ... for [common options for Host Configurations](https://plugins.jenkins.io/publish-over/#host) 79 | 80 | ## Click "Test Configuration". 81 | 82 | ## Add more server configurations (if required) 83 | 84 | # Save 85 | 86 | ## Send files to a windows share during a build 87 | 88 | This plugin adds a build step to enable you to send files to a windows share during a build. 89 | 90 | Select "Send files to a windows share" from the "Add build step" drop down (pic below) and then configure just like [Configure a job to send files to a windows share](#configure-a-job-to-send-files-to-a-windows-share) 91 | 92 | ![] 93 | below 94 | 95 | ![cifs_builder](docs/images/cifs_builder.png) 96 | 97 | # Configure a job to send files to a windows share 98 | 99 | Open a jobs main page and then click "Configure" from the left hand menu. 100 | 101 | Find the "Send build artifacts to a windows share" checkbox in the "Post-build Actions" section and click in the box. 102 | 103 | ![cifs_unconfigured](docs/images/cifs_unconfigured.png) 104 | 105 | You should now have the configuration options as below 106 | 107 | ![cifs_configured](docs/images/cifs_configured.png) 108 | 109 | see Publish Over ... for [common options for Server](https://plugins.jenkins.io/publish-over/#server) 110 | 111 | [see Publish Over ... for common options for Transfer Sets](https://plugins.jenkins.io/publish-over/#transfer-set) 112 | 113 | Source files 114 | 115 | The build will fail if you do not select any Source files to transfer 116 | 117 | ## Advanced (Transfer Sets) 118 | 119 | If you click the "Advanced..." button for a Transfer Set, then you will make more configuration options available (see below) 120 | ![cifs_advanced](docs/images/cifs_advanced.png) 121 | 122 | [see Publish Over ... for common options for Transfer 123 | Sets](https://plugins.jenkins.io/publish-over/#transfer-set) 124 | 125 | ## Clean remote 126 | 127 | Delete all files and directories from the remote directory before uploading the new files. 128 | 129 | ## Advanced (Publisher) 130 | 131 | If you click the "Advanced..." button that is immediately below the "Add Server" button, then you will make more configuration options available (see below) 132 | 133 | ![cifs_publisher_advanced](docs/images/cifs_publisher_advanced.png) 134 | 135 | [see Publish Over ... for common options for 136 | Publisher](https://plugins.jenkins.io/publish-over/#publisher) 137 | 138 | # Options to override the default Promotion behaviour 139 | 140 | If you are configuring an action in a promotion, new options will become available. 141 | ![cifs_promotions](docs/images/cifs_promotions.png) 142 | 143 | [see Publish Over ... for common options for Promotions](https://plugins.jenkins.io/publish-over/#promotions) 144 | 145 | # Change log 146 | 147 | #### 0.11 (2018-07-30) 148 | 149 | - [Fix security 150 | issue](https://jenkins.io/security/advisory/2018-07-30/#SECURITY-975) 151 | 152 | #### 0.9 153 | 154 | - Fixed issue with parameter verification using incorrect check urls 155 | - Fixed issue with bufferSize not being set correctly on ugprade 156 | ([issue 157 | 49010](https://issues.jenkins.io/browse/JENKINS-49010)) 158 | 159 | 160 | # Questions, Comments, Bugs and Feature Requests 161 | 162 | Please post questions or comments about this plugin to the [Jenkins User mailing list](http://www.jenkins.io/content/mailing-lists). 163 | 164 | To report a bug or request an enhancement to this plugin please [create a ticket in JIRA](https://www.jenkins.io/participate/report-issue/redirect/#15850). -------------------------------------------------------------------------------- /src/main/java/jenkins/plugins/publish_over_cifs/CifsPublisherPlugin.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_cifs; 26 | 27 | import hudson.Extension; 28 | import hudson.Util; 29 | import hudson.model.Node; 30 | import hudson.model.Run; 31 | import java.io.PrintStream; 32 | import jenkins.model.Jenkins; 33 | import jenkins.plugins.publish_over.BPBuildInfo; 34 | import jenkins.plugins.publish_over.BPPlugin; 35 | import jenkins.plugins.publish_over.BPPluginDescriptor; 36 | import jenkins.plugins.publish_over.ParamPublish; 37 | import jenkins.plugins.publish_over_cifs.descriptor.CifsPublisherPluginDescriptor; 38 | import org.apache.commons.lang.builder.EqualsBuilder; 39 | import org.apache.commons.lang.builder.HashCodeBuilder; 40 | import org.apache.commons.lang.builder.ToStringBuilder; 41 | import org.apache.commons.lang.builder.ToStringStyle; 42 | import org.jenkinsci.Symbol; 43 | import org.kohsuke.stapler.DataBoundConstructor; 44 | import org.kohsuke.stapler.DataBoundSetter; 45 | 46 | import java.util.ArrayList; 47 | import java.util.List; 48 | 49 | @SuppressWarnings("PMD.LooseCoupling") // serializable 50 | public class CifsPublisherPlugin extends BPPlugin { 51 | 52 | private static final long serialVersionUID = 1L; 53 | private boolean publishWhenFailed = false; 54 | 55 | public CifsPublisherPlugin(final ArrayList publishers, final boolean continueOnError, final boolean failOnError, 56 | final boolean alwaysPublishFromMaster, final String masterNodeName, final CifsParamPublish paramPublish) { 57 | super(Messages.console_message_prefix(), publishers, continueOnError, failOnError, alwaysPublishFromMaster, masterNodeName, 58 | paramPublish); 59 | } 60 | 61 | @DataBoundConstructor 62 | public CifsPublisherPlugin() { 63 | super(Messages.console_message_prefix()); 64 | } 65 | 66 | @DataBoundSetter 67 | public void setPublishWhenFailed(final boolean publishWhenFailed) { 68 | this.publishWhenFailed = publishWhenFailed; 69 | } 70 | public boolean getPublishWhenFailed() { return this.publishWhenFailed; } 71 | 72 | public List getPublishers() { 73 | return this.getDelegate().getPublishers(); 74 | } 75 | 76 | @DataBoundSetter 77 | public void setPublishers(final ArrayList publishers) { 78 | this.getDelegate().setPublishers(publishers); 79 | } 80 | 81 | public boolean isContinueOnError() { 82 | return this.getDelegate().isContinueOnError(); 83 | } 84 | 85 | @DataBoundSetter 86 | public void setContinueOnError(final boolean continueOnError) { 87 | this.getDelegate().setContinueOnError(continueOnError); 88 | } 89 | 90 | public boolean isFailOnError() { 91 | return this.getDelegate().isFailOnError(); 92 | } 93 | 94 | @DataBoundSetter 95 | public void setFailOnError(final boolean failOnError) { 96 | this.getDelegate().setFailOnError(failOnError); 97 | } 98 | 99 | public boolean isAlwaysPublishFromMaster() { 100 | return this.getDelegate().isAlwaysPublishFromMaster(); 101 | } 102 | 103 | @DataBoundSetter 104 | public void setAlwaysPublishFromMaster(final boolean alwaysPublishFromMaster) { 105 | this.getDelegate().setAlwaysPublishFromMaster(alwaysPublishFromMaster); 106 | } 107 | 108 | public String getMasterNodeName() { 109 | return this.getDelegate().getMasterNodeName(); 110 | } 111 | 112 | @DataBoundSetter 113 | public void setMasterNodeName(final String masterNodeName) { 114 | this.getDelegate().setMasterNodeName(masterNodeName); 115 | } 116 | 117 | public CifsParamPublish getParamPublish() { 118 | return (CifsParamPublish) this.getDelegate().getParamPublish(); 119 | } 120 | 121 | @DataBoundSetter 122 | public void setParamPublish(final ParamPublish paramPublish) { 123 | this.getDelegate().setParamPublish(paramPublish); 124 | } 125 | 126 | @Override 127 | protected void fixup(final Run build, final BPBuildInfo buildInfo) { 128 | final Jenkins jenkins = Jenkins.getInstance(); 129 | if (jenkins != null) { 130 | final CifsNodeProperties defaults = jenkins.getGlobalNodeProperties().get(CifsNodeProperties.class); 131 | if (defaults != null) buildInfo.put(CifsPublisher.CTX_KEY_NODE_PROPERTIES_DEFAULT, map(defaults)); 132 | final String currNodeName = buildInfo.getCurrentBuildEnv().getEnvVars().get(BPBuildInfo.ENV_NODE_NAME); 133 | storeProperties(buildInfo, jenkins, currNodeName, CifsPublisher.CTX_KEY_NODE_PROPERTIES_CURRENT); 134 | } 135 | } 136 | 137 | private void storeProperties(final BPBuildInfo buildInfo, final Jenkins jenkins, final String nodeName, final String contextKey) { 138 | if (Util.fixEmptyAndTrim(nodeName) == null) return; 139 | final Node node = jenkins.getNode(nodeName); 140 | if (node == null) return; 141 | final CifsNodeProperties currNodeProps = node.getNodeProperties().get(CifsNodeProperties.class); 142 | if (currNodeProps != null) buildInfo.put(contextKey, map(currNodeProps)); 143 | } 144 | 145 | private CifsCleanNodeProperties map(final CifsNodeProperties nodeProperties) { 146 | if (nodeProperties == null) return null; 147 | return new CifsCleanNodeProperties(Util.fixEmptyAndTrim(nodeProperties.getWinsServer())); 148 | } 149 | 150 | public boolean equals(final Object that) { 151 | if (this == that) return true; 152 | if (that == null || getClass() != that.getClass()) return false; 153 | 154 | return addToEquals(new EqualsBuilder(), (CifsPublisherPlugin) that).isEquals(); 155 | } 156 | 157 | public int hashCode() { 158 | return addToHashCode(new HashCodeBuilder()).toHashCode(); 159 | } 160 | 161 | public String toString() { 162 | return addToToString(new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)).toString(); 163 | } 164 | 165 | public Descriptor getDescriptor() { 166 | return Jenkins.getInstance().getDescriptorByType(Descriptor.class); 167 | } 168 | 169 | public CifsHostConfiguration getConfiguration(final String name) { 170 | return getDescriptor().getConfiguration(name); 171 | } 172 | 173 | @Extension 174 | @Symbol("cifsPublisher") 175 | public static class Descriptor extends CifsPublisherPluginDescriptor { 176 | 177 | // While this looks redundant, it resolves some issues with XStream Reflection causing it 178 | // not to persist settings after a reboot 179 | @Override 180 | public Object readResolve() { 181 | return super.readResolve(); 182 | } 183 | 184 | } 185 | 186 | protected boolean isBuildGoodEnoughToRun(final Run build, final PrintStream console) { 187 | if (this.publishWhenFailed) { 188 | return true; 189 | } 190 | else { 191 | // Default behaviour 192 | return super.isBuildGoodEnoughToRun(build, console); 193 | } 194 | } 195 | 196 | public static class DescriptorMessages implements BPPluginDescriptor.BPDescriptorMessages { } 197 | 198 | } 199 | --------------------------------------------------------------------------------