gilles27
gilles27

Reputation: 2241

How can I run npm install as part of an Octopus Deploy?

After I've deployed my nodejs website, but before I update the IIS virtual directory, I need to execute npm install from the command line.

How can I do this with Octopus Deploy's scripts feature?

Upvotes: 1

Views: 1538

Answers (2)

gilles27
gilles27

Reputation: 2241

I've marked Robert's answer as the correct one as the high-level approach is the one I needed. For the record here's the PowerShell script I used-

$installDirectory = $OctopusParameters['Octopus.Action.Package.CustomInstallationDirectory']

cd $installDirectory

npm install --silent

Upvotes: 1

Robert Wagner
Robert Wagner

Reputation: 17793

Either add a PreDeploy script with the command you want to run in your package or via the UI

Upvotes: 1

Related Questions