Add nsg config to check-pr
@@ -12,8 +12,7 @@ import uuid
from typing import List, Optional
from cleanup_ad import delete_current_user_app_registrations
-
-from .github_client import GithubClient
+from github_client import GithubClient
def venv_path(base: str, name: str) -> str:
@@ -40,6 +39,7 @@ class Deployer:
test_args: List[str],
repo: str,
unattended: bool,
+ nsg_config: Optional[str],
):
self.downloader = GithubClient()
self.pr = pr
@@ -54,6 +54,7 @@ class Deployer:
self.client_id: Optional[str] = None
self.client_secret: Optional[str] = None
self.authority = authority
+ self.nsg_config = nsg_config
def merge(self) -> None:
if self.pr:
@@ -65,6 +66,9 @@ class Deployer:
subprocess.check_call(f"python -mvenv {venv}", shell=True)
pip = venv_path(venv, "pip")
py = venv_path(venv, "python")
+ if self.nsg_config:
+ config = self.nsg_config
+ else:
config = os.path.join(os.getcwd(), "config.json")
commands = [
("extracting release-artifacts", f"unzip -qq {filename}"),
@@ -72,7 +76,7 @@ class Deployer:
("installing wheel", f"{pip} install -q wheel"),
("installing prereqs", f"{pip} install -q -r requirements.txt"),
(
- "running deploment",
+ "running deployment",
(
f"{py} deploy.py {self.region} "
f"{self.instance} {self.instance} cicd {config}"
@@ -236,6 +240,7 @@ def main() -> None:
parser.add_argument("--authority", default=None)
parser.add_argument("--test_args", nargs=argparse.REMAINDER)
parser.add_argument("--unattended", action="store_true")
+ parser.add_argument("--nsg-config", default=None)
args = parser.parse_args()
if not args.branch and not args.pr:
@@ -252,6 +257,7 @@ def main() -> None:
repo=args.repo,
unattended=args.unattended,
authority=args.authority,
+ nsg_config=args.nsg_config,
)
with tempfile.TemporaryDirectory() as directory:
os.chdir(directory)
