Add CLI deployment scripts for existing servers#1
Open
justin-russell wants to merge 9 commits intomainfrom
Open
Add CLI deployment scripts for existing servers#1justin-russell wants to merge 9 commits intomainfrom
justin-russell wants to merge 9 commits intomainfrom
Conversation
Implements complete deployment workflow for deploying OpenClaw to existing servers without provisioning new Hetzner instances. Enables integration testing of Ansible playbooks and deployment to any server with SSH access. New scripts: - run-deploy.sh: Deploy OpenClaw using SSH key and inventory file - Auto-onboards by default (--skip-onboard to disable) - Creates instance artifacts automatically - Supports custom instance names via INSTANCE_NAME_OVERRIDE - connect-instance.sh: Connect to instances and run OpenClaw commands - Reads instance artifacts to get connection details - Supports interactive onboard/setup/shell access - Can use custom IP/key via --ip and --key flags - create-inventory.sh: Generate Ansible inventory from IP address - Simple wrapper to create inventory files - Validates IP format - cleanup-ssh-key.yml: Manage SSH keys in Hetzner Cloud - List all SSH keys - Delete specific keys by name Improvements: - run-hetzner.sh: Add prerequisite checks for Python 3.12, Ansible, dependencies - hetzner-finland-fast.yml: - Remove unsupported 'force' parameter from ssh_key module - Add debug task to show provisioning parameters Complete workflow: 1. Create inventory: ./create-inventory.sh <IP> inventory.ini 2. Deploy + onboard: ./run-deploy.sh -k <key> -i inventory.ini 3. Or connect later: ./connect-instance.sh <instance-name> onboard Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add comprehensive documentation for the new CLI deployment workflow: - Quick Start section for deploying to existing servers - Detailed command documentation for run-deploy.sh, connect-instance.sh, create-inventory.sh - Complete workflow examples showing end-to-end deployment - Updated file structure with new scripts - Enhanced requirements section with Python 3.12+ setup - Updated TLDR with both deployment methods Key improvements: - Emphasizes CLI deployment as recommended approach for testing - Documents auto-onboard feature (default behavior) - Shows how to skip onboarding with --skip-onboard - Provides clear setup instructions for Python virtualenv - Includes prerequisite checking information Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Create setup.sh to automate environment setup: - Automatically detects Python 3.12+ (checks python3.12, python3, python, pyenv) - Creates virtual environment if needed - Installs all Python dependencies from requirements.txt - Installs Ansible Hetzner collection - Provides helpful error messages if Python 3.12+ not found - Shows installation instructions for pyenv, apt, and brew Update prerequisite checks: - run-deploy.sh: Suggest running ./setup.sh if prerequisites missing - run-hetzner.sh: Suggest running ./setup.sh if prerequisites missing Update README: - Replace manual setup steps with ./setup.sh one-liner - Document what setup.sh does and how it works - Update Quick Start, Requirements, Complete Workflows, and TLDR - Emphasize simplicity: just run ./setup.sh User experience improvements: - No need to know about venv, pip, or ansible-galaxy - No need to find the right Python binary - Just run ./setup.sh and everything is installed - Clear errors if Python 3.12+ not available Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Transform run-deploy.sh into a true one-command solution that: - Auto-installs dependencies (Python 3.12+, venv, Ansible, collections) - Accepts IP address directly as positional argument - Accepts instance name via -n/--name flag - Auto-generates temporary inventory files - Maintains full backward compatibility with inventory files New workflow: ./run-deploy.sh <IP> -k <key> -n <name> Old workflow still works: ./run-deploy.sh -k <key> -i <inventory> Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Merge changes from main while preserving all deployment infrastructure: - Add LICENSE file (GNU AGPL v3) - Update README with Discord and Twitter/X community links - Update website Footer with correct social links - Keep all CLI deployment scripts and infrastructure - Keep all Ansible playbooks and requirements No deployment functionality removed - all features intact. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Move all CLI scripts and Ansible playbooks into a dedicated cli/ directory: - All shell scripts (.sh files) - All Ansible playbooks (.yml files) - ansible.cfg configuration Changes: - Created cli/ directory structure - Moved 16 files: scripts, playbooks, and config - Updated all scripts to cd to correct directory on startup - Added path resolution for user-provided arguments (SSH keys, inventory) - Updated README, PROVISION.md, HETZNER_SETUP.md with new paths - Updated File Structure section in README - All scripts reference ../instances/ and ../venv/ correctly User workflow remains simple: ./cli/run-deploy.sh <IP> -k <key> -n <name> Tested and verified: - Deployment works correctly with new structure - Path resolution handles relative and absolute paths - Instance artifacts created successfully Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements complete CLI deployment workflow for deploying OpenClaw to existing servers with true one-command deployment. No separate setup or inventory file creation required - just provide an IP address and SSH key.
🎯 One-Command Deployment (NEW!)
The deployment script now handles everything automatically:
What happens automatically:
Key Features
🚀 Streamlined Deployment
./run-deploy.sh <IP> -k <key> -n <name>-n/--nameflag🔧 Automatic Setup
📦 Instance Artifact Management
✨ Auto-Onboard by Default
--skip-onboardflag available if neededNew Deployment Workflows
Before (3 steps):
After (1 step):
Legacy Support (still works):
Scripts
run-deploy.sh(ENHANCED)Deploy OpenClaw to existing servers with auto-setup:
./run-deploy.sh <IP> -k <key>-n/--name <name>flag-i inventory.inisetup.shStandalone environment setup (optional now):
connect-instance.shConnect to deployed instances:
create-inventory.shGenerate Ansible inventory files (advanced use):
cleanup-ssh-key.ymlManage SSH keys in Hetzner Cloud:
Usage Examples
Basic deployment:
./run-deploy.sh 192.168.1.100 -k ~/.ssh/id_ed25519With custom name:
./run-deploy.sh 192.168.1.100 -k ~/.ssh/key -n productionSkip auto-onboard:
Using --ip flag:
./run-deploy.sh --ip 192.168.1.100 -k key -n testBackward compatible (inventory file):
Environment variables:
Improvements to Existing Scripts
run-hetzner.shhetzner-finland-fast.ymlDocumentation
Testing
All deployment scenarios tested:
Files Changed
run-deploy.sh(enhanced) - One-command deployment with auto-setupREADME.md(updated) - Simplified documentationsetup.sh(existing) - Kept as standalone optionconnect-instance.sh(existing) - No changescreate-inventory.sh(existing) - Now for advanced usecleanup-ssh-key.yml(existing) - No changesrun-hetzner.sh(existing) - No changesBreaking Changes
None. All existing functionality preserved with full backward compatibility.