Title: [231230] trunk/Tools
Revision
231230
Author
[email protected]
Date
2018-05-02 05:00:37 -0700 (Wed, 02 May 2018)

Log Message

[GTK] Generate a JSC bundle on the 64 and 32 bit release bots and upload it to webkitgtk.org
https://bugs.webkit.org/show_bug.cgi?id=184699

Reviewed by Gustavo Noronha Silva.

This adds a new step for the GTK 64-bit release build bot and the
GTK 32-bit release build&test bot.

This step will be run as one of the lasts ones (after the product
is built) and will execute the script generate-jsc-bundle.
This script will take care of creating a JSC bundle and uploading
it to a server defined on a configuration file that has to be
deployed on the bots with the required server data and credentials
for this upload.

In this case, the built products should then be accessible at
<https://webkitgtk.org/jsc-built-products>. But the implementation
is not tied to any specific server. All the details about where
to upload the file is done in configuration file that is kept
private on each bot outside of the WebKit source tree.

The script also supports generating a JSC bundle locally and not
uploading it anywhere. This is the default mode of running.
The remote upload will only be activated if a --remote-config-file
parameter is passed (which is done from the buildbot config)

* BuildSlaveSupport/build.webkit.org-config/config.json:
* BuildSlaveSupport/build.webkit.org-config/factories.py:
(BuildFactory):
(BuildFactory.__init__):
(TestFactory):
(TestFactory.__init__):
(BuildAndGenerateJSCBundleFactory):
(BuildAndNonLayoutTestAndGenerateJSCBundleFactory):
* BuildSlaveSupport/build.webkit.org-config/steps.py:
(GenerateJSCBundle):
* BuildSlaveSupport/build.webkit.org-config/steps_unittest.py:
* Scripts/generate-jsc-bundle: Added.
(ldd_get_libs_and_interpreter):
(generate_readme):
(generate_wrapper_script):
(copy_and_remove_rpath):
(createJSCBundle):
(sha256sum):
(uploadJSCBundle):
(main):

Modified Paths

Added Paths

Diff

Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/config.json (231229 => 231230)


--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/config.json	2018-05-02 11:21:28 UTC (rev 231229)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/config.json	2018-05-02 12:00:37 UTC (rev 231230)
@@ -237,12 +237,12 @@
                       "slavenames": ["bot507", "bot504"]
                     },
                     {
-                      "name": "GTK Linux 32-bit Release", "type": "BuildAndNonLayoutTest", "builddir": "gtk-linux-32-release",
+                      "name": "GTK Linux 32-bit Release", "type": "BuildAndNonLayoutTestAndGenerateJSCBundle", "builddir": "gtk-linux-32-release",
                       "platform": "gtk", "configuration": "release", "architectures": ["i386"],
                       "slavenames": ["gtk-linux-slave-1"]
                     },
                     {
-                      "name": "GTK Linux 64-bit Release (Build)", "type": "Build", "builddir": "gtk-linux-64-release",
+                      "name": "GTK Linux 64-bit Release (Build)", "type": "BuildAndGenerateJSCBundle", "builddir": "gtk-linux-64-release",
                       "platform": "gtk", "configuration": "release", "architectures": ["x86_64"],
                       "triggers": ["gtk-linux-64-release-tests", "gtk-linux-64-release-wayland-tests", "gtk-linux-64-release-perf-tests"],
                       "slavenames": ["gtk-linux-slave-2"]

Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/factories.py (231229 => 231230)


--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/factories.py	2018-05-02 11:21:28 UTC (rev 231229)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/factories.py	2018-05-02 12:00:37 UTC (rev 231230)
@@ -46,6 +46,8 @@
 
 
 class BuildFactory(Factory):
+    ShouldRunJSCBundleStep = False
+
     def __init__(self, platform, configuration, architectures, triggers=None, additionalArguments=None, SVNMirror=None):
         Factory.__init__(self, platform, configuration, architectures, True, additionalArguments, SVNMirror)
 
@@ -60,6 +62,8 @@
             if platform.startswith('mac') or platform.startswith('ios-simulator'):
                 self.addStep(ArchiveMinifiedBuiltProduct())
                 self.addStep(UploadMinifiedBuiltProduct())
+            if self.ShouldRunJSCBundleStep:
+                self.addStep(GenerateJSCBundle())
             self.addStep(TransferToS3())
             self.addStep(trigger.Trigger(schedulerNames=triggers))
 
@@ -67,6 +71,7 @@
 class TestFactory(Factory):
     JSCTestClass = RunJavaScriptCoreTests
     LayoutTestClass = RunWebKitTests
+    ShouldRunJSCBundleStep = False
 
     def getProduct(self):
         self.addStep(DownloadBuiltProduct())
@@ -92,6 +97,8 @@
             self.addStep(ArchiveTestResults())
             self.addStep(UploadTestResults())
             self.addStep(ExtractTestResults())
+        if self.ShouldRunJSCBundleStep:
+            self.addStep(GenerateJSCBundle())
         if platform == "gtk":
             self.addStep(RunGtkAPITests())
             self.addStep(RunWebDriverTests())
@@ -151,6 +158,14 @@
     JSCTestClass = None
 
 
+class BuildAndGenerateJSCBundleFactory(BuildFactory):
+    ShouldRunJSCBundleStep = True
+
+
+class BuildAndNonLayoutTestAndGenerateJSCBundleFactory(BuildAndNonLayoutTestFactory):
+    ShouldRunJSCBundleStep = True
+
+
 class TestJSCFactory(Factory):
     def __init__(self, platform, configuration, architectures, additionalArguments=None, SVNMirror=None):
         Factory.__init__(self, platform, configuration, architectures, False, additionalArguments, SVNMirror)

Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/steps.py (231229 => 231230)


--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/steps.py	2018-05-02 11:21:28 UTC (rev 231229)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/steps.py	2018-05-02 12:00:37 UTC (rev 231230)
@@ -260,6 +260,15 @@
                WithProperties("--platform=%(fullPlatform)s"), WithProperties("--%(configuration)s"), "archive", "--minify"]
 
 
+class GenerateJSCBundle(shell.ShellCommand):
+    command = ["python", "./Tools/Scripts/generate-jsc-bundle", "--builder-name", WithProperties("%(buildername)s"),
+               WithProperties("--platform=%(fullPlatform)s"), WithProperties("--%(configuration)s"),
+               WithProperties("--revision=%(got_revision)s"), "--remote-config-file", "../../remote-jsc-bundle-upload-config.json"]
+    name = "generate-jsc-bundle"
+    description = ["generating jsc bundle"]
+    descriptionDone = ["generated jsc bundle"]
+    haltOnFailure = False
+
 class ExtractBuiltProduct(shell.ShellCommand):
     command = ["python", "./Tools/BuildSlaveSupport/built-product-archive",
                WithProperties("--platform=%(fullPlatform)s"), WithProperties("--%(configuration)s"), "extract"]

Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/steps_unittest.py (231229 => 231230)


--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/steps_unittest.py	2018-05-02 11:21:28 UTC (rev 231229)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/steps_unittest.py	2018-05-02 12:00:37 UTC (rev 231230)
@@ -494,10 +494,10 @@
     'JSCOnly Linux AArch64 Release': ['configure build', 'svn', 'delete WebKitBuild directory', 'delete stale build files', 'compile-webkit', 'jscore-test'],
     'JSCOnly Linux MIPS32el Release': ['configure build', 'svn', 'delete WebKitBuild directory', 'delete stale build files', 'compile-webkit', 'jscore-test'],
 
-    'GTK Linux 32-bit Release': ['configure build', 'svn', 'kill old processes', 'delete WebKitBuild directory', 'delete stale build files', 'jhbuild', 'compile-webkit', 'jscore-test', 'webkitpy-test', 'webkitperl-test', 'bindings-generation-tests', 'builtins-generator-tests', 'dashboard-tests', 'API tests', 'webdriver-test'],
+    'GTK Linux 32-bit Release': ['configure build', 'svn', 'kill old processes', 'delete WebKitBuild directory', 'delete stale build files', 'jhbuild', 'compile-webkit', 'jscore-test', 'webkitpy-test', 'webkitperl-test', 'bindings-generation-tests', 'builtins-generator-tests', 'dashboard-tests', 'generate-jsc-bundle', 'API tests', 'webdriver-test'],
     'GTK Linux 64-bit Debug (Build)': ['configure build', 'svn', 'kill old processes', 'delete WebKitBuild directory', 'delete stale build files', 'jhbuild', 'compile-webkit', 'archive-built-product', 'upload', 'transfer-to-s3', 'trigger'],
     'GTK Linux 64-bit Debug (Tests)': ['configure build', 'svn', 'kill old processes', 'delete WebKitBuild directory', 'delete stale build files', 'jhbuild', 'download-built-product', 'extract-built-product', 'jscore-test', 'layout-test', 'webkitpy-test', 'webkitperl-test', 'bindings-generation-tests', 'builtins-generator-tests', 'dashboard-tests', 'archive-test-results', 'upload', 'MasterShellCommand', 'API tests', 'webdriver-test'],
-    'GTK Linux 64-bit Release (Build)': ['configure build', 'svn', 'kill old processes', 'delete WebKitBuild directory', 'delete stale build files', 'jhbuild', 'compile-webkit', 'archive-built-product', 'upload', 'transfer-to-s3', 'trigger'],
+    'GTK Linux 64-bit Release (Build)': ['configure build', 'svn', 'kill old processes', 'delete WebKitBuild directory', 'delete stale build files', 'jhbuild', 'compile-webkit', 'archive-built-product', 'upload', 'generate-jsc-bundle', 'transfer-to-s3', 'trigger'],
     'GTK Linux 64-bit Release (Perf)': ['configure build', 'svn', 'kill old processes', 'delete WebKitBuild directory', 'delete stale build files', 'jhbuild', 'download-built-product', 'extract-built-product', 'perf-test', 'benchmark-test'],
     'GTK Linux 64-bit Release (Tests)': ['configure build', 'svn', 'kill old processes', 'delete WebKitBuild directory', 'delete stale build files', 'jhbuild', 'download-built-product', 'extract-built-product', 'jscore-test', 'layout-test', 'webkitpy-test', 'webkitperl-test', 'bindings-generation-tests', 'builtins-generator-tests', 'dashboard-tests', 'archive-test-results', 'upload', 'MasterShellCommand', 'API tests', 'webdriver-test'],
     'GTK Linux 64-bit Release Wayland (Tests)': ['configure build', 'svn', 'kill old processes', 'delete WebKitBuild directory', 'delete stale build files', 'jhbuild', 'download-built-product', 'extract-built-product', 'jscore-test', 'layout-test', 'webkitpy-test', 'webkitperl-test', 'bindings-generation-tests', 'builtins-generator-tests', 'dashboard-tests', 'archive-test-results', 'upload', 'MasterShellCommand', 'API tests', 'webdriver-test'],

Modified: trunk/Tools/ChangeLog (231229 => 231230)


--- trunk/Tools/ChangeLog	2018-05-02 11:21:28 UTC (rev 231229)
+++ trunk/Tools/ChangeLog	2018-05-02 12:00:37 UTC (rev 231230)
@@ -1,3 +1,52 @@
+2018-05-02  Carlos Alberto Lopez Perez  <[email protected]>
+
+        [GTK] Generate a JSC bundle on the 64 and 32 bit release bots and upload it to webkitgtk.org
+        https://bugs.webkit.org/show_bug.cgi?id=184699
+
+        Reviewed by Gustavo Noronha Silva.
+
+        This adds a new step for the GTK 64-bit release build bot and the
+        GTK 32-bit release build&test bot.
+
+        This step will be run as one of the lasts ones (after the product
+        is built) and will execute the script generate-jsc-bundle.
+        This script will take care of creating a JSC bundle and uploading
+        it to a server defined on a configuration file that has to be
+        deployed on the bots with the required server data and credentials
+        for this upload.
+
+        In this case, the built products should then be accessible at
+        <https://webkitgtk.org/jsc-built-products>. But the implementation
+        is not tied to any specific server. All the details about where
+        to upload the file is done in configuration file that is kept
+        private on each bot outside of the WebKit source tree.
+
+        The script also supports generating a JSC bundle locally and not
+        uploading it anywhere. This is the default mode of running.
+        The remote upload will only be activated if a --remote-config-file
+        parameter is passed (which is done from the buildbot config)
+
+        * BuildSlaveSupport/build.webkit.org-config/config.json:
+        * BuildSlaveSupport/build.webkit.org-config/factories.py:
+        (BuildFactory):
+        (BuildFactory.__init__):
+        (TestFactory):
+        (TestFactory.__init__):
+        (BuildAndGenerateJSCBundleFactory):
+        (BuildAndNonLayoutTestAndGenerateJSCBundleFactory):
+        * BuildSlaveSupport/build.webkit.org-config/steps.py:
+        (GenerateJSCBundle):
+        * BuildSlaveSupport/build.webkit.org-config/steps_unittest.py:
+        * Scripts/generate-jsc-bundle: Added.
+        (ldd_get_libs_and_interpreter):
+        (generate_readme):
+        (generate_wrapper_script):
+        (copy_and_remove_rpath):
+        (createJSCBundle):
+        (sha256sum):
+        (uploadJSCBundle):
+        (main):
+
 2018-05-01  Ryosuke Niwa  <[email protected]>
 
         PSON: Make WebKitTestRunner work with process swap on navigation turned on

Added: trunk/Tools/Scripts/generate-jsc-bundle (0 => 231230)


--- trunk/Tools/Scripts/generate-jsc-bundle	                        (rev 0)
+++ trunk/Tools/Scripts/generate-jsc-bundle	2018-05-02 12:00:37 UTC (rev 231230)
@@ -0,0 +1,244 @@
+#!/usr/bin/env python
+#
+# Copyright (C) 2018 Igalia S.L.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice, this
+#    list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import base64
+import datetime
+import hashlib
+import json
+import optparse
+import os
+import shutil
+import subprocess
+import sys
+import tempfile
+import zipfile
+
+top_level_directory = os.path.normpath(os.path.join(os.path.dirname(__file__), '..', '..'))
+sys.path.insert(0, os.path.join(top_level_directory, 'Tools', 'jhbuild'))
+import jhbuildutils
+
+
+# Ideally we should use something like lddtree or create our own version of that
+# But in practice for jsc bundles there isn't recursive library entries, so we
+# use standard ldd here just to avoid having to require lddtree.
+def ldd_get_libs_and_interpreter(binary):
+    lddCommand = ['ldd', binary]
+    lddProcess = subprocess.Popen(lddCommand, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+    stdout, stderr = lddProcess.communicate()
+    if lddProcess.returncode != 0:
+        raise RuntimeError('The ldd command returned non-zero status')
+    libs = []
+    for line in stdout.splitlines():
+        line = line.strip()
+        if '=>' in line:
+            line = line.split('=>')[1].strip()
+            if 'not found' in line:
+                raise RuntimeError('Some dependencies can not be found with ldd.')
+            line = line.split(' ')[0].strip()
+            if os.path.isfile(line):
+                libs.append(line)
+        else:
+            line = line.split(' ')[0].strip()
+            if os.path.isfile(line):
+                interpreter = line
+    return libs, interpreter
+
+
+def generate_readme(bundleTmpDir, builderName, configuration, platform, revision):
+    print('Generate README.txt file')
+    readmeFile = os.path.join(bundleTmpDir, 'README.txt')
+    with open(readmeFile, 'w') as readmeHandle:
+        readmeHandle.write('JSC bundle details\n')
+        readmeHandle.write(' Builder name: %s\n' % builderName)
+        readmeHandle.write(' Builder date: %s\n' % datetime.datetime.now().isoformat())
+        readmeHandle.write(' Configuration: %s\n' % configuration)
+        readmeHandle.write(' WebKit Platform: %s\n' % platform)
+        readmeHandle.write(' WebKit Revision: %s\n' % revision)
+        readmeHandle.write('\nInstructions: Execute the run-jsc wrapper script.\n')
+    return True
+
+
+def generate_wrapper_script(bundleTmpDir, interpreter):
+    print('Generate wrapper script run-jsc')
+    scriptFile = os.path.join(bundleTmpDir, 'run-jsc')
+    with open(scriptFile, 'w') as scriptHandle:
+        scriptHandle.write('#!/bin/sh\n')
+        scriptHandle.write('MYDIR="$(dirname $(readlink -f $0))"\n')
+        scriptHandle.write('export LD_LIBRARY_PATH="${MYDIR}/lib"\n')
+        scriptHandle.write('exec "${MYDIR}/lib/%s" "${MYDIR}/bin/jsc" $@\n' % os.path.basename(interpreter))
+    os.chmod(scriptFile, 0755)
+
+
+def copy_and_remove_rpath(origFile, destinationDir, type='bin'):
+    if not os.path.isfile(origFile):
+        raise ValueError('Can not find file %s' % origFile)
+    print('Copy to bundle [%s]: %s' % (type, origFile))
+    shutil.copy(origFile, destinationDir)
+    try:
+        patchElfCommand = ['patchelf', '--remove-rpath', os.path.join(destinationDir, os.path.basename(origFile))]
+        if subprocess.call(patchElfCommand) != 0:
+            print('WARNING: The patchelf command returned non-zero status')
+    except OSError as e:
+        if e.errno == os.errno.ENOENT:
+            print('WARNING: patchelf not found. Not modifying rpath')
+        else:
+            raise
+
+
+def createJSCBundle(configuration, revision=None, builderName=None, platform=None):
+    buildDir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', 'WebKitBuild'))
+    binDir = os.path.join(buildDir, configuration.capitalize(), 'bin')
+    libDir = os.path.join(buildDir, configuration.capitalize(), 'lib')
+    jscBinary = os.path.join(binDir, 'jsc')
+    if not os.path.isfile(jscBinary) or not os.access(jscBinary, os.X_OK):
+        raise ValueError('Cannot find jsc at %s' % jscBinary)
+
+    # Define names and paths for the generation of the bundle.
+    bundleTmpDir = os.path.join(buildDir, 'jsc_tmp')
+    bundleTmpLibDir = os.path.join(bundleTmpDir, 'lib')
+    bundleTmpBinDir = os.path.join(bundleTmpDir, 'bin')
+    bundleFileName = 'jsc_' + configuration
+    bundleFileCompressed = os.path.join(buildDir, bundleFileName + '.zip')
+
+    # Clean everything from previous runs
+    if os.path.isdir(bundleTmpDir):
+        shutil.rmtree(bundleTmpDir)
+    if os.path.isfile(bundleFileCompressed):
+        os.remove(bundleFileCompressed)
+
+    # Create bundleTmpDir and put there everything needed.
+    os.makedirs(bundleTmpDir)
+    os.makedirs(bundleTmpLibDir)
+    os.makedirs(bundleTmpBinDir)
+    copy_and_remove_rpath(jscBinary, bundleTmpBinDir, type='bin')
+    libraries, interpreter = ldd_get_libs_and_interpreter(jscBinary)
+    copy_and_remove_rpath(interpreter, bundleTmpLibDir, type='interpreter')
+    for library in libraries:
+        copy_and_remove_rpath(library, bundleTmpLibDir, type='lib')
+    generate_readme(bundleTmpDir, builderName, configuration, platform, revision)
+    generate_wrapper_script(bundleTmpDir, interpreter)
+
+    # jsvu project prefers .zip rather than .tar.xz
+    with zipfile.ZipFile(bundleFileCompressed, 'w', compression=zipfile.ZIP_DEFLATED) as zipHandle:
+        for dirname, subdirs, files in os.walk(bundleTmpDir):
+            for filename in files:
+                systemFilePath = os.path.join(dirname, filename)
+                zipFilePath = systemFilePath.replace(bundleTmpDir, '', 1).lstrip('/')
+                zipHandle.write(systemFilePath, zipFilePath)
+
+    if not os.path.isfile(bundleFileCompressed):
+        raise RuntimeError('Unable to create the file %s' % bundleFileCompressed)
+    return bundleFileCompressed
+
+
+def sha256sum(bundleFilePath):
+    hash = hashlib.sha256()
+    with open(bundleFilePath, 'rb') as f:
+        for chunk in iter(lambda: f.read(4096), b''):
+            hash.update(chunk)
+    return hash.hexdigest()
+
+
+# The expected format for --remote-config-file is something like:
+# {
+# "servername": "webkitgtk.org",
+# "serveraddress": "webkitgtk.intranet-address.local",
+# "serverport": "23",
+# "username": "upload-bot-64",
+# "baseurl": "https://webkitgtk.org/jsc-built-products/x86_64",
+# "sshkey": "output of the priv key in base64. E.g. cat ~/.ssh/id_rsa|base64 -w0"
+# }
+def uploadJSCBundle(bundleFilePath, remoteConfigFile, configuration, revision):
+    remoteData = json.load(open(remoteConfigFile))
+    remoteFileName = str(revision) + '.zip'
+    remoteFileBundlePathName = os.path.join(configuration, remoteFileName)
+    remoteFileHashPathName = os.path.join(configuration, str(revision) + '.sha256sum')
+    with tempfile.NamedTemporaryFile() as sshkeyfile:
+        # In theory NamedTemporaryFile() is already created 0600. But it don't hurts ensuring this again here.
+        os.chmod(sshkeyfile.name, 0600)
+        sshkeyfile.write(base64.b64decode(remoteData['sshkey']))
+        sshkeyfile.flush()
+        # Generate and upload also a sha256 hash
+        with tempfile.NamedTemporaryFile() as hashcheckfile:
+            hashforbundle = sha256sum(bundleFilePath)
+            os.chmod(hashcheckfile.name, 0644)
+            hashcheckfile.write('%s %s\n' % (hashforbundle, remoteFileName))
+            hashcheckfile.flush()
+            with tempfile.NamedTemporaryFile() as uploadinstructionsfile:
+                uploadinstructionsfile.write('progress\n')
+                uploadinstructionsfile.write('put %s %s\n' % (bundleFilePath, remoteFileBundlePathName))
+                uploadinstructionsfile.write('put %s %s\n' % (hashcheckfile.name, remoteFileHashPathName))
+                uploadinstructionsfile.write('quit\n')
+                uploadinstructionsfile.flush()
+                # The idea of this is to ensure scp doesn't ask any question (not even on the first run).
+                # This should be secure enough according to https://www.gremwell.com/ssh-mitm-public-key-authentication
+                sftpCommand = ['sftp',
+                               '-o', 'StrictHostKeyChecking=no',
+                               '-o', 'UserKnownHostsFile=/dev/null',
+                               '-o', 'LogLevel=ERROR',
+                               '-P', remoteData['serverport'],
+                               '-i', sshkeyfile.name,
+                               '-b', uploadinstructionsfile.name,
+                               '%s@%s' % (remoteData['username'], remoteData['serveraddress'])]
+                print('Uploading bundle to %s as %s with sha256 hash %s' % (remoteData['servername'], remoteFileBundlePathName, hashforbundle))
+                if subprocess.call(sftpCommand) != 0:
+                    raise RuntimeError('The sftp command returned non-zero status')
+
+    print('Done: archive sucesfully uploaded to %s/%s' % (remoteData['baseurl'], remoteFileBundlePathName))
+    return 0
+
+
+def main():
+    parser = optparse.OptionParser('usage: %prog [options]')
+    parser.add_option('--platform', dest='platform')
+    parser.add_option('--debug', action='', const='debug', dest='configuration')
+    parser.add_option('--release', action='', const='release', dest='configuration')
+    parser.add_option('--revision', action='', type='string', dest='revision')
+    parser.add_option('--builder-name', action='', type='string', dest='buildername')
+    parser.add_option('--remote-config-file', action='',  type='string', dest='remoteConfigFile')
+    options, args = parser.parse_args()
+
+    if not options.platform:
+        parser.error('Platform is required')
+        return 1
+    if not options.configuration:
+        parser.error('Configuration is required')
+        return 1
+
+    platform = options.platform.lower()
+    configuration = options.configuration.lower()
+    if platform == 'gtk':
+        jhbuildutils.enter_jhbuild_environment_if_available(platform)
+    else:
+        raise NotImplementedError('Unsupported platform')
+
+    bundleFilePath = createJSCBundle(configuration, options.revision, options.buildername, platform)
+    print('Bundle file created at: %s' % bundleFilePath)
+    if options.remoteConfigFile is not None and os.path.isfile(options.remoteConfigFile):
+        return uploadJSCBundle(bundleFilePath, options.remoteConfigFile, options.configuration, options.revision)
+    return 0
+
+
+if __name__ == '__main__':
+    sys.exit(main())
Property changes on: trunk/Tools/Scripts/generate-jsc-bundle
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to