txels / autojenkins

Jenkins automation scripts
http://autojenkins.readthedocs.org/
170 stars 61 forks source link

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

Closed bravegnu closed 9 years ago

bravegnu commented 9 years ago

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

bravegnu commented 9 years ago

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 commented 9 years ago

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

bravegnu commented 9 years ago

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 commented 9 years ago

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).

txels commented 9 years ago

Thanks! This will be included in the next release.