feat: pulumi version bump, minor fixes
This commit is contained in:
parent
b774297ddb
commit
4768de1984
@ -1,5 +1,5 @@
|
||||
ARG RUNTIME_VERSION="3.11"
|
||||
ARG DISTRO_VERSION="3.19"
|
||||
ARG DISTRO_VERSION="3.20"
|
||||
|
||||
FROM python:${RUNTIME_VERSION}-alpine${DISTRO_VERSION} AS builder
|
||||
ARG RUNTIME_VERSION="3.11"
|
||||
|
@ -57,6 +57,8 @@ def pulumi_ws(func):
|
||||
self.work_dir = tempfile.mkdtemp(
|
||||
dir=tempfile.gettempdir(), prefix="cloudbender-"
|
||||
)
|
||||
cwd = os.getcwd()
|
||||
os.chdir(self.work_dir)
|
||||
|
||||
# add all artifact_paths/pulumi to the search path for easier
|
||||
# imports in the pulumi code
|
||||
@ -146,7 +148,8 @@ def pulumi_ws(func):
|
||||
try:
|
||||
_min_version = self._pulumi_code.MIN_CLOUDBENDER_VERSION
|
||||
if semver.compare(
|
||||
semver.Version.parse(__version__.strip("v")).finalize_version(),
|
||||
semver.Version.parse(
|
||||
__version__.strip("v")).finalize_version(),
|
||||
_min_version.strip("v")) < 0:
|
||||
raise ValueError(
|
||||
f"Minimal required CloudBender version is {_min_version}, but we are {__version__}!"
|
||||
@ -189,7 +192,7 @@ def pulumi_ws(func):
|
||||
)
|
||||
|
||||
project_settings = pulumi.automation.ProjectSettings(
|
||||
name=project_name, runtime="python", backend={"url": pulumi_backend}
|
||||
name=project_name, runtime="python", backend=pulumi.automation.ProjectBackend(url=pulumi_backend)
|
||||
)
|
||||
|
||||
self.pulumi_ws_opts = pulumi.automation.LocalWorkspaceOptions(
|
||||
@ -202,6 +205,9 @@ def pulumi_ws(func):
|
||||
response = func(self, *args, **kwargs)
|
||||
|
||||
# Cleanup temp workspace
|
||||
if cwd:
|
||||
os.chdir(cwd)
|
||||
|
||||
if self.work_dir and os.path.exists(self.work_dir):
|
||||
shutil.rmtree(self.work_dir)
|
||||
|
||||
|
@ -535,7 +535,6 @@ class Stack(object):
|
||||
logger.info("Passed.")
|
||||
return 0
|
||||
|
||||
@pulumi_ws
|
||||
def get_outputs(self, include=".*", values=False):
|
||||
"""gets outputs of the stack"""
|
||||
|
||||
@ -852,6 +851,7 @@ class Stack(object):
|
||||
|
||||
return status
|
||||
|
||||
@pulumi_ws
|
||||
@exec_hooks
|
||||
def update(self):
|
||||
"""Updates an existing stack"""
|
||||
@ -1305,7 +1305,6 @@ class Stack(object):
|
||||
logger.info(" ".join([self.region, self.stackname, text]))
|
||||
|
||||
def _get_pulumi_stack(self, create=False):
|
||||
|
||||
if create:
|
||||
pulumi_stack = pulumi.automation.create_or_select_stack(
|
||||
stack_name=self.pulumi_stackname,
|
||||
|
@ -11,7 +11,7 @@ authors = [
|
||||
description = "Deploy and maintain infrastructure in automated and trackable manner"
|
||||
readme = "README.md"
|
||||
license = "AGPL-3.0-or-later"
|
||||
requires-python = ">=3.9"
|
||||
requires-python = ">=3.11"
|
||||
dependencies = [
|
||||
"boto3==1.35.15",
|
||||
"mock==5.1.0",
|
||||
|
Loading…
Reference in New Issue
Block a user