Skip to content

Instantly share code, notes, and snippets.

@jayzeng
Last active December 11, 2015 02:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jayzeng/4534869 to your computer and use it in GitHub Desktop.
Save jayzeng/4534869 to your computer and use it in GitHub Desktop.
repo set up
#!/usr/bin/python
import subprocess
devs = {}
devs['jayzeng'] = 'jayzeng'
devs['davidremm'] = 'davidremm'
devs['beau'] = 'beauhoyt'
devs['yanmei'] = 'wyiemay'
devs['niek'] = 'nieksand'
devs['lee'] = 'leehasoffers'
devs['lucas'] = 'lucasoffers'
devs['ryan'] = 'ryanathasoffers'
devs['justin'] = 'justinhasoffers'
devs['heather'] = 'hglennrock'
devs['josh'] = 'joshs633'
devs['jack'] = 'jackofseattle'
devs['charles'] = 'charlesgardiner'
devs['chrish'] = 'haschenry'
devs['sjan'] = 'hassjan'
devs['kevin'] = 'kevin-hasoffers'
devs['blake'] = 'hasblake'
devs['nick'] = 'rushton'
# retrieve local username
whoami_cmd = subprocess.Popen(['whoami'], stdout=subprocess.PIPE)
local_username, err = whoami_cmd.communicate()
local_username = local_username.strip('\n')
for dev_name, dev_alias in devs.iteritems():
repos = ['Apiv3', 'Framework', 'Apitools', 'hasoffers','developers.hasoffers.com','Publisher_Interface', 'schema']
for repo in repos:
base_repo = ('/data/www/%s') % repo
# set remote to match your username
if local_username in dev_name:
origin_alias = ('git@github.com:%s/%s.git') % (dev_alias, repo)
subprocess.Popen(['/usr/bin/git', 'remote', 'set-url', 'origin', origin_alias], cwd=base_repo)
prod_alias = ('git@github.com:Adapp/%s.git') % repo
repo_alias = ('git@github.com:%s/%s.git') % (dev_alias, repo)
subprocess.Popen(['/usr/bin/git', 'remote', 'add', dev_name, repo_alias], cwd=base_repo)
subprocess.Popen(['/usr/bin/git', 'remote', 'add', 'prod', prod_alias], cwd=base_repo)
open('.dont_run_terminator', 'w').close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment