File tree 1 file changed +17
-1
lines changed 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 22
22
import json
23
23
import os
24
24
import re
25
+ import shlex
25
26
import shutil
26
27
import stat
27
28
import subprocess
@@ -833,10 +834,25 @@ def ensure(self) -> None:
833
834
"""
834
835
deps_to_build = [dep for dep in self if not dep .is_published_if_necessary ()]
835
836
self ._prepare_batch (deps_to_build )
837
+
838
+ images_to_push = []
836
839
for dep in deps_to_build :
837
840
dep .build ()
838
841
if dep .publish :
839
- spawn .runv (["docker" , "push" , dep .spec ()])
842
+ images_to_push .append (dep .spec ())
843
+
844
+ pushes : list [subprocess .Popen ] = []
845
+ for image in images_to_push :
846
+ push = subprocess .Popen (
847
+ f"docker push { shlex .quote (image )} | cat" ,
848
+ shell = True ,
849
+ )
850
+ pushes .append (push )
851
+
852
+ for push in pushes :
853
+ returncode = push .wait ()
854
+ if returncode :
855
+ raise subprocess .CalledProcessError (returncode , push .args )
840
856
841
857
def __iter__ (self ) -> Iterator [ResolvedImage ]:
842
858
return iter (self ._dependencies .values ())
You can’t perform that action at this time.
0 commit comments