commit message from python script
This commit is contained in:
20
jenkins_modify_jobs/test.py
Normal file
20
jenkins_modify_jobs/test.py
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import jenkins
|
||||
|
||||
if __name__ == '__main__':
|
||||
#server = Jenkins('https://man-dan-03:9443', username='JonnyBravo', password='113c3449636622439627ab1d51454fc07c')
|
||||
server = jenkins.Jenkins('https://man-dan-03:9443', username='JonnyBravo', password='113c3449636622439627ab1d51454fc07c')
|
||||
job_config = server.get_job_config('mulit_pipeline')
|
||||
#print(job_config)
|
||||
#config=job.get_config()
|
||||
old_config_part = """ <strategy class="jenkins.branch.DefaultBranchPropertyStrategy">
|
||||
<properties class="empty-list"/>
|
||||
</strategy>"""
|
||||
new_config_part = """ <strategy class="jenkins.branch.DefaultBranchPropertyStrategy">
|
||||
<properties class="-----------------------------------"/>
|
||||
</strategy>"""
|
||||
new = job_config.replace(new_config_part, old_config_part)
|
||||
server.reconfig_job('mulit_pipeline', new)
|
||||
#new = config.replace('oldvalue', 'newvalue')
|
||||
#job.update_config(new)
|
||||
Reference in New Issue
Block a user