mba
mba

Reputation: 33

How to copy content of one folder to another in windows with jenkins

I am trying to copy files from one folder to another in windows with jenkins.

Build script is as follows: xcopy /s /Y "$WORKSPACE\\artifacts\\*.*" "$WORKSPACE\\publish-output"

Console Output: Invalid number of parameters

Upvotes: 1

Views: 2983

Answers (1)

Muhammad Faizan-Ul-Haq
Muhammad Faizan-Ul-Haq

Reputation: 340

What do you mean by "windows" ? I assume the jenkins server is on Windows OS or the slave node is a windows os. At the same time you have tagged "bash" Do you mean "batch" ? Referring to $Workspace is not windows style either, you should be using %workspace% An example:

  • Create a freestyle job
  • Restrict it to run on windows slave if the master is not Windows.
  • Use build step "Execute Windows batch command"
  • Try the command like:

    xcopy /s /Y %WORKSPACE%\dir1*.* %WORKSPACE%\dir2.

This should work.

Upvotes: 2

Related Questions