Last active
January 10, 2017 00:20
-
-
Save johnpmitsch/4ae1cfe8ffefb550e668b2256e5f341d to your computer and use it in GitHub Desktop.
re-sync all repos in hammer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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