Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions add_to_pydotorg.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,9 @@ def has_sigstore_signature(filename: str) -> bool:
]
)

run_cmd(["chmod", "644", sig_file])
run_cmd(["chmod", "644", cert_file])
run_cmd(["chmod", "644", bundle_file])
os.chmod(sig_file, 0o644)
os.chmod(cert_file, 0o644)
os.chmod(bundle_file, 0o644)
else:
print("All release files already signed with Sigstore")

Expand Down
35 changes: 21 additions & 14 deletions run_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -809,24 +809,31 @@ def execute_command(command: str) -> None:
if channel.recv_exit_status() != 0:
raise ReleaseException(channel.recv_stderr(1000))

execute_command(f"mkdir -p {destination}")
execute_command(f"cp {source}/downloads/* {destination}")
execute_command(f"chgrp downloads {destination}")
execute_command(f"chmod 775 {destination}")
execute_command(f"find {destination} -type f -exec chmod 664 {{}} \\;")
def copy_and_set_permissions(source_glob: str, destination: str) -> None:
execute_command(f"mkdir -p {destination}")
execute_command(f"cp {source_glob} {destination}")
# Skip chgrp/chmod if already correct: another RM may have created
# the directory, and only the owner can change group or permissions.
execute_command(
f"find {destination} -maxdepth 0 ! -group downloads "
f"-exec chgrp downloads {{}} +"
)
execute_command(
f"find {destination} -maxdepth 0 ! -perm 775 -exec chmod 775 {{}} +"
)
execute_command(
f"find {destination} -type f ! -perm 664 -exec chmod 664 {{}} +"
)

# Docs
copy_and_set_permissions(f"{source}/downloads/*", destination)

# Docs
release_tag = db["release"]
if release_tag.is_final or release_tag.is_release_candidate:
source = f"/home/psf-users/{db['ssh_user']}/{db['release']}"
destination = f"/srv/www.python.org/ftp/python/doc/{release_tag}"

execute_command(f"mkdir -p {destination}")
execute_command(f"cp {source}/docs/* {destination}")
execute_command(f"chgrp downloads {destination}")
execute_command(f"chmod 775 {destination}")
execute_command(f"find {destination} -type f -exec chmod 664 {{}} \\;")
copy_and_set_permissions(
f"{source}/docs/*",
f"/srv/www.python.org/ftp/python/doc/{release_tag}",
)


def upload_docs_to_the_docs_server(db: ReleaseShelf) -> None:
Expand Down
Loading