0

I want to run a jenkins job using a powershell located in github. Calling the powershell script is successful. Now, a script uses Import-csv. The csv has been uploaded to github.

How to reference the csv path if it's in github. I tried ( '\CSVFILE) and it results in an error. Jenkins output reference an error as if the csv file as in the C Drive (C:..).

2
  • 1
    To make it easier to help you, can you post your script?
    – LPChip
    Commented Oct 31, 2019 at 20:28
  • You can't reference the file. You will need to download it first.
    – harrymc
    Commented Oct 31, 2019 at 21:11

1 Answer 1

0

The trivial answer is you install the Git plugin. You could also install the GitHub plugin. Basics are covered in the details of the plugins pages.

There is also an additional guide on the Jenkins site - Jenkins with GitHub. Other sites also have examples. In the build step you would put the command to execute; root repo is in in the workspace root.

But what if you already pull down a repo and now want the one with the script or csv? It sounds like you have the script and csv in separate repos (probably a good thing). Basic freestyle projects don't allow multiple repos into a single workspace. For that you need a pipeline. Details in Jenkins, or of course, in Stackoverflow.

There are alternatives. You could have one job pull the tools (powershell) repo to one location and your other jobs refer to it from that. You could use curl or wget to get the one file from the repo. You could get more complicated and make the tools repo a sub-module to your base repo (not a fan of sub-modules; ymmv).

Pipeline is probably your best bet for multiple repos.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .