[infra] Rely on the default ACL when uploading release artifacts.
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>
This commit is contained in:
committed by
commit-bot@chromium.org
parent
ef181bbc29
commit
73d1ccb2af
@@ -227,7 +227,6 @@ class GSUtil(object):
|
||||
local_path,
|
||||
remote_path,
|
||||
recursive=False,
|
||||
public=False,
|
||||
multithread=False):
|
||||
assert remote_path.startswith('gs://')
|
||||
|
||||
@@ -235,8 +234,6 @@ class GSUtil(object):
|
||||
args = ['-m', 'cp']
|
||||
else:
|
||||
args = ['cp']
|
||||
if public:
|
||||
args += ['-a', 'public-read']
|
||||
if recursive:
|
||||
args += ['-R']
|
||||
args += [local_path, remote_path]
|
||||
|
||||
@@ -117,7 +117,6 @@ def UploadDartdocApiDocs(dir_name):
|
||||
dir_name,
|
||||
dartdocs_destination_gcsdir,
|
||||
recursive=True,
|
||||
public=True,
|
||||
multithread=True)
|
||||
|
||||
|
||||
@@ -185,7 +184,7 @@ def GuessExtension(binary):
|
||||
|
||||
def DartArchiveFile(local_path, remote_path, checksum_files=False):
|
||||
gsutil = bot_utils.GSUtil()
|
||||
gsutil.upload(local_path, remote_path, public=True)
|
||||
gsutil.upload(local_path, remote_path)
|
||||
if checksum_files:
|
||||
# 'local_path' may have a different filename than 'remote_path'. So we need
|
||||
# to make sure the *.md5sum file contains the correct name.
|
||||
@@ -194,10 +193,10 @@ def DartArchiveFile(local_path, remote_path, checksum_files=False):
|
||||
mangled_filename = remote_path[remote_path.rfind('/') + 1:]
|
||||
local_md5sum = bot_utils.CreateMD5ChecksumFile(local_path,
|
||||
mangled_filename)
|
||||
gsutil.upload(local_md5sum, remote_path + '.md5sum', public=True)
|
||||
gsutil.upload(local_md5sum, remote_path + '.md5sum')
|
||||
local_sha256 = bot_utils.CreateSha256ChecksumFile(
|
||||
local_path, mangled_filename)
|
||||
gsutil.upload(local_sha256, remote_path + '.sha256sum', public=True)
|
||||
gsutil.upload(local_sha256, remote_path + '.sha256sum')
|
||||
|
||||
|
||||
def Run(command, env=None):
|
||||
|
||||
@@ -22,7 +22,7 @@ def ArchiveArtifacts(tarfile, builddir, channel):
|
||||
remote_tarfile = '/'.join(
|
||||
[namer.src_directory(revision),
|
||||
os.path.basename(tarfile)])
|
||||
gsutil.upload(tarfile, remote_tarfile, public=True)
|
||||
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)
|
||||
@@ -31,7 +31,7 @@ def ArchiveArtifacts(tarfile, builddir, channel):
|
||||
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, public=True)
|
||||
gsutil.upload(full_path, remote_file)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
+5
-5
@@ -152,30 +152,30 @@ def _PromoteDartArchiveBuild(channel, source_channel, revision):
|
||||
remove_gs_directory(to_loc)
|
||||
has_signed = exists(from_loc)
|
||||
if has_signed:
|
||||
Gsutil(['-m', 'cp', '-a', 'public-read', '-R', from_loc, to_loc])
|
||||
Gsutil(['-m', 'cp', '-R', from_loc, to_loc])
|
||||
# Because gsutil copies differently to existing directories, we need
|
||||
# to use the base directory for the next recursive copy.
|
||||
to_loc = release_namer.base_directory(to_revision)
|
||||
|
||||
# Copy the unsigned sdk directory without clobbering signed files.
|
||||
from_loc = raw_namer.sdk_directory(revision)
|
||||
Gsutil(['-m', 'cp', '-n', '-a', 'public-read', '-R', from_loc, to_loc])
|
||||
Gsutil(['-m', 'cp', '-n', '-R', from_loc, to_loc])
|
||||
|
||||
# Copy api-docs zipfile.
|
||||
from_loc = raw_namer.apidocs_zipfilepath(revision)
|
||||
to_loc = release_namer.apidocs_zipfilepath(to_revision)
|
||||
Gsutil(['-m', 'cp', '-a', 'public-read', from_loc, to_loc])
|
||||
Gsutil(['-m', 'cp', from_loc, to_loc])
|
||||
|
||||
# Copy linux deb and src packages.
|
||||
from_loc = raw_namer.linux_packages_directory(revision)
|
||||
to_loc = release_namer.linux_packages_directory(to_revision)
|
||||
remove_gs_directory(to_loc)
|
||||
Gsutil(['-m', 'cp', '-a', 'public-read', '-R', from_loc, to_loc])
|
||||
Gsutil(['-m', 'cp', '-R', from_loc, to_loc])
|
||||
|
||||
# Copy VERSION file.
|
||||
from_loc = raw_namer.version_filepath(revision)
|
||||
to_loc = release_namer.version_filepath(to_revision)
|
||||
Gsutil(['cp', '-a', 'public-read', from_loc, to_loc])
|
||||
Gsutil(['cp', from_loc, to_loc])
|
||||
|
||||
promote(revision)
|
||||
promote('latest')
|
||||
|
||||
Reference in New Issue
Block a user