https://pulumi.com logo
l

limited-rainbow-51650

09/24/2020, 2:51 PM
Using the automation API, I want to execute a Git based Pulumi NodeJS project. After using
auto.UpsertStackRemoteSource
, how must I trigger
npm install
to retrieve all dependencies before invoking
stack.Up(…)
g

green-school-95910

09/24/2020, 2:58 PM
You can do that on the GitRepo
Copy code
repo := GitRepo{
	URL: "<https://github.com/your/repo.git>",
	// this call back will get executed post-clone to allow for additional program setup
	Setup: func(ctx context.Context, workspace Workspace) error {
		cmd := exec.Command("npm", "install")
		cmd.Dir = workspace.WorkDir()
		return cmd.Run()
	},
}
👍 2
l

limited-rainbow-51650

09/24/2020, 3:05 PM
Marvellous!
2 Views