[PATCH rdma-core 05/21] Make 'cbuild travis pkg' run sparse like real travis

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Provide a git dir in the container and compute the package set
relative to the current top of tree on github.

Signed-off-by: Jason Gunthorpe <jgunthorpe@xxxxxxxxxxxxxxxxxxxx>
---
 .travis.yml     |  1 +
 buildlib/cbuild | 12 ++++++++++++
 2 files changed, 13 insertions(+)

diff --git a/.travis.yml b/.travis.yml
index 4eba65be3353ca..c190a2418b651a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -26,6 +26,7 @@ addons:
       - fakeroot
       - gcc
       - gcc-7
+      - git
       - libnl-3-dev
       - libnl-route-3-dev
       - libudev-dev
diff --git a/buildlib/cbuild b/buildlib/cbuild
index 50e478154b0295..888fae6ccca692 100755
--- a/buildlib/cbuild
+++ b/buildlib/cbuild
@@ -550,6 +550,16 @@ def run_travis_build(args,env):
             subprocess.check_call(["git",
                                    "--git-dir",os.path.join(opwd,".git"),
                                    "reset","--hard","HEAD"]);
+            subprocess.check_call(["git",
+                                   "--git-dir",os.path.join(opwd,".git"),
+                                   "fetch",
+                                   "--no-tags",
+                                   "https://github.com/linux-rdma/rdma-core.git","HEAD";,
+                                   "master"]);
+            base = subprocess.check_output(["git",
+                                            "--git-dir",os.path.join(opwd,".git"),
+                                            "merge-base",
+                                            "HEAD","FETCH_HEAD"]).strip();
 
         home = os.path.join(os.path.sep,"home","travis");
         home_build = os.path.join(os.path.sep,home,"build");
@@ -559,8 +569,10 @@ def run_travis_build(args,env):
             "--read-only",
             "--rm=true",
             "-v","%s:%s"%(tmpdir, home_build),
+            "-v","%s:%s:ro"%(os.path.join(opwd,".git"),os.path.join(home_build,"src",".git")),
             "-w",os.path.join(home_build,"src"),
             "-u",str(os.getuid()),
+            "-e","TRAVIS_COMMIT_RANGE=%s..HEAD"%(base),
             "-e","HOME=%s"%(home),
             "-e","TMPDIR=%s"%(os.path.join(home_build,"tmp")),
         ];
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux