]> git.e2factory.org Git - e2factory.git/commitdiff
deployment: move deployment settings to policy module
authorGordon Hecker <gh@emlix.com>
Wed, 5 May 2010 12:41:16 +0000 (14:41 +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
local/policy.lua

index 02640f9be29c63a1c18074319cd5717afc50cf3e..1d631543d01bb68327c66be8b012dca2a7a038e9 100644 (file)
@@ -1242,12 +1242,11 @@ function deploy(info, r, return_flags)
     table.insert(files, string.format("files/%s", f))
   end
   table.insert(files, "checksums")
-  local server = "releases"
-  local location = string.format("%s/archive/%s/%s", info.project_location,
-                                                       info.release_id, r)
+  local server, location = res.build_mode.deploy_storage(info.project_location,
+                                                       info.release_id)
   for _,f in ipairs(files) do
     local sourcefile = string.format("result/%s", f)
-    local location1 = string.format("%s/%s", location, f)
+    local location1 = string.format("%s/%s/%s", location, r, f)
     local cache_flags = {}
     e2lib.logf(1, "result: %s deploying %s:%s", r, server, location1)
     local rc, re = info.cache:push_file(sourcefile, server, location1,
index 397c9e867707565fc064420d191ab3493741ae14..823b9b0421bd535b7899a4e7f5cccd4f096458f4 100644 (file)
@@ -54,6 +54,11 @@ function storage_local(location, release_id)
        return local_server, string.format("out")
 end
 
+local releases_server = "releases"
+function deploy_storage_default(location, release_id)
+       return releases_server, string.format("%s/archive/%s", location,
+                                                               release_id)
+end
 
 function dep_set_buildid(buildid)
        return buildid
@@ -134,6 +139,7 @@ function init(info)
                storage_release,
                storage_default,
                storage_local,
+               deploy_storage_default,
        }
        for i,s in ipairs(storage) do
                local location = "test/test"
@@ -253,6 +259,7 @@ policy.default_build_mode["release"] = {
        buildid = policy.buildid_buildid,
        storage = policy.storage_release,
        deploy = true,
+       deploy_storage = policy.deploy_storage_default,
 }
 
 policy.default_build_mode["branch"] = {