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

Add support to update jobs, if they exist. #23

Merged
merged 2 commits into from Oct 12, 2014
Merged

Conversation

bravegnu
Copy link
Contributor

@bravegnu bravegnu commented Oct 9, 2014

Added an optional argument to create_copy(), to indicate whether to
update the job if it already exists.

Added an optional argument to create_copy(), to indicate whether to
update the job if it already exists.
@bravegnu
Copy link
Contributor Author

I would like to see the update feature added to autojenkins. If you think this should be done as a separate API, then I will submit this as a separate API ...

@txels
Copy link
Owner

txels commented Oct 10, 2014

This seems OK to me, I'll take a look in detail when I get more time.

@bravegnu
Copy link
Contributor Author

The only problem that I see with this approach is, it will break existing users if they have a variable called "update" in their template.

@txels
Copy link
Owner

txels commented Oct 11, 2014

Good point. Maybe you can solve that (make it less likely) if you rename that parameter with a leading underscore, such as _update? Or I'd rather call it _overwrite which I believe is more accurate, or _force (which is more in line with unix-y commands).

In create_copy(), use the argument name _force, instead of update, to
avoid collision with other template variable names. Also added a unit
test case to cover this scenario.
txels added a commit that referenced this pull request Oct 12, 2014
Add support to update jobs, if they exist.
@txels txels merged commit 70bb55d into txels:master Oct 12, 2014
@txels
Copy link
Owner

txels commented Oct 12, 2014

Thanks! This will be included in the next release.

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

Successfully merging this pull request may close these issues.

None yet

2 participants