Skip to content

Instantly share code, notes, and snippets.

@johnpmitsch
Last active January 10, 2017 00:20
Show Gist options
  • Save johnpmitsch/4ae1cfe8ffefb550e668b2256e5f341d to your computer and use it in GitHub Desktop.
Save johnpmitsch/4ae1cfe8ffefb550e668b2256e5f341d to your computer and use it in GitHub Desktop.
re-sync all repos in hammer
#!/usr/bin/ruby
password=(ARGV[0] || "changme")
orgs=`hammer -p changeme --csv organization list | tail -n+2 | awk -F, {'print $1'}`
orgs.split("\n").each do |org|
`hammer -p changeme --csv repository list --organization-id #{org} | grep -vi '^ID' | awk -F, {'print $1'}`.split("\n").each do |repo|
`hammer -p changeme repository synchronize --id #{repo} --organization-id #{org} --async`
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment