Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No way to handle workspace paths for the job names #32

Open
eddiemoya opened this issue Feb 9, 2015 · 2 comments
Open

No way to handle workspace paths for the job names #32

eddiemoya opened this issue Feb 9, 2015 · 2 comments

Comments

@eddiemoya
Copy link

Some jenkins jobs are setup within a workspace, and as such the path to that job may be something like

    http://host.com/jenkinspath/work/space/path/jobname

This tool doesn't account for the workspace. For launching the job I was able to simply pass work/space/path/jobname as the value for the jobname. However when using other methods like getJob(), for example, the tool tries to grab the job name from the api response instead of the one provided by the developer. This doesn't include the workspace, and so this failed.

I patched this up for my own purposes in my fork, here cdc95e0. This is a quick and dirty solution, which only addresses my immediate need. My solution was to

  • change the return statement of a couple methods, including the getJob() method so that it passes the $jobname it already has as a parameter.
  • change the Jenkins_Job constructor to receive this variable.
  • change the Jenkins_Job->getName() method to use that variable.

The work I did was quick and messy, and not thought out. I don't recommend merging it into your code, hopefully its a starting point to help solve the problem.

Thanks for making this to begin with, it saved me a lot of time.

@agallou
Copy link
Member

agallou commented Feb 9, 2015

Hi, how did you end up with the work/space path un your jenkins url ? Did you use a plugin ? If not, what config have you done on your job ?

@eddiemoya
Copy link
Author

I'm sorry, meant folders. I had git working directories on the brain and mixed my terminology.

We have our jobs organized into folders. I didn't realize this was introduced by a plugin - I don't know this first hand because I didn't set up a job myself - but I did a quick search and found that there is a folders plugin, so I assume were using something like this.

Since it looks like this is something done by a plugin, is this something you would not support?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants