Browse Source

Fixed bugs in brew script. Now uses stackbrew/ namespace for prefill

shin- 12 years ago
parent
commit
75548efce0
2 changed files with 10 additions and 1 deletions
  1. 6 1
      brew/brew.py
  2. 4 0
      brew/git.py

+ 6 - 1
brew/brew.py

@@ -96,7 +96,12 @@ def build_library(repository=None, branch=None, namespace=None, push=False,
                 if prefill:
                     logger.debug('Pulling {0} from official repository (cache '
                         'fill)'.format(buildfile))
-                    client.pull(buildfile)
+                    try:
+                        client.pull('stackbrew/' + buildfile)
+                    except:
+                        # Image is not on official repository, ignore prefill
+                        pass
+
                 img = build_repo(url, ref, buildfile, tag, namespace, push,
                     registry)
                 summary.add_success(buildfile, (linecnt, line), img)

+ 4 - 0
brew/git.py

@@ -52,6 +52,10 @@ def clone(repo_url, ref=None, folder=None):
         except:
             pass
 
+    if ref.startswith('refs/tags'):
+        ref = rep.ref(ref)
+        is_commit = True
+
     if is_commit:
         rep['HEAD'] = rep.commit(ref)
     else: