diff options
| author | Stefan Boberg <[email protected]> | 2025-11-24 10:41:16 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2025-11-24 10:41:16 +0100 |
| commit | 7d30a252898e78eb508db4a597580a1261b96d70 (patch) | |
| tree | da73cba80b9e87e6a7495384d70ba3556b49863d /scripts/deploy_release.py | |
| parent | Add regex-free route matching support (#662) (diff) | |
| download | zen-7d30a252898e78eb508db4a597580a1261b96d70.tar.xz zen-7d30a252898e78eb508db4a597580a1261b96d70.zip | |
add Deploy.md and ability to specify a version via --version (#663)
* add docs/Deploy.md
* added ability to specify a version on the command line, via `--version`
Diffstat (limited to 'scripts/deploy_release.py')
| -rw-r--r-- | scripts/deploy_release.py | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/scripts/deploy_release.py b/scripts/deploy_release.py index 52805738f..69eb71010 100644 --- a/scripts/deploy_release.py +++ b/scripts/deploy_release.py @@ -20,15 +20,19 @@ import shutil import subprocess -def read_version(repo_root): - """Read the version from VERSION.txt.""" - version_file = repo_root / "VERSION.txt" - if not version_file.exists(): - print(f"Error: VERSION.txt not found at {version_file}", file=sys.stderr) - sys.exit(1) - - version = version_file.read_text().strip() - print(f"Version: {version}") +def read_version(repo_root, version_override=None): + """Read the version from VERSION.txt or use the provided override.""" + if version_override: + version = version_override + print(f"Version: {version} (from --version)") + else: + version_file = repo_root / "VERSION.txt" + if not version_file.exists(): + print(f"Error: VERSION.txt not found at {version_file}", file=sys.stderr) + sys.exit(1) + + version = version_file.read_text().strip() + print(f"Version: {version} (from VERSION.txt)") return version @@ -235,12 +239,12 @@ def main(): parser.add_argument( "output_dir", type=Path, - help="Directory where artifacts will be copied" + help="Directory where artifacts will be copied (should be the root of a UE p4 workspace)" ) parser.add_argument( - "--version-file", - type=Path, - help="Path to VERSION.txt (default: auto-detect from script location)" + "--version", + type=str, + help="Version to download (default: read from VERSION.txt)" ) parser.add_argument( "-v", "--verbose", @@ -250,16 +254,13 @@ def main(): args = parser.parse_args() - # Determine repository root - if args.version_file: - repo_root = args.version_file.parent - else: - # Assume script is in scripts/ directory - script_dir = Path(__file__).resolve().parent - repo_root = script_dir.parent + # Determine repository root (for reading VERSION.txt if needed) + # Assume script is in scripts/ directory + script_dir = Path(__file__).resolve().parent + repo_root = script_dir.parent - # Read version - version = read_version(repo_root) + # Read version (from --version option or VERSION.txt) + version = read_version(repo_root, args.version) # Create output directory if it doesn't exist output_dir = args.output_dir.resolve() |