Last active
August 24, 2016 11:14
-
-
Save epishan/010c43227200eeb29c25f833c553dd2c to your computer and use it in GitHub Desktop.
Revisions
-
epishan renamed this gist
Aug 24, 2016 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
epishan created this gist
Aug 24, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ // Groovy script to rename job in Hudson import hudson.model.*; def JOB_PATTERN = ~/^GO.*.deploy_container.staging*$/; //find all jobs starting with "MY_JOB". def NEW_PART = "_NEW" (Hudson.instance.items.findAll { job -> job.name =~ JOB_PATTERN }).each { job_to_update -> if (job_to_update.name =~ "GO.bob_api.*") { return; } else { println ("Updating job " + job_to_update.name); def new_job_name = job_to_update.name.replaceFirst("build", "build_binary"); println ("New name: " + new_job_name); job_to_update.renameTo(new_job_name); println ("Updated name: " + job_to_update.name); println("="*80); } }