Created
February 2, 2018 16:39
-
-
Save t3knoid/69436c466a3c6d5a5a412fb624080efa to your computer and use it in GitHub Desktop.
Jenkins pipeline script that will copy build artifacts to a CIFS folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def deployToCIFS(prefix = "", cifsConfig, destination) { | |
/** | |
* Copies file artifacts to a given CIFS share and folder. | |
* This requires the Jenkins Publish over CIFS plugin https://wiki.jenkins.io/display/JENKINS/Publish+Over+CIFS+Plugin | |
* @param prefix The file artifact's folder prefix. Everything after this prefix will be copied to the destination. The destination will not include this folder structure. Note that this is case-sensitive. | |
* @cifsConfig The CIFS configuration defined in the Jenkins Publish over CIFS system configuration. | |
* @destination The folder appended to the CIFS share to create a fully qualified path of the destination. | |
*/ | |
cifsConfig = 'myShare' // Define a share named "myShare" in the Jenkins Publish over CIFS system configuration | |
srcFiles = "${prefix}/**/**" // Copy everything after prefix | |
cifsPublisher alwaysPublishFromMaster: false, continueOnError: false, failOnError: true, publishers: [ | |
[configName: cifsConfig, | |
transfers: [ | |
[cleanRemote: true, excludes: '', flatten: false, makeEmptyDirs: true, noDefaultExcludes: false, patternSeparator: '[,]+', remoteDirectory: destination, remoteDirectorySDF: false, removePrefix: prefix, sourceFiles: srcFiles], | |
], | |
usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false | |
] | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment