Beispiel #1
0
 def herd(self):
     """Clone project or update latest from upstream"""
     self._print_status()
     if not os.path.isdir(os.path.join(self.full_path(), '.git')):
         git_clone_url_at_path(self.url, self.full_path(), self.ref, self.remote_name)
     else:
         ref_type = git_ref_type(self.ref)
         if ref_type is 'branch':
             git_create_remote(self.full_path(), self.remote_name, self.url)
             git_fetch(self.full_path())
             git_checkout_ref(self.full_path(), self.ref, self.remote_name)
             branch = git_truncate_ref(self.ref)
             git_pull_remote_branch(self.full_path(), self.remote_name, branch)
         elif ref_type is 'tag' or ref_type is 'sha':
             git_create_remote(self.full_path(), self.remote_name, self.url)
             git_fetch(self.full_path())
             git_checkout_ref(self.full_path(), self.ref, self.remote_name)
         else:
             print('Unknown ref ' + self.ref)
Beispiel #2
0
 def breed(self, url):
     """Clone clowder repo from url"""
     git_clone_url_at_path(url, self.clowder_path, 'refs/heads/master', 'origin')
     self.symlink_yaml()