The system cannot find the specified drive in Jenkins

后端 未结 9 2432
半阙折子戏
半阙折子戏 2021-02-15 15:17

I want to copy some files from a network shared drive (mounted at my local machine as drive Z). I have written a Batch file to copy the contents of Z drive into my local drive.

相关标签:
9条回答
  • 2021-02-15 15:57

    Yes Jenkins uses different login credentials. To map a drives through Jenkins use below command in Jenkins command prompt:

    Subst U: \drive\folder

    then after that your queries.

    0 讨论(0)
  • 2021-02-15 15:58

    You might run into permission issues. Jenkins might be executed with different user credentials; so it does not know the configured drive for the windows share. Instead of using shell scripts I suggest to use a plugin. There is a set of Publish-over plugins that allow deployments to remote systems via a couple of protocols (ssh, cfis etc). Have a look at the CFIS plugin that allows to send artifacts to a windows share. Once the plugin is configured (ie the host is specified in the Manage Jenkins section) you can add to the post build steps Send files to a windows share where you can specify which file(s) shall be sent to which location.

    0 讨论(0)
  • 2021-02-15 15:58

    Basically you can access your network shared drive (Z) using by servername or IP from jenkins command. Write \\192.168.x.xxx\Your_Folder instead of z:\Your_Folder.

    For example:

    mkdir \\192.168.x.xxx\Your_Folder
    
    0 讨论(0)
提交回复
热议问题