I am using Jenkins to trigger and manage a series of import jobs. I want to put my import script in Github, and when Jenkins builds the job, it should (a) pull that version controlled script out of Github and (b) run the script.
The problem that I am running into is that I don't know how to reference the name of the script to run within the job. I'm assuming that source code is pulled into the workspace directory. Is that assumption correct? (If only there was documentation!)
Here's what I've done so far:
- Installed Jenkins (obviously) on my Windows Server (no, I didn't have a choice about that)
- Created a repository on my github account and put my code in it
- It's public at https://github.com/mcholl/SARS-Import/
- You'll see I have two scripts, roottest.py and omniture-video\test.py. The code there is under patent by Apple, I'm sure :)
- The idea is that I would want to run roottest.py
- Installed the Github plugin
- Created a job as follows:
- Project Name = "Testing Github Integration"
- GitHub Project: https://github.com/mcholl/SARS-Import.git/
- Add a Windows batch command: python roottest.py
- Manually execute the job
What I get, however, is an error message that the file cannot be located. This is strange, because I assume the workflow would be "pull a local copy of source to the ...(Job)/workspace/ directory, then run the batch command in the context of the workspace directory.
Here's the full console output:
Started by user anonymous Building in workspace C:\Program Files (x86)\Jenkins\jobs\Testing Github Integration\workspace [workspace] $ cmd /c call C:\Windows\TEMP\hudson1966342425043540895.bat
C:\Program Files (x86)\Jenkins\jobs\Testing Github Integration\workspace>python roottest.py python: can't open file 'roottest.py': [Errno 2] No such file or directory
C:\Program Files (x86)\Jenkins\jobs\Testing Github Integration\workspace>exit 2 Build step 'Execute Windows batch command' marked build as failure Finished: FAILURE
Obviously I was expecting to just see the results of my print statement in the console.
What did I mess up? And why isn't my script already there?