Skip to content

Commit 13182db

Browse files
ben-octo-data-devitsmebenwalker
authored andcommitted
Add npm install to deploy step
1 parent 9704d8e commit 13182db

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

step-templates/convex-deploy.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"Properties": {
1010
"Octopus.Action.Script.ScriptSource": "Inline",
1111
"Octopus.Action.Script.Syntax": "Bash",
12-
"Octopus.Action.Script.ScriptBody": "deployKey=$(get_octopusvariable \"ConvexDeploy.DeployKey\")\ndeploymentType=$(get_octopusvariable \"ConvexDeploy.DeploymentType\")\npreviewName=$(get_octopusvariable \"ConvexDeploy.PreviewName\")\nworkingDir=$(get_octopusvariable \"ConvexDeploy.WorkingDirectory\")\ncmdTimeout=$(get_octopusvariable \"ConvexDeploy.CommandTimeout\")\n\nif [ -z \"$deployKey\" ]; then\n echo \"ERROR: ConvexDeploy.DeployKey is required.\"\n exit 1\nfi\n\nif [ -z \"$deploymentType\" ]; then\n deploymentType=\"prod\"\nfi\n\nif [ -z \"$cmdTimeout\" ]; then\n cmdTimeout=\"300\"\nfi\n\nexport CONVEX_DEPLOY_KEY=\"$deployKey\"\n\nif [ -n \"$workingDir\" ]; then\n echo \"Changing to working directory: $workingDir\"\n cd \"$workingDir\" || { echo \"ERROR: Could not change to directory '$workingDir'\"; exit 1; }\nfi\n\nensure_node() {\n if command -v npx &>/dev/null; then\n echo \"Node.js found: $(node --version)\"\n return 0\n fi\n export NVM_DIR=\"${NVM_DIR:-$HOME/.nvm}\"\n if [ -s \"$NVM_DIR/nvm.sh\" ]; then\n \\. \"$NVM_DIR/nvm.sh\"\n if command -v npx &>/dev/null; then\n echo \"Node.js loaded via nvm: $(node --version)\"\n return 0\n fi\n fi\n echo \"Node.js not found. Installing via nvm...\"\n curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash\n \\. \"$NVM_DIR/nvm.sh\"\n nvm install --lts\n echo \"Node.js installed: $(node --version)\"\n}\nensure_node\n\necho \"Convex deployment type: $deploymentType\"\n\ncase \"$deploymentType\" in\n prod)\n echo \"Deploying to production...\"\n timeout \"$cmdTimeout\" npx convex deploy --yes\n ;;\n preview)\n if [ -z \"$previewName\" ]; then\n echo \"ERROR: ConvexDeploy.PreviewName is required when deployment type is 'preview'.\"\n exit 1\n fi\n echo \"Deploying to preview deployment: $previewName\"\n timeout \"$cmdTimeout\" npx convex deploy --preview-name \"$previewName\" --yes\n ;;\n dev)\n echo \"Deploying to dev deployment...\"\n timeout \"$cmdTimeout\" npx convex deploy --yes\n ;;\n *)\n echo \"ERROR: Unknown deployment type '$deploymentType'. Must be one of: prod, preview, dev\"\n exit 1\n ;;\nesac\n\nif [ $? -ne 0 ]; then\n echo \"ERROR: Convex deployment failed.\"\n exit 1\nfi\n\necho \"Convex deployment completed successfully.\"\n"
12+
"Octopus.Action.Script.ScriptBody": "deployKey=$(get_octopusvariable \"ConvexDeploy.DeployKey\")\ndeploymentType=$(get_octopusvariable \"ConvexDeploy.DeploymentType\")\npreviewName=$(get_octopusvariable \"ConvexDeploy.PreviewName\")\nworkingDir=$(get_octopusvariable \"ConvexDeploy.WorkingDirectory\")\ncmdTimeout=$(get_octopusvariable \"ConvexDeploy.CommandTimeout\")\n\nif [ -z \"$deployKey\" ]; then\n echo \"ERROR: ConvexDeploy.DeployKey is required.\"\n exit 1\nfi\n\nif [ -z \"$deploymentType\" ]; then\n deploymentType=\"prod\"\nfi\n\nif [ -z \"$cmdTimeout\" ]; then\n cmdTimeout=\"300\"\nfi\n\nexport CONVEX_DEPLOY_KEY=\"$deployKey\"\n\nif [ -n \"$workingDir\" ]; then\n echo \"Changing to working directory: $workingDir\"\n cd \"$workingDir\" || { echo \"ERROR: Could not change to directory '$workingDir'\"; exit 1; }\nfi\n\nensure_node() {\n if command -v npx &>/dev/null; then\n echo \"Node.js found: $(node --version)\"\n return 0\n fi\n export NVM_DIR=\"${NVM_DIR:-$HOME/.nvm}\"\n if [ -s \"$NVM_DIR/nvm.sh\" ]; then\n \\. \"$NVM_DIR/nvm.sh\"\n if command -v npx &>/dev/null; then\n echo \"Node.js loaded via nvm: $(node --version)\"\n return 0\n fi\n fi\n echo \"Node.js not found. Installing via nvm...\"\n curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash\n \\. \"$NVM_DIR/nvm.sh\"\n nvm install --lts\n echo \"Node.js installed: $(node --version)\"\n}\nensure_node\n\necho \"Installing dependencies...\"\nnpm install\n\necho \"Convex deployment type: $deploymentType\"\n\ncase \"$deploymentType\" in\n prod)\n echo \"Deploying to production...\"\n timeout \"$cmdTimeout\" npx convex deploy --yes\n ;;\n preview)\n if [ -z \"$previewName\" ]; then\n echo \"ERROR: ConvexDeploy.PreviewName is required when deployment type is 'preview'.\"\n exit 1\n fi\n echo \"Deploying to preview deployment: $previewName\"\n timeout \"$cmdTimeout\" npx convex deploy --preview-name \"$previewName\" --yes\n ;;\n dev)\n echo \"Deploying to dev deployment...\"\n timeout \"$cmdTimeout\" npx convex deploy --yes\n ;;\n *)\n echo \"ERROR: Unknown deployment type '$deploymentType'. Must be one of: prod, preview, dev\"\n exit 1\n ;;\nesac\n\nif [ $? -ne 0 ]; then\n echo \"ERROR: Convex deployment failed.\"\n exit 1\nfi\n\necho \"Convex deployment completed successfully.\"\n"
1313
},
1414
"Parameters": [
1515
{

0 commit comments

Comments
 (0)