Skip to content
Browse files

Add repos to Deployers team automatically

  • Loading branch information...
1 parent cb60648 commit 381a1d5285b6e36e1bb1f0efcdbc80e30dbc9e32 @mizzy committed Feb 13, 2013
Showing with 9 additions and 1 deletion.
  1. +9 −1 manage_paperboy.rb
View
10 manage_paperboy.rb
@@ -18,7 +18,7 @@ def octokit
Octokit::Client.new(:login => config['username'], :password => config['password'])
end
-puts `thor member:bulk_add --file=#{file} --organization=paperboy-all --team=paperboy --public`
+puts `thor member:bulk_add --file=#{file} --organization=paperboy-all --team=paperboy`
puts `thor member:sync --srcorg=paperboy-all --srcteam=paperboy --destorg=paperboy-all --destteam=paperboy-rw`
@@ -34,10 +34,14 @@ def octokit
end
paperboy_team = nil
+ deployer_team = nil
octokit.org_teams(org).each do |team|
if team.name.match(/^paperboy$/)
paperboy_team = team
+ elsif team.name == 'Deployers'
+ deployer_team = team
end
+
end
unless paperboy_team
@@ -48,6 +52,10 @@ def octokit
octokit.org_repos(org, { type: 'private' }).each do |repo|
puts "Adding #{repo.full_name} to paperboy ..."
octokit.add_team_repo(paperboy_team.id, repo.full_name)
+ if org == 'paperboy-all'
+ puts "Adding #{repo.full_name} to Deployers ..."
+ octokit.add_team_repo(deployer_team.id, repo.full_name)
+ end
end
if org != 'paperboy-all'

0 comments on commit 381a1d5

Please sign in to comment.
Something went wrong with that request. Please try again.