Exemple #1
0
def upload_electron(github, release, file_path, args):

  # if upload_to_s3 is set, skip github upload.
  if args.upload_to_s3:
    bucket, access_key, secret_key = s3_config()
    key_prefix = 'electron-artifacts/{0}_{1}'.format(release['tag_name'],
                                                     args.upload_timestamp)
    s3put(bucket, access_key, secret_key, os.path.dirname(file_path),
          key_prefix, [file_path])
    upload_sha256_checksum(release['tag_name'], file_path, key_prefix)
    return

  # Delete the original file before uploading in CI.
  filename = os.path.basename(file_path)
  if os.environ.has_key('CI'):
    try:
      for asset in release['assets']:
        if asset['name'] == filename:
          github.repos(ELECTRON_REPO).releases.assets(asset['id']).delete()
    except Exception:
      pass

  # Upload the file.
  upload_io_to_github(release, filename, file_path)

  # Upload the checksum file.
  upload_sha256_checksum(release['tag_name'], file_path)
Exemple #2
0
def upload_electron(release, file_path, args):
    filename = os.path.basename(file_path)

    # Strip zip non determinism before upload, in-place operation
    try:
        zero_zip_date_time(file_path)
    except NonZipFileError:
        pass

    # if upload_to_s3 is set, skip github upload.
    if args.upload_to_s3:
        bucket, access_key, secret_key = s3_config()
        key_prefix = 'electron-artifacts/{0}_{1}'.format(
            args.version, args.upload_timestamp)
        s3put(bucket, access_key, secret_key, os.path.dirname(file_path),
              key_prefix, [file_path])
        upload_sha256_checksum(args.version, file_path, key_prefix)
        s3url = 'https://gh-contractor-zcbenz.s3.amazonaws.com'
        print('{0} uploaded to {1}/{2}/{0}'.format(filename, s3url,
                                                   key_prefix))
        return

    # Upload the file.
    upload_io_to_github(release, filename, file_path, args.version)

    # Upload the checksum file.
    upload_sha256_checksum(args.version, file_path)
Exemple #3
0
def upload_electron(github, release, file_path, upload_to_s3):

  # if upload_to_s3 is set, skip github upload.
  if upload_to_s3:
    bucket, access_key, secret_key = s3_config()
    key_prefix = 'electron-artifacts/{0}'.format(release['tag_name'])
    s3put(bucket, access_key, secret_key, os.path.dirname(file_path),
          key_prefix, [file_path])
    upload_sha256_checksum(release['tag_name'], file_path, key_prefix)
    return

  # Delete the original file before uploading in CI.
  filename = os.path.basename(file_path)
  if os.environ.has_key('CI'):
    try:
      for asset in release['assets']:
        if asset['name'] == filename:
          github.repos(ELECTRON_REPO).releases.assets(asset['id']).delete()
    except Exception:
      pass

  # Upload the file.
  upload_io_to_github(release, filename, file_path)

  # Upload the checksum file.
  upload_sha256_checksum(release['tag_name'], file_path)

  # Upload ARM assets without the v7l suffix for backwards compatibility
  # TODO Remove for 2.0
  if 'armv7l' in filename:
    arm_filename = filename.replace('armv7l', 'arm')
    arm_file_path = os.path.join(os.path.dirname(file_path), arm_filename)
    shutil.copy2(file_path, arm_file_path)
    upload_electron(github, release, arm_file_path, upload_to_s3)
def upload_electron(github, release, file_path, args):

    # if upload_to_s3 is set, skip github upload.
    if args.upload_to_s3:
        bucket, access_key, secret_key = s3_config()
        key_prefix = 'electron-artifacts/{0}_{1}'.format(
            release['tag_name'], args.upload_timestamp)
        s3put(bucket, access_key, secret_key, os.path.dirname(file_path),
              key_prefix, [file_path])
        upload_sha256_checksum(release['tag_name'], file_path, key_prefix)
        return

    # Delete the original file before uploading in CI.
    filename = os.path.basename(file_path)
    if os.environ.has_key('CI'):
        try:
            for asset in release['assets']:
                if asset['name'] == filename:
                    github.repos(ELECTRON_REPO).releases.assets(
                        asset['id']).delete()
        except Exception:
            pass

    # Upload the file.
    upload_io_to_github(release, filename, file_path)

    # Upload the checksum file.
    upload_sha256_checksum(release['tag_name'], file_path)
Exemple #5
0
def upload_electron(github, release, file_path, upload_to_s3):

    # if upload_to_s3 is set, skip github upload.
    if upload_to_s3:
        bucket, access_key, secret_key = s3_config()
        key_prefix = 'electron-artifacts/{0}'.format(release['tag_name'])
        s3put(bucket, access_key, secret_key, os.path.dirname(file_path),
              key_prefix, [file_path])
        upload_sha256_checksum(release['tag_name'], file_path, key_prefix)
        return

    # Delete the original file before uploading in CI.
    filename = os.path.basename(file_path)
    if os.environ.has_key('CI'):
        try:
            for asset in release['assets']:
                if asset['name'] == filename:
                    github.repos(ELECTRON_REPO).releases.assets(
                        asset['id']).delete()
        except Exception:
            pass

    # Upload the file.
    upload_io_to_github(release, filename, file_path)

    # Upload the checksum file.
    upload_sha256_checksum(release['tag_name'], file_path)

    # Upload ARM assets without the v7l suffix for backwards compatibility
    # TODO Remove for 2.0
    if 'armv7l' in filename:
        arm_filename = filename.replace('armv7l', 'arm')
        arm_file_path = os.path.join(os.path.dirname(file_path), arm_filename)
        shutil.copy2(file_path, arm_file_path)
        upload_electron(github, release, arm_file_path, upload_to_s3)
Exemple #6
0
def upload_sha256_checksum(version, file_path):
  bucket, access_key, secret_key = s3_config()
  checksum_path = '{}.sha256sum'.format(file_path)
  sha256 = hashlib.sha256()
  with open(file_path, 'rb') as f:
    sha256.update(f.read())

  filename = os.path.basename(file_path)
  with open(checksum_path, 'w') as checksum:
    checksum.write('{} *{}'.format(sha256.hexdigest(), filename))
  s3put(bucket, access_key, secret_key, os.path.dirname(checksum_path),
        'atom-shell/tmp/{0}'.format(version), [checksum_path])
Exemple #7
0
def upload_sha256_checksum(version, file_path):
    bucket, access_key, secret_key = s3_config()
    checksum_path = '{}.sha256sum'.format(file_path)
    sha256 = hashlib.sha256()
    with open(file_path, 'rb') as f:
        sha256.update(f.read())

    filename = os.path.basename(file_path)
    with open(checksum_path, 'w') as checksum:
        checksum.write('{} *{}'.format(sha256.hexdigest(), filename))
    s3put(bucket, access_key, secret_key, os.path.dirname(checksum_path),
          'atom-shell/tmp/{0}'.format(version), [checksum_path])
def upload_node(bucket, access_key, secret_key, version):
  with scoped_cwd(DIST_DIR):
    s3put(bucket, access_key, secret_key, DIST_DIR,
          'atom-shell/dist/{0}'.format(version), glob.glob('node-*.tar.gz'))

  if TARGET_PLATFORM == 'win32':
    # Copy atom.lib to node.lib
    node_lib = os.path.join(OUT_DIR, 'node.lib')
    atom_lib = os.path.join(OUT_DIR, 'node.dll.lib')
    shutil.copy2(atom_lib, node_lib)

    # Upload the 32bit node.lib.
    s3put(bucket, access_key, secret_key, OUT_DIR,
          'atom-shell/dist/{0}'.format(version), [node_lib])

    # Upload the fake 64bit node.lib.
    touch_x64_node_lib()
    node_lib = os.path.join(OUT_DIR, 'x64', 'node.lib')
    s3put(bucket, access_key, secret_key, OUT_DIR,
          'atom-shell/dist/{0}'.format(version), [node_lib])

    # Upload the index.json
    with scoped_cwd(SOURCE_ROOT):
      atom_shell = os.path.join(OUT_DIR, 'atom.exe')
      index_json = os.path.relpath(os.path.join(OUT_DIR, 'index.json'))
      execute([atom_shell,
               os.path.join('script', 'dump-version-info.js'),
               index_json])
      s3put(bucket, access_key, secret_key, OUT_DIR, 'atom-shell/dist',
            [index_json])
def main():
  # Upload the index.json.
  with scoped_cwd(SOURCE_ROOT):
    atom_shell = os.path.join(OUT_DIR, 'atom')
    if PLATFORM == 'win32':
      atom_shell += '.exe'
    index_json = os.path.relpath(os.path.join(OUT_DIR, 'index.json'))
    execute([atom_shell,
             os.path.join('tools', 'dump-version-info.js'),
             index_json])

    bucket, access_key, secret_key = s3_config()
    s3put(bucket, access_key, secret_key, OUT_DIR, 'atom-shell/dist',
          [index_json])
def main():
    # Upload the index.json.
    with scoped_cwd(SOURCE_ROOT):
        if sys.platform == "darwin":
            atom_shell = os.path.join(OUT_DIR, "{0}.app".format(PRODUCT_NAME), "Contents", "MacOS", PRODUCT_NAME)
        elif sys.platform == "win32":
            atom_shell = os.path.join(OUT_DIR, "{0}.exe".format(PROJECT_NAME))
        else:
            atom_shell = os.path.join(OUT_DIR, PROJECT_NAME)
        index_json = os.path.relpath(os.path.join(OUT_DIR, "index.json"))
        execute([atom_shell, os.path.join("tools", "dump-version-info.js"), index_json])

        bucket, access_key, secret_key = s3_config()
        s3put(bucket, access_key, secret_key, OUT_DIR, "atom-shell/dist", [index_json])
Exemple #11
0
def upload_node(bucket, access_key, secret_key, version):
    with scoped_cwd(dist_dir()):
        s3put(bucket, access_key, secret_key,
              dist_dir(), 'atom-shell/dist/{0}'.format(version),
              glob.glob('node-*.tar.gz'))
        s3put(bucket, access_key, secret_key,
              dist_dir(), 'atom-shell/dist/{0}'.format(version),
              glob.glob('iojs-*.tar.gz'))

    if PLATFORM == 'win32':
        if get_target_arch() != 'x64':
            node_lib = os.path.join(dist_dir(), 'node.lib')
            iojs_lib = os.path.join(dist_dir(), 'win-x86', 'iojs.lib')
        else:
            node_lib = os.path.join(dist_dir(), 'x64', 'node.lib')
            iojs_lib = os.path.join(dist_dir(), 'win-x64', 'iojs.lib')
        safe_mkdir(os.path.dirname(node_lib))
        safe_mkdir(os.path.dirname(iojs_lib))

        # Copy atom.lib to node.lib and iojs.lib.
        atom_lib = os.path.join(output_dir(), 'node_import.lib')
        shutil.copy2(atom_lib, node_lib)
        shutil.copy2(atom_lib, iojs_lib)

        # Upload the node.lib.
        s3put(bucket, access_key, secret_key, dist_dir(),
              'atom-shell/dist/{0}'.format(version), [node_lib])

        # Upload the iojs.lib.
        s3put(bucket, access_key, secret_key, dist_dir(),
              'atom-shell/dist/{0}'.format(version), [iojs_lib])
Exemple #12
0
def upload_node(bucket, access_key, secret_key, version):
  os.chdir(DIST_DIR)

  s3put(bucket, access_key, secret_key, DIST_DIR,
        'atom-shell/dist/{0}'.format(version), glob.glob('node-*.tar.gz'))

  if TARGET_PLATFORM == 'win32':
    # Generate the node.lib.
    build = os.path.join(SOURCE_ROOT, 'script', 'build.py')
    execute([sys.executable, build, '-c', 'Release', '-t', 'generate_node_lib'])

    # Upload the 32bit node.lib.
    node_lib = os.path.join(OUT_DIR, 'node.lib')
    s3put(bucket, access_key, secret_key, OUT_DIR,
          'atom-shell/dist/{0}'.format(version), [node_lib])

    # Upload the fake 64bit node.lib.
    touch_x64_node_lib()
    node_lib = os.path.join(OUT_DIR, 'x64', 'node.lib')
    s3put(bucket, access_key, secret_key, OUT_DIR,
          'atom-shell/dist/{0}'.format(version), [node_lib])

    # Upload the index.json
    atom_shell = os.path.join(OUT_DIR, 'atom.exe')
    index_json = os.path.join(OUT_DIR, 'index.json')
    execute([atom_shell,
             os.path.join(SOURCE_ROOT, 'script', 'dump-version-info.js'),
             index_json])
    s3put(bucket, access_key, secret_key, OUT_DIR, 'atom-shell/dist',
          [index_json])
def upload_node(bucket, access_key, secret_key, version):
  with scoped_cwd(DIST_DIR):
    s3put(bucket, access_key, secret_key, DIST_DIR,
          'atom-shell/dist/{0}'.format(version), glob.glob('node-*.tar.gz'))
    s3put(bucket, access_key, secret_key, DIST_DIR,
          'atom-shell/dist/{0}'.format(version), glob.glob('iojs-*.tar.gz'))

  if PLATFORM == 'win32':
    if get_target_arch() == 'ia32':
      node_lib = os.path.join(DIST_DIR, 'node.lib')
      iojs_lib = os.path.join(DIST_DIR, 'win-x86', 'iojs.lib')
    else:
      node_lib = os.path.join(DIST_DIR, 'x64', 'node.lib')
      iojs_lib = os.path.join(DIST_DIR, 'win-x64', 'iojs.lib')
    safe_mkdir(os.path.dirname(node_lib))
    safe_mkdir(os.path.dirname(iojs_lib))

    # Copy atom.lib to node.lib and iojs.lib.
    atom_lib = os.path.join(OUT_DIR, 'node.dll.lib')
    shutil.copy2(atom_lib, node_lib)
    shutil.copy2(atom_lib, iojs_lib)

    # Upload the node.lib.
    s3put(bucket, access_key, secret_key, DIST_DIR,
          'atom-shell/dist/{0}'.format(version), [node_lib])

    # Upload the iojs.lib.
    s3put(bucket, access_key, secret_key, DIST_DIR,
          'atom-shell/dist/{0}'.format(version), [iojs_lib])
Exemple #14
0
def main():
    args = parse_args()

    url = DIST_URL + args.version + "/"
    directory, files = download_files(url, get_files_list(args.version))
    checksums = [
        create_checksum("sha1", directory, "SHASUMS.txt", files),
        create_checksum("sha256", directory, "SHASUMS256.txt", files),
    ]

    bucket, access_key, secret_key = s3_config()
    s3put(bucket, access_key, secret_key, directory, "atom-shell/dist/{0}".format(args.version), checksums)

    rm_rf(directory)
Exemple #15
0
def upload_node(bucket, access_key, secret_key, version):
    with scoped_cwd(DIST_DIR):
        s3put(bucket, access_key, secret_key,
              DIST_DIR, 'atom-shell/dist/{0}'.format(version),
              glob.glob('node-*.tar.gz'))

    if TARGET_PLATFORM == 'win32':
        # Copy atom.lib to node.lib
        node_lib = os.path.join(OUT_DIR, 'node.lib')
        atom_lib = os.path.join(OUT_DIR, 'node.dll.lib')
        shutil.copy2(atom_lib, node_lib)

        # Upload the 32bit node.lib.
        s3put(bucket, access_key, secret_key, OUT_DIR,
              'atom-shell/dist/{0}'.format(version), [node_lib])

        # Upload the fake 64bit node.lib.
        touch_x64_node_lib()
        node_lib = os.path.join(OUT_DIR, 'x64', 'node.lib')
        s3put(bucket, access_key, secret_key, OUT_DIR,
              'atom-shell/dist/{0}'.format(version), [node_lib])

        # Upload the index.json
        with scoped_cwd(SOURCE_ROOT):
            atom_shell = os.path.join(OUT_DIR, 'atom.exe')
            index_json = os.path.relpath(os.path.join(OUT_DIR, 'index.json'))
            execute([
                atom_shell,
                os.path.join('script', 'dump-version-info.js'), index_json
            ])
            s3put(bucket, access_key, secret_key, OUT_DIR, 'atom-shell/dist',
                  [index_json])
def upload_node(bucket, access_key, secret_key, version):
  with scoped_cwd(DIST_DIR):
    s3put(bucket, access_key, secret_key, DIST_DIR,
          'atom-shell/dist/{0}'.format(version), glob.glob('node-*.tar.gz'))

  if TARGET_PLATFORM == 'win32':
    # Generate the node.lib.
    build = os.path.join(SOURCE_ROOT, 'script', 'build.py')
    execute([sys.executable, build, '-c', 'Release', '-t', 'generate_node_lib'])

    # Upload the 32bit node.lib.
    node_lib = os.path.join(OUT_DIR, 'node.lib')
    s3put(bucket, access_key, secret_key, OUT_DIR,
          'atom-shell/dist/{0}'.format(version), [node_lib])

    # Upload the fake 64bit node.lib.
    touch_x64_node_lib()
    node_lib = os.path.join(OUT_DIR, 'x64', 'node.lib')
    s3put(bucket, access_key, secret_key, OUT_DIR,
          'atom-shell/dist/{0}'.format(version), [node_lib])

    # Upload the index.json
    with scoped_cwd(SOURCE_ROOT):
      atom_shell = os.path.join(OUT_DIR, 'atom.exe')
      index_json = os.path.relpath(os.path.join(OUT_DIR, 'index.json'))
      execute([atom_shell,
               os.path.join('script', 'dump-version-info.js'),
               index_json])
      s3put(bucket, access_key, secret_key, OUT_DIR, 'atom-shell/dist',
            [index_json])
def main():
    args = parse_args()

    url = DIST_URL + args.version + '/'
    directory, files = download_files(url, get_files_list(args.version))
    checksums = [
        create_checksum('sha1', directory, 'SHASUMS.txt', files),
        create_checksum('sha256', directory, 'SHASUMS256.txt', files)
    ]

    bucket, access_key, secret_key = s3_config()
    s3put(bucket, access_key, secret_key, directory,
          'atom-shell/dist/{0}'.format(args.version), checksums)

    rm_rf(directory)
def main():
    # Upload the index.json.
    with scoped_cwd(SOURCE_ROOT):
        atom_shell = os.path.join(OUT_DIR, 'atom')
        if PLATFORM == 'win32':
            atom_shell += '.exe'
        index_json = os.path.relpath(os.path.join(OUT_DIR, 'index.json'))
        execute([
            atom_shell,
            os.path.join('tools', 'dump-version-info.js'), index_json
        ])

        bucket, access_key, secret_key = s3_config()
        s3put(bucket, access_key, secret_key, OUT_DIR, 'atom-shell/dist',
              [index_json])
Exemple #19
0
def upload_node(bucket, access_key, secret_key, version):
    with scoped_cwd(GEN_DIR):
        generated_tar = os.path.join(GEN_DIR, 'node_headers.tar.gz')
        for header_tar in HEADER_TAR_NAMES:
            versioned_header_tar = header_tar.format(version)
            shutil.copy2(generated_tar,
                         os.path.join(GEN_DIR, versioned_header_tar))

        s3put(bucket, access_key, secret_key,
              GEN_DIR, 'atom-shell/dist/{0}'.format(version),
              glob.glob('node-*.tar.gz'))
        s3put(bucket, access_key, secret_key,
              GEN_DIR, 'atom-shell/dist/{0}'.format(version),
              glob.glob('iojs-*.tar.gz'))

    if PLATFORM == 'win32':
        if get_target_arch() == 'ia32':
            node_lib = os.path.join(DIST_DIR, 'node.lib')
            iojs_lib = os.path.join(DIST_DIR, 'win-x86', 'iojs.lib')
            v4_node_lib = os.path.join(DIST_DIR, 'win-x86', 'node.lib')
        elif get_target_arch() == 'arm64':
            node_lib = os.path.join(DIST_DIR, 'arm64', 'node.lib')
            iojs_lib = os.path.join(DIST_DIR, 'win-arm64', 'iojs.lib')
            v4_node_lib = os.path.join(DIST_DIR, 'win-arm64', 'node.lib')
        else:
            node_lib = os.path.join(DIST_DIR, 'x64', 'node.lib')
            iojs_lib = os.path.join(DIST_DIR, 'win-x64', 'iojs.lib')
            v4_node_lib = os.path.join(DIST_DIR, 'win-x64', 'node.lib')
        safe_mkdir(os.path.dirname(node_lib))
        safe_mkdir(os.path.dirname(iojs_lib))

        # Copy electron.lib to node.lib and iojs.lib.
        electron_lib = os.path.join(OUT_DIR, 'electron.lib')
        shutil.copy2(electron_lib, node_lib)
        shutil.copy2(electron_lib, iojs_lib)
        shutil.copy2(electron_lib, v4_node_lib)

        # Upload the node.lib.
        s3put(bucket, access_key, secret_key, DIST_DIR,
              'atom-shell/dist/{0}'.format(version), [node_lib])

        # Upload the iojs.lib.
        s3put(bucket, access_key, secret_key, DIST_DIR,
              'atom-shell/dist/{0}'.format(version), [iojs_lib])

        # Upload the v4 node.lib.
        s3put(bucket, access_key, secret_key, DIST_DIR,
              'atom-shell/dist/{0}'.format(version), [v4_node_lib])
Exemple #20
0
def main():
  if not authToken or authToken == "":
    raise Exception("Please set META_DUMPER_AUTH_HEADER")
  # Upload the index.json.
  with scoped_cwd(SOURCE_ROOT):
    safe_mkdir(OUT_DIR)
    index_json = os.path.relpath(os.path.join(OUT_DIR, 'index.json'))

    new_content = get_content()

    with open(index_json, "w") as f:
      f.write(new_content)

    bucket, access_key, secret_key = s3_config()
    s3put(bucket, access_key, secret_key, OUT_DIR, 'atom-shell/dist',
          [index_json])
Exemple #21
0
def main():
    if not authToken or authToken == "":
        raise Exception("Please set META_DUMPER_AUTH_HEADER")
    # Upload the index.json.
    with scoped_cwd(ELECTRON_DIR):
        safe_mkdir(OUT_DIR)
        index_json = os.path.relpath(os.path.join(OUT_DIR, 'index.json'))

        new_content = get_content()

        with open(index_json, "w") as f:
            f.write(new_content)

        bucket, access_key, secret_key = s3_config()
        s3put(bucket, access_key, secret_key, OUT_DIR, 'atom-shell/dist',
              [index_json])
def main():
  # Upload the index.json.
  with scoped_cwd(SOURCE_ROOT):
    if sys.platform == 'darwin':
      atom_shell = os.path.join(OUT_DIR, '{0}.app'.format(PRODUCT_NAME),
                                'Contents', 'MacOS', PRODUCT_NAME)
    elif sys.platform == 'win32':
      atom_shell = os.path.join(OUT_DIR, '{0}.exe'.format(PROJECT_NAME))
    else:
      atom_shell = os.path.join(OUT_DIR, PROJECT_NAME)
    index_json = os.path.relpath(os.path.join(OUT_DIR, 'index.json'))
    execute([atom_shell,
             os.path.join('tools', 'dump-version-info.js'),
             index_json])

    bucket, access_key, secret_key = s3_config()
    s3put(bucket, access_key, secret_key, OUT_DIR, 'atom-shell/dist',
          [index_json])
Exemple #23
0
def main():
    if not authToken or authToken == "":
        raise Exception("Please set META_DUMPER_AUTH_HEADER")
    # Upload the index.json.
    with scoped_cwd(SOURCE_ROOT):
        safe_mkdir(OUT_DIR)
        index_json = os.path.relpath(os.path.join(OUT_DIR, 'index.json'))

        request = urllib2.Request(BASE_URL + version,
                                  headers={"Authorization": authToken})

        new_content = urllib2.urlopen(request).read()

        with open(index_json, "w") as f:
            f.write(new_content)

        bucket, access_key, secret_key = s3_config()
        s3put(bucket, access_key, secret_key, OUT_DIR, 'atom-shell/dist',
              [index_json])
Exemple #24
0
def upload_node(bucket, access_key, secret_key, version):
  with scoped_cwd(DIST_DIR):
    s3put(bucket, access_key, secret_key, DIST_DIR,
          'atom-shell/dist/{0}'.format(version), glob.glob('node-*.tar.gz'))

  if PLATFORM == 'win32':
    if get_target_arch() == 'ia32':
      node_lib = os.path.join(DIST_DIR, 'node.lib')
    else:
      node_lib = os.path.join(DIST_DIR, 'x64', 'node.lib')
      safe_mkdir(os.path.dirname(node_lib))

    # Copy atom.lib to node.lib
    atom_lib = os.path.join(OUT_DIR, 'node.dll.lib')
    shutil.copy2(atom_lib, node_lib)

    # Upload the node.lib.
    s3put(bucket, access_key, secret_key, DIST_DIR,
          'atom-shell/dist/{0}'.format(version), [node_lib])
Exemple #25
0
def upload_electron(release, file_path, args):
    filename = os.path.basename(file_path)

    # if upload_to_s3 is set, skip github upload.
    if args.upload_to_s3:
        bucket, access_key, secret_key = s3_config()
        key_prefix = 'electron-artifacts/{0}_{1}'.format(
            args.version, args.upload_timestamp)
        s3put(bucket, access_key, secret_key, os.path.dirname(file_path),
              key_prefix, [file_path])
        upload_sha256_checksum(args.version, file_path, key_prefix)
        s3url = 'https://gh-contractor-zcbenz.s3.amazonaws.com'
        print '{0} uploaded to {1}/{2}/{0}'.format(filename, s3url, key_prefix)
        return

    # Upload the file.
    upload_io_to_github(release, filename, file_path, args.version)

    # Upload the checksum file.
    upload_sha256_checksum(args.version, file_path)
Exemple #26
0
def upload_electron(release, file_path, args):
  filename = os.path.basename(file_path)

  # if upload_to_s3 is set, skip github upload.
  if args.upload_to_s3:
    bucket, access_key, secret_key = s3_config()
    key_prefix = 'electron-artifacts/{0}_{1}'.format(args.version,
                                                     args.upload_timestamp)
    s3put(bucket, access_key, secret_key, os.path.dirname(file_path),
          key_prefix, [file_path])
    upload_sha256_checksum(args.version, file_path, key_prefix)
    s3url = 'https://gh-contractor-zcbenz.s3.amazonaws.com'
    print '{0} uploaded to {1}/{2}/{0}'.format(filename, s3url, key_prefix)
    return

  # Upload the file.
  upload_io_to_github(release, filename, file_path, args.version)

  # Upload the checksum file.
  upload_sha256_checksum(args.version, file_path)
def upload_node(bucket, access_key, secret_key, version):
  with scoped_cwd(GEN_DIR):
    generated_tar = os.path.join(GEN_DIR, 'node_headers.tar.gz')
    for header_tar in HEADER_TAR_NAMES:
      versioned_header_tar = header_tar.format(version)
      shutil.copy2(generated_tar, os.path.join(GEN_DIR, versioned_header_tar))

    s3put(bucket, access_key, secret_key, GEN_DIR,
          'atom-shell/dist/{0}'.format(version), glob.glob('node-*.tar.gz'))
    s3put(bucket, access_key, secret_key, GEN_DIR,
          'atom-shell/dist/{0}'.format(version), glob.glob('iojs-*.tar.gz'))

  if PLATFORM == 'win32':
    if get_target_arch() == 'ia32':
      node_lib = os.path.join(DIST_DIR, 'node.lib')
      iojs_lib = os.path.join(DIST_DIR, 'win-x86', 'iojs.lib')
      v4_node_lib = os.path.join(DIST_DIR, 'win-x86', 'node.lib')
    else:
      node_lib = os.path.join(DIST_DIR, 'x64', 'node.lib')
      iojs_lib = os.path.join(DIST_DIR, 'win-x64', 'iojs.lib')
      v4_node_lib = os.path.join(DIST_DIR, 'win-x64', 'node.lib')
    safe_mkdir(os.path.dirname(node_lib))
    safe_mkdir(os.path.dirname(iojs_lib))

    # Copy electron.lib to node.lib and iojs.lib.
    electron_lib = os.path.join(OUT_DIR, 'electron.lib')
    shutil.copy2(electron_lib, node_lib)
    shutil.copy2(electron_lib, iojs_lib)
    shutil.copy2(electron_lib, v4_node_lib)

    # Upload the node.lib.
    s3put(bucket, access_key, secret_key, DIST_DIR,
          'atom-shell/dist/{0}'.format(version), [node_lib])

    # Upload the iojs.lib.
    s3put(bucket, access_key, secret_key, DIST_DIR,
          'atom-shell/dist/{0}'.format(version), [iojs_lib])

    # Upload the v4 node.lib.
    s3put(bucket, access_key, secret_key, DIST_DIR,
          'atom-shell/dist/{0}'.format(version), [v4_node_lib])
def main():
    args = parse_args()
    dist_url = args.dist_url
    if dist_url[-1] != "/":
        dist_url += "/"

    url = dist_url + args.version + '/'
    directory, files = download_files(url, get_files_list(args.version))
    checksums = [
        create_checksum('sha1', directory, 'SHASUMS.txt', files),
        create_checksum('sha256', directory, 'SHASUMS256.txt', files)
    ]

    if args.target_dir is None:
        bucket, access_key, secret_key = s3_config()
        s3put(bucket, access_key, secret_key, directory,
              'atom-shell/dist/{0}'.format(args.version), checksums)
    else:
        copy_files(checksums, args.target_dir)

    rm_rf(directory)
def main():
  args = parse_args()
  dist_url = args.dist_url
  if dist_url[-1] != "/":
    dist_url += "/"

  url = dist_url + args.version + '/'
  directory, files = download_files(url, get_files_list(args.version))
  checksums = [
    create_checksum('sha1', directory, 'SHASUMS.txt', files),
    create_checksum('sha256', directory, 'SHASUMS256.txt', files)
  ]

  if args.target_dir is None:
    bucket, access_key, secret_key = s3_config()
    s3put(bucket, access_key, secret_key, directory,
          'atom-shell/dist/{0}'.format(args.version), checksums)
  else:
    copy_files(checksums, args.target_dir)

  rm_rf(directory)
Exemple #30
0
def upload_node(bucket, access_key, secret_key, version):
  os.chdir(DIST_DIR)

  s3put(bucket, access_key, secret_key, DIST_DIR,
        'atom-shell/dist/{0}'.format(version), glob.glob('node-*.tar.gz'))

  if TARGET_PLATFORM == 'win32':
    # Generate the node.lib.
    build = os.path.join(SOURCE_ROOT, 'script', 'build.py')
    execute([sys.executable, build, '-c', 'Release', '-t', 'generate_node_lib'])

    # Upload the 32bit node.lib.
    node_lib = os.path.join(OUT_DIR, 'node.lib')
    s3put(bucket, access_key, secret_key, OUT_DIR,
          'atom-shell/dist/{0}'.format(version), [node_lib])

    # Upload the fake 64bit node.lib.
    touch_x64_node_lib()
    node_lib = os.path.join(OUT_DIR, 'x64', 'node.lib')
    s3put(bucket, access_key, secret_key, OUT_DIR,
          'atom-shell/dist/{0}'.format(version), [node_lib])
Exemple #31
0
def upload_symbols(bucket, access_key, secret_key, files):
    s3put(bucket, access_key, secret_key, SYMBOLS_DIR, 'atom-shell/symbols',
          files)
Exemple #32
0
def upload_symbols(bucket, access_key, secret_key, files):
  s3put(bucket, access_key, secret_key, SYMBOLS_DIR, 'atom-shell/symbols',
        files)