Skip to content

Instantly share code, notes, and snippets.

@thommay
Last active August 29, 2015 14:01
Show Gist options
  • Save thommay/05bece4bf798f84937ef to your computer and use it in GitHub Desktop.
Save thommay/05bece4bf798f84937ef to your computer and use it in GitHub Desktop.
def jj(p)
name = p.name.sub(/-cook/, " cook")
n_xml = Nokogiri::XML(@jenkins.client.job.get_config(name))
path = n_xml.xpath("//url").children.first
path.content = p.ssh_url_to_repo
gitlab = n_xml.xpath("//__projectPath").children.first
gitlab.content = p.web_url unless gitlab.nil?
@jenkins.client.job.post_config(name, n_xml.to_xml)
end
@gitlab.gl.projects(per_page: 100).select { |p| p.name =~ /.*cookbook/ }.reject{ |p| p.ssh_url_to_repo =~ /^[email protected]:cookbooks/ }.each do |prj|
@gitlab.gl.transfer_project_to_group(32, prj.id)
prj = @gitlab.gl.project(prj.id)
jj prj
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment