mirror of
https://gitlab.com/veilid/veilid.git
synced 2025-08-02 03:36:07 -04:00
Converting CICD from Bash to Python Scripts [ci dryrun]
This commit is contained in:
parent
ab3cf25647
commit
40f39a2c9b
14 changed files with 869 additions and 38 deletions
37
scripts/cicd-python/veilid_release_utils.py
Normal file
37
scripts/cicd-python/veilid_release_utils.py
Normal file
|
@ -0,0 +1,37 @@
|
|||
#!/usr/bin/env python3
|
||||
import os
|
||||
import sys
|
||||
import argparse
|
||||
import asyncio
|
||||
from dotenv import load_dotenv
|
||||
from utils.build_machine_control import create_build_machine, delete_build_machine
|
||||
from utils.test_credentials import test_api_credentials
|
||||
from utils.repos_builder import build_deb_repo, build_rpm_repo
|
||||
|
||||
if __name__ == "__main__":
|
||||
# Load environment variables from the .env file.
|
||||
load_dotenv()
|
||||
token = os.getenv("DO_API_TOKEN")
|
||||
if not token:
|
||||
print("Error: DO_API_TOKEN environment variable not found. Please set it in the .env file.", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
# Set up command-line argument parsing.
|
||||
parser = argparse.ArgumentParser(description="Veilid compiling and releasing utility")
|
||||
parser.add_argument("--create-build-machine", action="store_true", help="Create a build machine")
|
||||
parser.add_argument("--delete-build-machine", action="store_true", help="Delete the created build machine")
|
||||
parser.add_argument("--build-deb-repo", action="store_true", help="Creates and signs .deb repository")
|
||||
parser.add_argument("--build-rpm-repo", action="store_true", help="Creates and signs .rpm repository")
|
||||
parser.add_argument("--test-api-credentials", action="store_true", help="Test DigitalOcean API credentials")
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.create_build_machine:
|
||||
asyncio.run(create_build_machine(token))
|
||||
elif args.delete_build_machine:
|
||||
asyncio.run(delete_build_machine(token))
|
||||
elif args.build_deb_repo:
|
||||
asyncio.run(build_deb_repo())
|
||||
elif args.build_rpm_repo:
|
||||
asyncio.run(build_rpm_repo())
|
||||
elif args.test_api_credentials:
|
||||
asyncio.run(test_api_credentials(token))
|
Loading…
Add table
Add a link
Reference in a new issue