Skip to content

Commit

Permalink
Merge pull request #1618 from alan-turing-institute/work_dir
Browse files Browse the repository at this point in the history
Move pulumi stack working directory initialisation
  • Loading branch information
JimMadge committed Sep 27, 2023
2 parents 53e53ab + 549a3fe commit afb29b4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions data_safe_haven/infrastructure/stack_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ def __init__(
self.work_dir = config.work_directory / "pulumi" / self.program.short_name
self.work_dir.mkdir(parents=True, exist_ok=True)
self.login() # Log in to the Pulumi backend
self.initialise_workdir()
self.install_plugins()

@property
def local_stack_path(self) -> pathlib.Path:
Expand Down Expand Up @@ -137,8 +139,6 @@ def copy_secret(self, name: str, other_stack: "StackManager") -> None:
def deploy(self, *, force: bool = False) -> None:
"""Deploy the infrastructure with Pulumi."""
try:
self.initialise_workdir()
self.install_plugins()
self.apply_config_options()
if force:
self.cancel()
Expand Down Expand Up @@ -357,8 +357,6 @@ def set_config(self, name: str, value: str, *, secret: bool) -> None:
def teardown(self) -> None:
"""Teardown the infrastructure deployed with Pulumi."""
try:
self.initialise_workdir()
self.install_plugins()
self.refresh()
self.destroy()
self.remove_workdir()
Expand Down

0 comments on commit afb29b4

Please sign in to comment.