Child pages
  • Set GitBlitRepositoryBrowser with custum settings on all repos

Due to some maintenance issues, this service has been switched in read-only mode, you can find more information about the why

and how to migrate your plugin documentation in this blogpost

Skip to end of metadata
Go to start of metadata

This scripts allows to update the repo browser. Can be adapted to any other browser, not only gitblit.

import hudson.model.*
import hudson.triggers.*
import hudson.plugins.git.browser.GitBlitRepositoryBrowser

// you might want to change here
def url = 'https://mygitblitserver/gitblit/'
def i = 0
for(item in Hudson.instance.items) {
  def scm = item.scm
  if((scm instanceof hudson.plugins.git.GitSCM) && !(scm.browser instanceof GitBlitRepositoryBrowser)) {
    println('##########')
    println(scm.dump())
    // you might want to change here
    def match = scm.userRemoteConfigs =~ /\/spu\/test\/git\/(.*?.git)/
    if(match) {
      i++
      def projectName = match[0][1]
      println projectName
      scm.browser = new GitBlitRepositoryBrowser(url, projectName)
    }
  }
}
println("$i projects updated")
  • No labels