Using the automation API, I want to execute a Git ...
# automation-api
l
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
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
Marvellous!