windowsjenkinsiisdevopscifs

Facing issue while using “Publish Over CIFS Plugin” jenkins plugin?


I am using Jenkins on a Windows machine to build my .Net code and to publish artifacts on an IIS server hosted on a remote windows server.

In this process I followed the following steps, but no file has been transferred.

  1. Installed Jenkins, Visual Studio and all required plugins.
  2. Configured MSBuild to Jenkins and succeeded up to build process.
  3. Installed "Publish Over CIFS Plugin" and get succeeded in establishing connection b/w Jenkins and remote servers.

Jenkins general config > Publish over CIFS > CIFS Share

Name: jenkispush

Hostname: IPv4 address

Username: Admin

Password: *********

Share: jenkins

     Success Test configuration

Job > Post-build Actions > Send build artifacts to a windows share > CIFS Share

Name: jenkispush

Source files: C:\Program Files (x86)\Jenkins\workspace\pncreengineerin

Remove prefix: C:\Program Files (x86)\Jenkins\workspace\pncreengineerin

Remote directory: $JENKINS_HOME

Exclude files:

Pattern separator: [, ]+

Remote directory is a date format: [x]

Job success log

Time Elapsed 00:00:05.67
CIFS: Connecting from host [NYMCHNCPU326]
CIFS: Connecting with configuration [jenkispush] ...
CIFS: Disconnecting configuration [jenkispush] ...
CIFS: Transferred 0 file(s)
Finished: SUCCESS

Solution

  • Finally I got succeeded with this plugin by using pipeline job.

    steps to configure pipeline job:

    1. create a pipeline job.

    2. Select "cifsPublisher: Send build artifacts to windows share" option from sample step

    3. give CIFS share name i.e., is configured in "configure system"
    4. fill "source file", "remove prefix", "remote directory" (remote directory is a shared folder in remote server) and generate syntax.

    ex syntax: cifsPublisher(publishers: [[configName: 'XXX-Green-SERVER', transfers: [[cleanRemote: false, excludes: '', flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: 'configuration', remoteDirectorySDF: false, removePrefix: '', sourceFiles: 'configuration.zip']], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false]])

    in above example

    source file: configuration.zip

    remote directory(shared folder): configuration