Configure an update center in an existing Team/Managed Master

Issue

You would like to automatically configure an update center in an existing Team/Managed Master

Environment

Resolution

Configure an update center in an existing Team

For Teams you can execute the groovy code below under Manage Jenkins -> Script Console in Operations Center. You could also execute this groovy script through Operations Center CLI.

def team = Jenkins.instance.getItemByFullName('Teams/<TEAM_NAME>')
com.cloudbees.opscenter.plugins.updatecenter.ConnectedMasterUpdateCenterProperty prp = new com.cloudbees.opscenter.plugins.updatecenter.ConnectedMasterUpdateCenterProperty(new com.cloudbees.plugins.updatecenter.sources.LocalUpdateSource('<UPDATE_CENTER_NAME>'))
team.getProperties().replace(prp)
team.save()

Configure an update center in a Managed Master

For Managed Masters you can execute the groovy code below under Manage Jenkins -> Script Console in Operations Center. You could also execute this groovy script through Operations Center CLI.

def mm = Jenkins.instance.getItemByFullName('MANAGED_MASTER_FULL_NAME>')
com.cloudbees.opscenter.plugins.updatecenter.ConnectedMasterUpdateCenterProperty prp = new com.cloudbees.opscenter.plugins.updatecenter.ConnectedMasterUpdateCenterProperty(new com.cloudbees.plugins.updatecenter.sources.LocalUpdateSource('<UPDATE_CENTER_NAME>'))
mm.getProperties().replace(prp)
mm.save()

Tested product/plugin versions

Have more questions?

0 Comments

Please sign in to leave a comment.