feat: store outputs for Pulumi stacks
This commit is contained in:
parent
6d3bf4767c
commit
ff2de9d390
@ -444,37 +444,22 @@ def _provision(cb, stacks):
|
||||
"""Utility function to reuse code between tasks"""
|
||||
for step in sort_stacks(cb, stacks):
|
||||
if step:
|
||||
# Pulumi is not thread safe, so for now one by one
|
||||
if _anyPulumi(step) and False:
|
||||
with ThreadPoolExecutor(max_workers=len(step)) as group:
|
||||
futures = []
|
||||
for stack in step:
|
||||
if stack.mode != "pulumi":
|
||||
status = stack.get_status()
|
||||
if not status:
|
||||
stack.create()
|
||||
futures.append(group.submit(stack.create))
|
||||
else:
|
||||
stack.update()
|
||||
futures.append(group.submit(stack.update))
|
||||
|
||||
# Pulumi only needs "up"
|
||||
else:
|
||||
stack.create()
|
||||
futures.append(group.submit(stack.create))
|
||||
|
||||
else:
|
||||
with ThreadPoolExecutor(max_workers=len(step)) as group:
|
||||
futures = []
|
||||
for stack in step:
|
||||
if stack.mode != "pulumi":
|
||||
status = stack.get_status()
|
||||
if not status:
|
||||
futures.append(group.submit(stack.create))
|
||||
else:
|
||||
futures.append(group.submit(stack.update))
|
||||
|
||||
# Pulumi only needs "up"
|
||||
else:
|
||||
futures.append(group.submit(stack.create))
|
||||
|
||||
for future in as_completed(futures):
|
||||
future.result()
|
||||
for future in as_completed(futures):
|
||||
future.result()
|
||||
|
||||
|
||||
cli.add_command(version)
|
||||
|
@ -613,14 +613,14 @@ class Stack(object):
|
||||
self.stackname,
|
||||
output_file)
|
||||
|
||||
# If secrets replace with clear values for now, display ONLY
|
||||
# If secrets replace with cleartext values for now, display ONLY
|
||||
for k in self.outputs.keys():
|
||||
if hasattr(
|
||||
self.outputs[k],
|
||||
"secret") and self.outputs[k].secret:
|
||||
self.outputs[k] = self.outputs[k].value
|
||||
|
||||
logger.info(
|
||||
logger.debug(
|
||||
"{} {} Outputs:\n{}".format(
|
||||
self.region,
|
||||
self.stackname,
|
||||
@ -815,6 +815,7 @@ class Stack(object):
|
||||
if self.mode == "pulumi":
|
||||
kwargs = self._set_pulumi_args()
|
||||
self._get_pulumi_stack(create=True).up(**kwargs)
|
||||
status = "COMPLETE"
|
||||
|
||||
else:
|
||||
# Prepare parameters
|
||||
@ -846,9 +847,10 @@ class Stack(object):
|
||||
)
|
||||
|
||||
status = self._wait_for_completion()
|
||||
self.get_outputs()
|
||||
|
||||
return status
|
||||
self.get_outputs()
|
||||
|
||||
return status
|
||||
|
||||
@exec_hooks
|
||||
def update(self):
|
||||
|
Loading…
Reference in New Issue
Block a user