miniature-lion-41490
07/07/2023, 2:46 PMdatetime.now()
then the pulumi code will obviously/presumably(?) redeploy the service whenever i run pulumi due to the change in values; i don't want that. any ideas?billowy-army-68599
miniature-lion-41490
07/07/2023, 3:18 PMbillowy-army-68599
miniature-lion-41490
07/07/2023, 3:21 PMbillowy-army-68599
miniature-lion-41490
07/19/2023, 11:58 AMdef get_build_time(self, image: docker.Image) -> Output[datetime | None]:
cmd = command.local.Command(
f"{image._name}-build-time",
create='TZ=UTC date +"%Y-%m-%d %H:%M:%S"',
triggers=[image.repo_digest],
opts=pulumi.ResourceOptions(parent=image),
)
def to_datetime(stdout: str) -> datetime | None:
if not stdout.strip():
return None
return datetime.strptime(stdout.strip(), "%Y-%m-%d %H:%M:%S")
return cmd.stdout.apply(to_datetime)
In theory i could add the git hash in a similar way