Jenkins copies directories / files in assembly

I try to copy files to a network directory during build, and I continue to receive the error message "There is no such file or directory."

Copying to a local drive works fine: cp -Rf c: / Jenkins / deployment / TW_ISSUE_A / src c: / Jenkins / deployment / TW_ISSUE_A / target

All messages are listed below:

  • cp -Rf c: / Jenkins / deployments / TW_ISSUE_A / src H: / some_dir

  • cp -Rf c: / Jenkins / deployments / TW_ISSUE_A / src H: \ some_dir

  • cp -Rf c: / Jenkins / deployments / TW_ISSUE_A / src // Hubbell / MISGenl / some_dir

  • cd c: / Jenkins / deployment / TW_ISSUE_A / src rsync -avuzb // Hubbell / MISGenl / Projects / Tronweb / TronwebBuilds / test / ora / sql /

  • cp -Rf c: / Jenkins / deployments / TW_ISSUE_A / src / cygdrive / h / some_dir

I even created a shell script to call from Jenkins, but I keep getting this message.

#!/bin/bash url="http://as-test02:8080/job/TW_ISSUE_A_BUILD/lastSuccessfulBuild/artifact/bui ld-TW_ISSUE_A_BUILD.tar"; remote_stage_dir="/cygdrive/h/some_dir" #fetch the artifacts (cd "$remote_stage_dir" && wget "$url" && tar xvf build-TW_ISSUE_A_BUILD.tar dat java ora && rm -rf *.tar && cp -r ./ora/* ../INTEGRATION) 

Is there a way to copy files to a mapped drive on an assembly machine?

Thanks!

+4
source share
1 answer

I would suggest that the mapped drive is not available in the context of the services, or that the user running Jenkins does not have access to it. Which Jenkins user works like?

Edit: I think your problem has two aspects:

  • A user running the Jenkins service is not allowed to connect to the network.
  • h: not known to user.

If you did not change it, the service most likely runs under the LocalSystem account . You can change this by running services.msc (or go to services through the Windows control panel) and find the jenkins service. This should solve the first problem.

The second problem can be solved using UNC paths (as you tried above) instead of network drives.

The Jenkins wiki contains an article about such issues: My software is based on my computer, but not on Jenkins

+5
source

All Articles