flaky-school-70251
03/17/2022, 7:59 AMproject := auto.Project(workspace.Project{
Name: tokens.PackageName(projectName),
Runtime: workspace.NewProjectRuntimeInfo("go", nil),
Backend: &workspace.ProjectBackend{
URL: "file://~/.pulumi-local",
}, })
s, err := auto.UpsertStackInlineSource(ctx, stackName, projectName, deployFunc(configPath), project, secretsProvider, stackSettings, envvars)
My issue is that if ~/.pulumi-local
directory doesn't exist, this will fail with stderr: error: unable to open bucket file:///home/tim/.pulumi-local: stat /home/tim/.pulumi-local: no such file or directory
. If the directory exists, the code works and the stack is updated without issue.
Looking through the pulumi CLI code, the 'login' function is what would normally create the local backend directory if it doesn't exist, but I can't seem to find this functionality exposed by the SDK.No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by