forked from pantsbuild/pants
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a release tag backfill script. (pantsbuild#17806)
The new script was used to successfully backfill all Pants release tag mappings to S3 and the release workflow is fixed to scope its sync to just tags and the underlying helper deploy_to_s3.py code to skip index.html generation when there is no data to generate it from.
- Loading branch information
Showing
5 changed files
with
100 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
import argparse | ||
import subprocess | ||
from pathlib import Path | ||
|
||
from deploy_to_s3 import perform_deploy | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument( | ||
"--aws-cli-symlink-path", | ||
help=( | ||
"The directory (on the $PATH) to symlink the `aws` cli binary into; by default a" | ||
"standard PATH entry appropriate to the current operating system." | ||
), | ||
) | ||
options = parser.parse_args() | ||
|
||
tags_deploy_dir = Path("dist/deploy/tags/pantsbuild.pants") | ||
tags_deploy_dir.mkdir(parents=True, exist_ok=False) | ||
|
||
release_tags = subprocess.run( | ||
["git", "tag", "--list", "release_*"], stdout=subprocess.PIPE, text=True, check=True | ||
).stdout.splitlines() | ||
for release_tag in release_tags: | ||
tag = release_tag.strip() | ||
commit = subprocess.run( | ||
["git", "rev-parse", f"{tag}^{{commit}}"], stdout=subprocess.PIPE, text=True, check=True | ||
).stdout.strip() | ||
(tags_deploy_dir / tag).write_text(commit) | ||
|
||
perform_deploy(aws_cli_symlink_path=options.aws_cli_symlink_path, scope="tags/pantsbuild.pants") | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters