Skip to Content
Are you interested in Hydra Deploy, contact us?
CTRL K
  • Welcome
  • Getting Started
  • Core Concepts
  • Organization & Management
  • Projects
  • Applications
  • Configurations
  • App Registries
  • Deployments
  • Deployment Steps
  • Auto Deploy Rules
  • Welcome
  • Getting Started
  • Core Concepts
  • Organization & Management
  • Projects
  • Applications
  • Configurations
  • App Registries
  • Deployments
  • Deployment Steps
  • Auto Deploy Rules

On This Page

  • What are Deployment Steps?
  • Why Use Deployment Steps?
  • Deployment Step Types
  • Templates
  • Custom Steps
  • Managing Deployment Steps
  • From Application Page
  • Creating a Step
  • Ordering Steps
  • Step Configurations
  • Script Execution
  • Environment Variables
  • Error Handling
  • Monitoring and Logs
  • Step Progress
  • Log Output
  • Best Practices
  • Atomic Steps
  • Idempotency
  • Timeouts
  • Use Cases
  • Database Migrations
  • Health Checks
  • Cache Invalidation
  • Troubleshooting
  • Step Failed
  • Timeouts
  • Advanced Features
  • Dependencies
  • Parallel Execution
  • Conditional Execution
Question? Give us feedback Edit this page 
Deployment Steps

Deployment Steps

Define the steps that are executed during deployment for advanced control.

What are Deployment Steps?

Deployment Steps are a series of actions that are executed during a deployment. They enable you to define complex deployment processes that involve more than just running a script.

Why Use Deployment Steps?

  • Modularity - Reusable steps for multiple applications
  • Visualization - See the progress of each step
  • Error Handling - Stop on errors and see which step failed
  • Control - Define what exactly needs to happen during a deployment

Deployment Step Types

Templates

Templates are pre-defined steps provided by Hydra Deploy:

Available Templates:

  • Health Check - Check if application is available
  • Database Migration - Run database migrations
  • Cache Clear - Clear cache
  • Backup - Create backup before deployment
  • Rollback - Roll back on errors

Custom Steps

Create your own deployment steps for specific use cases:

  • Bash scripts
  • PowerShell scripts (for Windows)
  • Custom checks
  • Integration with external services

Managing Deployment Steps

From Application Page

  1. Go to an Application
  2. Navigate to the Deployment Steps tab
  3. View current steps

Creating a Step

Custom Step:

  1. Click on Add Custom Step
  2. Fill in the following fields:
    • Name - A descriptive name (e.g., “Run Tests”)
    • Description - What does this step do?
    • Type - Script type (Bash/PowerShell)
    • Script - The script to execute
  3. Click on Save

Adding Template:

  1. Click on Add Template
  2. Select a template from the list
  3. Configure template parameters
  4. Click on Save

Ordering Steps

The order of deployment steps is important:

  1. Drag steps to desired position
  2. Or use arrow buttons to change order
  3. Save the order

Common Order:

  1. Create backup
  2. Stop current application
  3. Download new version
  4. Run database migrations
  5. Clear cache
  6. Start application
  7. Run health check

Step Configurations

Script Execution

Bash (Linux/Mac):

#!/bin/bash # Health check curl -f http://localhost:3000/health || exit 1 echo "Health check passed"

PowerShell (Windows):

# Stop application Stop-Service -Name MyApp

Environment Variables

Deployment steps have access to environment variables:

  • $VERSION - The version being deployed
  • $APP_NAME - Name of the application
  • $PROJECT_NAME - Name of the project
  • $ENVIRONMENT_NAME - Name of the environment
  • $DEPLOYMENT_ID - Unique ID of this deployment

Example:

#!/bin/bash echo "Deploying version $VERSION to $ENVIRONMENT_NAME" echo "Application: $APP_NAME" echo "Project: $PROJECT_NAME"

Error Handling

Configure what should happen on an error:

  • Continue - Proceed to next steps
  • Stop - Stop the deployment and mark as failed
  • Retry - Try the step again

Monitoring and Logs

Step Progress

During deployment, you see the progress of each step:

  • Pending - The step is waiting to execute
  • In Progress - The step is being executed
  • Success - The step completed successfully
  • Failed - The step failed

Log Output

Each step generates log output:

  • Standard output from the script
  • Error messages if present
  • Timestamp of each step

View the logs in the deployment details page to see what happened.

Best Practices

Atomic Steps

Keep each step simple and independent as possible:

  • One task per step
  • No complex logic in a single step
  • Easier to debug

Idempotency

Make sure steps are repeatable:

  • Can run multiple times without causing damage
  • Check if something already exists before creating it
  • Use conditional logic

Timeouts

Set timeouts for each step:

  • Prevent infinite wait times
  • Error on timeout
  • Proceed to next step or stop the deployment

Use Cases

Database Migrations

For applications with databases:

Step 1 - Backup:

#!/bin/bash pg_dump $DATABASE_URL > backup.sql

Step 2 - Migrate:

#!/bin/bash npm run migrate

Step 3 - Verify:

#!/bin/bash # Check if database schema is correct npm run verify-db

Health Checks

After deployment, verify that application is running:

#!/bin/bash # Wait 30 seconds sleep 30 # Try 5 times to connect for i in {1..5}; do if curl -f http://localhost:3000/health; then echo "Application is healthy" exit 0 fi echo "Retrying... ($i/5)" sleep 10 done echo "Health check failed" exit 1

Cache Invalidation

Clear cache after deployment:

#!/bin/bash # Redis cache redis-cli FLUSHALL # Or for memcached echo "flush_all" | nc localhost 11211

Troubleshooting

Step Failed

If a deployment step fails:

  1. View the logs of the specific step
  2. Check the script for syntax errors
  3. Verify that all required tools are available
  4. Test the step manually on the server
  5. Adjust the step and deploy again

Timeouts

If steps timeout:

  1. Check if the step needs more time
  2. Increase the timeout for the step
  3. Or split the step into multiple smaller steps

Advanced Features

Dependencies

Configure that certain steps only run if earlier steps succeeded:

  • Automatically handled by deployment orchestrator
  • Failed steps stop further execution

Parallel Execution

Some steps can be executed in parallel:

  • Configure if a step can run in parallel
  • Speed up deployments by executing independent tasks together

Conditional Execution

Execute steps only under certain conditions:

  • Environment-specific steps
  • Version-specific steps
  • Based on variables or configurations
DeploymentsAuto Deploy Rules

MIT 2026 © Nextra.