[ARVADOS-DEV] updated: b7ef9141c38eacca1f6710cff3c56d3238c6c89e

Git user git at public.curoverse.com
Wed Jun 15 14:00:44 EDT 2016


Summary of changes:
 jenkins/run_upload_packages.py | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

       via  b7ef9141c38eacca1f6710cff3c56d3238c6c89e (commit)
       via  146f848a7a4f87c12ed7da207aa2e5d9d85ccda8 (commit)
      from  5f301325e2ad7d46e013b0ce59f6d01c1ed2d820 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit b7ef9141c38eacca1f6710cff3c56d3238c6c89e
Author: Brett Smith <brett at curoverse.com>
Date:   Wed Jun 15 13:59:40 2016 -0400

    run_upload_packages: Improve names around run_and_grep.
    
    No issue #, just easier to comprehend I hope.

diff --git a/jenkins/run_upload_packages.py b/jenkins/run_upload_packages.py
index 7bcfb4a..5a92eb9 100755
--- a/jenkins/run_upload_packages.py
+++ b/jenkins/run_upload_packages.py
@@ -13,8 +13,8 @@ import subprocess
 import sys
 import time
 
-def run_and_scan_output(cmd, read_output, *line_matchers,
-                        encoding=locale.getpreferredencoding(), **popen_kwargs):
+def run_and_grep(cmd, read_output, *regexps,
+                 encoding=locale.getpreferredencoding(), **popen_kwargs):
     """Run a subprocess and capture output lines matching regexps.
 
     Arguments:
@@ -29,13 +29,13 @@ def run_and_scan_output(cmd, read_output, *line_matchers,
 
     Returns 2-tuple (subprocess returncode, list of matched output lines).
     """
-    line_matchers = [matcher if hasattr(matcher, 'search') else re.compile(matcher)
-                     for matcher in line_matchers]
+    regexps = [regexp if hasattr(regexp, 'search') else re.compile(regexp)
+               for regexp in regexps]
     popen_kwargs[read_output] = subprocess.PIPE
     proc = subprocess.Popen(cmd, **popen_kwargs)
     with open(getattr(proc, read_output).fileno(), encoding=encoding) as output:
         matched_lines = [line for line in output
-                         if any(regexp.search(line) for regexp in line_matchers)]
+                         if any(regexp.search(line) for regexp in regexps)]
     return proc.wait(), matched_lines
 
 
@@ -115,7 +115,7 @@ class PythonPackageSuite(PackageSuite):
         if not self.logger.isEnabledFor(logging.INFO):
             cmd.append('--quiet')
         cmd.extend(['sdist', '--dist-dir', '.upload_dist', 'upload'])
-        upload_returncode, repushed = run_and_scan_output(
+        upload_returncode, repushed = run_and_grep(
             cmd, 'stderr', self.REUPLOAD_REGEXP, cwd=src_dir)
         if (upload_returncode != 0) and not repushed:
             raise subprocess.CalledProcessError(upload_returncode, cmd)
@@ -128,8 +128,7 @@ class GemPackageSuite(PackageSuite):
 
     def upload_file(self, path):
         cmd = ['gem', 'push', path]
-        push_returncode, repushed = run_and_scan_output(
-            cmd, 'stdout', self.REUPLOAD_REGEXP)
+        push_returncode, repushed = run_and_grep(cmd, 'stdout', self.REUPLOAD_REGEXP)
         if (push_returncode != 0) and not repushed:
             raise subprocess.CalledProcessError(push_returncode, cmd)
 

commit 146f848a7a4f87c12ed7da207aa2e5d9d85ccda8
Author: Brett Smith <brett at curoverse.com>
Date:   Wed Jun 15 13:54:12 2016 -0400

    run_upload_packages ensures destination scp directory exists.
    
    This prevents build failures like
    <https://ci.curoverse.com/job/build-packages-sso/24/console>.
    No issue #.

diff --git a/jenkins/run_upload_packages.py b/jenkins/run_upload_packages.py
index 83feaba..7bcfb4a 100755
--- a/jenkins/run_upload_packages.py
+++ b/jenkins/run_upload_packages.py
@@ -165,8 +165,11 @@ class DistroPackageSuite(PackageSuite):
                 self.__class__.__name__, *(pipes.quote(s) for s in args)))
 
     def upload_files(self, paths):
+        dest_dir = os.path.join(self.REMOTE_DEST_DIR, self.target)
+        mkdir = self._build_cmd('ssh', self.ssh_host, 'install', '-d', dest_dir)
+        subprocess.check_call(mkdir)
         cmd = self._build_cmd('scp', *paths)
-        cmd.append('{self.ssh_host}:{self.REMOTE_DEST_DIR}/{self.target}'.format(self=self))
+        cmd.append('{}:{}'.format(self.ssh_host, dest_dir))
         subprocess.check_call(cmd)
 
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list