mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 09:43:57 +00:00
73d1ccb2af
The dart-archive bucket default ACL has been changed to make all uploaded objects public. Therefore, we no longer need to specify an ACL on upload. This change enables the scripts to work with uniform bucket ACLs. The bucket cannot be switched to uniform ACLs until this change reaches the stable branch or it won't be possible to release Dart. This change removes the uses of the gsutil -a public-read option from the release scripts. Change-Id: I27a76b9849771ddc380576ffe962926ebfbf4fc6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221341 Commit-Queue: Jonas Termansen <sortie@google.com> Reviewed-by: Alexander Thomas <athom@google.com>
49 lines
1.8 KiB
Python
Executable file
49 lines
1.8 KiB
Python
Executable file
#!/usr/bin/env python3
|
|
|
|
# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
|
|
# for details. All rights reserved. Use of this source code is governed by a
|
|
# BSD-style license that can be found in the LICENSE file.
|
|
|
|
import os
|
|
import sys
|
|
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'bots'))
|
|
import bot_utils
|
|
|
|
utils = bot_utils.GetUtils()
|
|
|
|
HOST_OS = utils.GuessOS()
|
|
|
|
|
|
def ArchiveArtifacts(tarfile, builddir, channel):
|
|
namer = bot_utils.GCSNamer(channel=channel)
|
|
gsutil = bot_utils.GSUtil()
|
|
revision = utils.GetArchiveVersion()
|
|
# Archive the src tar to the src dir
|
|
remote_tarfile = '/'.join(
|
|
[namer.src_directory(revision),
|
|
os.path.basename(tarfile)])
|
|
gsutil.upload(tarfile, remote_tarfile)
|
|
# Archive all files except the tar file to the linux packages dir
|
|
for entry in os.listdir(builddir):
|
|
full_path = os.path.join(builddir, entry)
|
|
# We expect a flat structure, not subdirectories
|
|
assert (os.path.isfile(full_path))
|
|
if full_path != tarfile:
|
|
package_dir = namer.linux_packages_directory(revision)
|
|
remote_file = '/'.join([package_dir, os.path.basename(entry)])
|
|
gsutil.upload(full_path, remote_file)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
bot_name = os.environ.get('BUILDBOT_BUILDERNAME')
|
|
channel = bot_utils.GetChannelFromName(bot_name)
|
|
if channel not in (bot_utils.Channel.BLEEDING_EDGE, bot_utils.Channel.TRY):
|
|
builddir = os.path.join(bot_utils.DART_DIR, utils.GetBuildDir(HOST_OS),
|
|
'src_and_installation')
|
|
version = utils.GetVersion()
|
|
tarfilename = 'dart-%s.tar.gz' % version
|
|
tarfile = os.path.join(builddir, tarfilename)
|
|
ArchiveArtifacts(tarfile, builddir, channel)
|
|
else:
|
|
print('Not uploading artifacts on bleeding edge')
|