summaryrefslogtreecommitdiff
path: root/morph
diff options
context:
space:
mode:
authorJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-05-03 10:46:23 +0000
committerJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-05-03 12:53:53 +0000
commitb857a4ff09d3ec69211a655888e7bb64105303bd (patch)
treea60709519a7e80dcbdfcb25e64f7285098ad031d /morph
parentc349db9577380caa2df17d7c08f7ea9d4bfe17c2 (diff)
downloadmorph-b857a4ff09d3ec69211a655888e7bb64105303bd.tar.gz
Integrate RemoteArtifactCache into the building process.
For now we do not provide an option to avoid downloading artifacts during build. Unsetting --cache-server is an option but it's not user-friendly. Of course if there is no network connection, then downloading will fail and things will be built locally. We may want to add a generic --no-network switch to replace/extend --no-git-update later.
Diffstat (limited to 'morph')
-rwxr-xr-xmorph12
1 files changed, 9 insertions, 3 deletions
diff --git a/morph b/morph
index b2c0e44c..c28ccf15 100755
--- a/morph
+++ b/morph
@@ -185,6 +185,11 @@ class Morph(cliapp.Application):
ckc = morphlib.cachekeycomputer.CacheKeyComputer(build_env)
lac = morphlib.localartifactcache.LocalArtifactCache(
os.path.join(cachedir, 'artifacts'))
+ if self.settings['cache-server']:
+ rac = morphlib.remoteartifactcache.RemoteArtifactCache(
+ self.settings['cache-server'])
+ else:
+ rac = None
lrc = morphlib.localrepocache.LocalRepoCache(
os.path.join(cachedir, 'gits'),
self.settings['git-base-url'],
@@ -220,7 +225,8 @@ class Morph(cliapp.Application):
for group in order.groups:
for artifact in group:
if not lac.has(artifact):
- needed.append(artifact)
+ if not rac or not rac.has(artifact):
+ needed.append(artifact)
logging.debug('cmd_build: cloning/updating cached repos')
done = set()
@@ -258,8 +264,8 @@ class Morph(cliapp.Application):
self._install_initial_staging(staging_area)
builder = morphlib.builder2.Builder(
- staging_area, lac, lrc,
- build_env, self.settings['max-jobs'])
+ staging_area, lac, rac, lrc, build_env,
+ self.settings['max-jobs'])
if setup_proc:
builder.setup_proc = True