[PATCH rdma-core 08/19] build/cbuild: Add push-azp-images

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

 



From: Jason Gunthorpe <jgg@xxxxxxxxxxxx>

Do a parallel push of all the Azure Pipelines images to the container
registry.

Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxxxx>
---
 buildlib/cbuild | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/buildlib/cbuild b/buildlib/cbuild
index 1c325c9fe7cbdf..9fd51cc750dcbb 100755
--- a/buildlib/cbuild
+++ b/buildlib/cbuild
@@ -161,6 +161,7 @@ class centos7_epel(centos7):
     ninja_cmd = "ninja-build";
     # Our spec file does not know how to cope with cmake3
     is_rpm = False;
+    to_azp = False;
 
     def get_docker_file(self):
         res = YumEnvironment.get_docker_file(self);
@@ -1059,6 +1060,29 @@ def cmd_build_images(args):
                      tmpdir]);
             docker_cmd(args,*opts);
 
+# -------------------------------------------------------------------------
+
+def args_push_azp_images(args):
+    pass
+def cmd_push_azp_images(args):
+    """Push the images required for Azure Pipelines to the container
+    registry. Must have done 'az login' first"""
+    subprocess.check_call(["sudo","az","acr","login","--name","ucfconsort"]);
+    with private_tmp(args) as tmpdir:
+        nfn = os.path.join(tmpdir,"build.ninja");
+        with open(nfn,"w") as F:
+            F.write("""rule push
+            command = docker push $img
+            description=Push $img\n""");
+
+            for env in environments:
+                name = env.image_name()
+                if "ucfconsort.azurecr.io" not in name:
+                    continue
+                F.write("build push_%s : push\n   img = %s\n"%(env.name,env.image_name()));
+                F.write("default push_%s\n"%(env.name));
+        subprocess.check_call(["sudo","ninja"],cwd=tmpdir);
+
 # -------------------------------------------------------------------------
 def args_make_dist_tar(parser):
     parser.add_argument("BUILD",help="Path to the build directory")
-- 
2.22.0




[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