]> git.e2factory.org Git - e2factory.git/commitdiff
deployment: do not re-deploy releases that are already in archive
authorGordon Hecker <gh@emlix.com>
Wed, 5 May 2010 13:10:40 +0000 (15:10 +0200)
committerGordon Hecker <gh@emlix.com>
Mon, 17 May 2010 08:00:00 +0000 (10:00 +0200)
Signed-off-by: Gordon Hecker <gh@emlix.com>
local/e2build.lua

index 9d9e42282743e64c56ca6d3fd13958220e9cf9a9..7f9e12de7892275dfe89b930c4a7d62043cf3587 100644 (file)
@@ -1244,6 +1244,19 @@ function deploy(info, r, return_flags)
   table.insert(files, "checksums")
   local server, location = res.build_mode.deploy_storage(info.project_location,
                                                        info.release_id)
+
+  -- do not re-deploy if this release was already done earlier
+  local location1 = string.format("%s/%s/checksums", location, r)
+  local cache_flags = {
+    cache = false,
+  }
+  rc, re = info.cache:fetch_file(server, location1, ".", nil, cache_flags)
+  if rc then
+    e2lib.warnf("WOTHER",
+               "Skipping deployment. This release was already deployed.")
+    return true
+  end
+
   e2lib.logf(1, "deploying %s to %s:%s", r, server, location)
   for _,f in ipairs(files) do
     local sourcefile = string.format("result/%s", f)