brew.py 667 B

123456789101112131415161718192021
  1. import os
  2. import git
  3. DEFAULT_REPOSITORY = 'git://github.com/dotcloud/docker'
  4. DEFAULT_BRANCH = 'library'
  5. def fetch_buildlist(repository=None, branch=None):
  6. if repository is None:
  7. repository = DEFAULT_REPOSITORY
  8. if branch is None:
  9. branch = DEFAULT_BRANCH
  10. #FIXME: set destination folder and only pull latest changes instead of
  11. # cloning the whole repo everytime
  12. dst_folder = git.clone_branch(repository, branch)
  13. for buildfile in os.listdir(os.path.join(dst_folder, 'library')):
  14. f = open(os.path.join(dst_folder, 'library', buildfile))
  15. for line in f:
  16. print buildfile, '--->', line
  17. f.close()