Download the PHP package dennenboom/harvest without Composer
On this page you can find all versions of the php package dennenboom/harvest. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dennenboom/harvest
More information about dennenboom/harvest
Files in dennenboom/harvest
Package harvest
Short Description Simple deployment automation tool for Laravel applications
License MIT
Informations about the package harvest
Harvest
A simple deployment automation tool for Laravel applications, inspired by Laravel Envoy. Harvest helps you automate deployment scenarios by executing a series of commands on remote servers via SSH.
Features
- Simple deployment automation
- SSH-based remote execution
- Optional confirmation prompts
- Variable placeholders for dynamic deployments
- Sudo password handling
- Shell context switching support
- SSH jump host (proxy) support
- Easy configuration
- Docker-friendly
Installation
Install via Composer:
The package will auto-register itself via Laravel's package discovery.
Configuration
Publish the configuration file:
This will create a config/harvest.php file. Configure your deployment environments:
SSH Setup
Docker: Mount SSH keys
Usage
Deploy to a specific environment:
Skip confirmation prompt:
Pass variables via command line:
Pass multiple variables:
SSH Authentication
Harvest executes SSH commands directly, so authentication is handled by your SSH configuration. This means:
- Your SSH keys should be set up and configured outside of Harvest
- Use
ssh-agentto manage your keys - Configure SSH aliases in your
~/.ssh/configfor easier management
Example SSH config (~/.ssh/config):
Then in your Harvest config:
Docker Considerations
If your Laravel application runs inside Docker containers, you have several options for SSH key management:
Option 1: SSH Agent Forwarding (Recommended)
Mount your SSH agent socket into the container:
Then run:
Option 2: Mount SSH Keys as Volume
Mount your SSH directory (ensure proper permissions):
Warning: Be careful with this approach and never commit SSH keys to your repository.
Option 3: Run Harvest Outside Docker
Since Harvest only orchestrates SSH commands, you can run it from your host machine:
Option 4: Use Environment Variables for SSH Config
You can set SSH connection details via environment variables:
Then in your config:
How It Works
- Harvest reads your deployment configuration from
config/harvest.php - It connects to the remote server using the configured SSH command
- Each action is executed sequentially on the remote server
- If any action fails, deployment stops immediately
- Success/failure status is reported back to you
Advanced Features
Variable Placeholders
Use dynamic variables in your deployment actions. Perfect for version tagging, branch selection, or any dynamic value.
Configuration:
Usage:
Sudo Password Handling
Harvest automatically detects when your deployment requires sudo password and prompts you securely.
Auto-detection: Harvest detects sudo -S or sudo -s commands automatically.
Manual configuration: Set needs_sudo_password to true to force password prompt.
Shell Context Switching
Harvest intelligently handles shell switching commands like sudo -u user -s /bin/bash. When detected, all subsequent commands run in that user's context.
Example:
When you run this deployment, Harvest will:
- Prompt for sudo password (auto-detected from
sudo -S) - Connect via SSH jump host (proxy)
- Switch to apache user
- Execute remaining commands in apache user context
Configuration Options
Per-Environment Settings
ssh_command(required): The SSH command to connect to the serverask_confirmation(optional, default:false): Whether to prompt for confirmation before deploymentactions(required): Array of commands to execute on the remote servervariables(optional): Define variables for use in actions with{varname}placeholdersneeds_sudo_password(optional): Force sudo password prompt (auto-detected when usingsudo -Sorsudo -s)
Examples
Simple Deployment
Production with Confirmation
Multiple Servers
License
MIT License. See LICENSE for details.
All versions of harvest with dependencies
illuminate/console Version ^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/support Version ^9.0|^10.0|^11.0|^12.0|^13.0
symfony/process Version ^6.0|^7.0|^8.0