Skip to end of metadata
Go to start of metadata

Send build artifacts to a windows share (CIFS/SMB/samba)

Plugin Information

View Publish Over CIFS on the plugin site for more information.

Older versions of this plugin may not be safe to use. Please review the following warnings before using an older version:

This plugin is up for adoption. Want to help improve this plugin? Click here to learn more!

Publish Over ...

Read Publish Over ... wiki page first

Please read Publish Over first.
Common configuration options that are documented in the Publish Over ... wiki page will not be repeated here.

Features
Configure
Change log

Features

  • Send files to windows shares
  • The plugin is "promotion aware" see Promotions
  • Publish to multiple shares in the "Post-build Actions"
  • Passwords are encrypted in the configuration files and in the UI
  • Copy files to a windows share during a build

Configure

Configure a WINS server

From the Jenkins home page, click "Manage Jenkins" and the click on "Configure System"

In the main Jenkins configuration page, there will be a "Publish Over CIFS" checkbox in the "Global properties" section.

WINS server

Set this option to the IP address of a WINS server that will be used by the Jenkins master, and will be the default for all other nodes (slaves)

The WINS server can be set or overridden for individual nodes (slaves)
A "Publish Over CIFS" checkbox will appear under "Node Properties" in the configuration for a node.
Set the WINS server to an IP address that this node will use for name resolution.
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.

Create host configurations in the main Jenkins configuration

From the Jenkins home page, click "Manage Jenkins" and the click on "Configure System"

Find the CIFS section (as below) and click on the "Add" button next to "CIFS Servers"

You should now have the configuration options as below

Fill in Name, Hostname, Username, Password and Share. see Publish Over ... for common options for Host Configurations

Hostname

Hostname is the hostname, IP address or windows servername of the host that contains the share

Username

To specify a user in a specific windows domain, use a back slash to separate eg MYDOMAIN\myuser

Share

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.
The share must be, or begin with, a windows share name on the server named in Hostname.

Advanced

If you click the "Advanced..." button for a configuration, then you will make more configuration options available (see below)

see Publish Over ... for common options for Host Configurations

Click "Test Configuration".
Add more server configurations (if required)
Save

Send files to a windows share during a build

This plugin adds a build step to enable you to send files to a windows share during a build.

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 below

Configure a job to send files to a windows share

Open a jobs main page and then click "Configure" from the left hand menu.

Find the "Send build artifacts to a windows share" checkbox in the "Post-build Actions" section and click in the box.

You should now have the configuration options as below

see Publish Over ... for common options for Server

see Publish Over ... for common options for Transfer Sets

Source files

The build will fail if you do not select any Source files to transfer

Advanced (Transfer Sets)

If you click the "Advanced..." button for a Transfer Set, then you will make more configuration options available (see below)

see Publish Over ... for common options for Transfer Sets

Clean remote

Delete all files and directories from the remote directory before uploading the new files.

Advanced (Publisher)

If you click the "Advanced..." button that is immediately below the "Add Server" button, then you will make more configuration options available (see below)

see Publish Over ... for common options for Publisher

Options to override the default Promotion behaviour

If you are configuring an action in a promotion, new options will become available.

see Publish Over ... for common options for Promotions

Change log

0.11 (2018-07-30)

0.9

  • Fixed issue with parameter verification using incorrect check urls
  • Fixed issue with bufferSize not being set correctly on ugprade (issue 49010)

Questions, Comments, Bugs and Feature Requests

Please post questions or comments about this plugin to the Jenkins User mailing list.
To report a bug or request an enhancement to this plugin please create a ticket in JIRA.

26 Comments

  1. I'm unsure if this is the right plugin i am looking for, but I have about more than 500 files to deploy from CI Server to another Server in different locations.

    can I use this plug in to publish files to another Test Server? I have been trying to make this work for over a day now, but seems to fail.

    here's my set up.

    I have 2 servers, a Build Server/Jenkins and another Test Server, what I am trying to do is deploy built files to Test Server when there are changed files after being built.

    Example

    Server 1

    E:\BuildOutput\Apps\Application1\

    Deploy to Server 2

    C:\Program Files\My Applications\APP1\

    One of my problems are the Bin directory where in Server 1 it's in Bin\Release and needs to be placed in APP1\Bin

    If there's another plug in that works like xcopy where we can only specify the files changed then that would be better.

  2. Hi,

    I am using CIFS plugin to send files to a windows share after a build completes. The build is going fine but when the file copy starts it errors with below message. I can see the plugin creating a folder as desired on the windows share and also copying the .war file that I want, but it fails mid way (creating a file of much smaller size than expected) The jenkins is setup on a solaris box. Can someone help?

    ================================

    CIFS: Connecting from host [server1]
    CIFS: Connecting with configuration [server2] ...

    CIFS: Disconnecting configuration [server2] ...
    FATAL: unable to create new native thread
    java.lang.OutOfMemoryError: unable to create new native thread
        at java.lang.Thread.start0(Native Method)
        at java.lang.Thread.start(Thread.java:597)
        at jcifs.UniAddress.lookupServerOrWorkgroup(UniAddress.java:173)
        at jcifs.UniAddress.getAllByName(UniAddress.java:290)
        at jcifs.UniAddress.getByName(UniAddress.java:245)
        at jcifs.smb.Dfs.getTrustedDomains(Dfs.java:62)
        at jcifs.smb.Dfs.resolve(Dfs.java:167)
        at jcifs.smb.SmbFile.resolveDfs(SmbFile.java:666)
        at jcifs.smb.SmbFile.send(SmbFile.java:768)
        at jcifs.smb.SmbFile.close(SmbFile.java:1016)
        at jcifs.smb.SmbFile.close(SmbFile.java:1022)
        at jcifs.smb.SmbFile.close(SmbFile.java:1026)
        at
    jcifs.smb.SmbFileOutputStream.close(SmbFileOutputStream.java:164)
        at
    jenkins.plugins.publish_over_cifs.CifsClient.transferFile(CifsClient.jav
    a:107)
        at
    jenkins.plugins.publish_over_cifs.CifsClient.transferFile(CifsClient.jav
    a:39)
        at
    jenkins.plugins.publish_over.BPTransfer.transferFile(BPTransfer.java:172
    )
        at
    jenkins.plugins.publish_over.BPTransfer.transfer(BPTransfer.java:162)
        at
    jenkins.plugins.publish_over.BapPublisher.perform(BapPublisher.java:146)
        at
    jenkins.plugins.publish_over_cifs.CifsPublisher.perform(CifsPublisher.ja
    va:60)
        at
    jenkins.plugins.publish_over.BPCallablePublisher.invoke(BPCallablePublis
    her.java:64)
        at
    jenkins.plugins.publish_over.BPCallablePublisher.invoke(BPCallablePublis
    her.java:37)
        at hudson.FilePath.act(FilePath.java:865)
        at hudson.FilePath.act(FilePath.java:838)
        at
    jenkins.plugins.publish_over.BPInstanceConfig.perform(BPInstanceConfig.j
    ava:124)
        at
    jenkins.plugins.publish_over.BPPlugin.perform(BPPlugin.java:109)
        at
    hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
        at
    hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.
    java:814)
        at
    hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(A
    bstractBuild.java:786)
        at hudson.model.Build$BuildExecution.post2(Build.java:183)
        at
    hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.jav
    a:733)
        at hudson.model.Run.execute(Run.java:1592)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
        at
    hudson.model.ResourceController.execute(ResourceController.java:88)
        at hudson.model.Executor.run(Executor.java:237)

    ==========================

  3. Hi all

    I can use the plugin right.

    But I dont want to set user and password in the CIFS Share definition (jenkins/configure).

    I want to set user and password in the job configuration, when selecting a CIFS Share.

    The link https://wiki.jenkins-ci.org/display/JENKINS/Publish+Over#PublishOver-server says:

    "Check to set the credentials to use to connect to the server.
    This option enables the credentials set in the Host Configuration to be overridden in the job configuration page.
    This option gives the server administrator the ability to create incomplete Host Configurations defining everything bar the credentials (i.e. leaving the Username blank) which means that configuring the server for use in a job will require the credentials to be set.
    When enabling this option, you will expose a Test Connection button that can be used to ensure that you have entered the credentials correctly."

    and this is not true publishing over CIFS.

    Do you know something about it?

    Regards

  4. Is it possible to get the remote directory used for each transfer set using something like Python? It would be helpful to communicate this information to users.

  5. Could you please add an option that will not overwrite existing files with the same filename on the share?

  6. Hello to all,

    since I've updated the plugin, the function "Send file to a windows share" does not work:

    jenkins.plugins.publish_over.BapPublisherException: Failed to find configuration named [] check the global configuration

    at jenkins.plugins.publish_over.BPInstanceConfig.getConfiguration(BPInstanceConfig.java:106)
    at jenkins.plugins.publish_over.BPInstanceConfig.perform(BPInstanceConfig.java:136)
    at jenkins.plugins.publish_over.BPPlugin.perform(BPPlugin.java:126)
    at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
    at jenkins.plugins.publish_over_cifs.CifsBuilderPlugin.perform(CifsBuilderPlugin.java:61)
    at org.jenkins_ci.plugins.run_condition.BuildStepRunner$2.run(BuildStepRunner.java:110)
    at org.jenkins_ci.plugins.run_condition.BuildStepRunner$Fail.conditionalRun(BuildStepRunner.java:154)
    at org.jenkins_ci.plugins.run_condition.BuildStepRunner.perform(BuildStepRunner.java:105)
    at org.jenkinsci.plugins.conditionalbuildstep.singlestep.SingleConditionalBuilder.perform(SingleConditionalBuilder.java:108)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
    at hudson.model.Build$BuildExecution.build(Build.java:206)
    at hudson.model.Build$BuildExecution.doRun(Build.java:163)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
    at hudson.model.Run.execute(Run.java:1727)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:429)

     


    I also wanted to ask if it was possible to add the possibility to use global variables to select the deployment environment.

  7. I'm having the same problem as Fabio Russo.  The plugin's configuration under "Manage Jenkins" looks fine, but when I edit a job that uses the plugin, the dropdown list "CIFS Share" is empty.

    Jenkins v2.103
    Publish Over CIFS v0.6

    I've tried downgrading to Publish Over CIFS v0.5, but the problem is still there - I suspect it's caused by the latest Jenkins release

  8. Hi,

    I have same problem as Frano Russo and Matt Phillips

    It's work only in Post Build Session

     

    Jenkins v2.106
    Publish Over CIFS v0.6

  9. I am having the same problem as those above.

    Jenkins v2.107.1

    Publich Over CIFS v0.9

    1. Please use the mailing list or JIRA for issues.

  10. I am having the same problem as those above. The share configuration list is empty, but is set up in the global config, see 2nd image at the bottom.

    Jenkins ver. 2.113

    Publish Over CIFS 0.9

    Drop down is wrongly empty, checkboxes are not labeled. 

    Promotion results in this error:

    ERROR: Failed to find configuration named [] check the global configuration
    build CifsPromotionPublisherPlugin[delegate=CifsPublisherPlugin[consolePrefix=CIFS: ,delegate=BPInstanceConfig[publishers=[CifsPublisher[configName=,verbose=true,transfers=[CifsTransfer[sourceFiles=**,excludes=,removePrefix=,remoteDirectory=$JOB_NAME/$BUILD_NUMBER,remoteDirectorySDF=false,flatten=true,cleanRemote=false,noDefaultExcludes=false,makeEmptyDirs=false,patternSeparator=]],useWorkspaceInPromotion=false,usePromotionTimestamp=false,retry=CifsRetry[retries=0,retryDelay=0],label=CifsPublisherLabel[label=],credentials=<null>]],continueOnError=false,failOnError=false,masterNodeName=<null>,alwaysPublishFromMaster=false,paramPublish=CifsParamPublish[parameterName=]]]]

  11. Please use the Jenkins User mailing list for questions. There is already a JIRA filed on this issue.

  12. Hi Alex, I found the JIRA incident for this - thanks! - hope you can fix this soon! Cannot select CIFS publish in project configuration

  13. Hi,  The latest PR for this project on GitHub seems have fixed this issue but I had to clone, build and install it manually as a release with this change isn't available yet.

    1. Can you please supply your build result (I don't have java build environment readily available)? Or at least the GitHub url for this. I went to GitHib and the only one found seemed like circa 2011. Thank you! -Kevin

      1. You can always get the latest build artifact from the Jenkins CI Infra at https://ci.jenkins.io/job/Plugins/job/publish-over-cifs-plugin/job/master/

        1. That is a cool url site!!! I installed this snapshot plugin and restarted Jenkins, it did not fix this problem, the CIFS Share drop down in the JOB configuration is still empty..... sigh... fyi, I hope this helps. Thank you! -Kevin 

  14. I've just updated to newest version 0.10 and it works absolutly slow. It is awful. Does anyone have ideas?

    11:04:12 CIFS: Setting response timeout [30,000]
    11:04:12 CIFS: Setting socket timeout [35,000]
    11:04:12 CIFS: Setting buffer size to: [4,096] Bytes
    
    11:12:59 CIFS: mkdir 
    1. Increase the buffer size in the global config.

  15. What would it take to add a link to the build information on where the files were copied to?  I'd think it should be fairly easy and it would make navigation that much faster.

    1. If the files are not available via HTTP, it would require more than you think. It would require accessing the share and sending the files in response to the request. There may already be a JIRA on this. Please use JIRA and the mailing lists for questions/issues.

  16. My requirement would be to only copy the last build result to a windows share, and not all the contents (might be older builds) existing within the workspace. Any pointers how could this be achieved? I tried this by generating the build files appended with $BUILD_NUMBER and then only copying this to the windows share, however this did not work. 

    1. Clean the workspace before building.  That's just good SCM/DevOps practices.

      1. Thanks Justin, sure will follow the best practices.

        Was just trying to explore the 'Source Files' option within the 'Transfer Set', could not really get the logic for reading the latest build file in the workspace and hence the question.

  17. I want to publish files to CIFS share provided by Alfresco server using SSO. How to enable SSO for this plugin?

    Details:

    We have a Alfresco Server and it is offering a CIFS share. In our AD domain only SSO is allowed.

    The Jenkins master machine itself is Windows 7 and domain member. Login into Alfresco share in Windows Explorer works.
    But I am unable to publish files from Jenkins.

    Error:

    Does someone knows how to enable SSO for this plugin?

  18. I got the problem than this plugin completely ignores "Source files" and fails if "Remove prefix" is not empty. It publishes everything from my WORKSPACE.


    On Jenkins 2.138.2, Publish Over CIFS 0.11, Windows.

    Workaround for Jenkins Freestyle jobs:

    1. Under "Send build artifacts to a windows share" click "Advanced".
    2. Insert the comma , into the "Pattern separator" field.

    The bug is related to  JENKINS-50989 - Getting issue details... STATUS