Managing woodpecker effectively is a crucial skill for any system administrator. This tutorial provides step-by-step instructions for ci configuration, along with best practices for production environments.
Prerequisites
- A registered domain name (for public-facing services)
- Basic familiarity with the Linux command line
- A Git repository for your project
- Basic understanding of CI/CD concepts
- A VPS running Ubuntu 22.04 or later (2GB+ RAM recommended)
Pipeline Configuration
The woodpecker configuration requires careful attention to resource limits and security settings. On a VPS with limited resources, it's important to tune these parameters according to your available RAM and CPU cores.
# .github/workflows/deploy.yml
name: Deploy to Production
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: |
docker build -t myapp:latest .
- name: Deploy
run: |
ssh deploy@server 'cd /opt/myapp && docker compose pull && docker compose up -d'
The output should show the service running without errors. If you see any warning messages, address them before proceeding to the next step.
Build and Test Setup
Performance benchmarks show that properly tuned woodpecker can handle significantly more concurrent connections than the default configuration. The key improvements come from adjusting worker processes and connection pooling.
# Set up deployment pipeline
mkdir -p /opt/myapp
cd /opt/myapp
# Create deployment script
cat << 'EOF' > deploy.sh
#!/bin/bash
set -euo pipefail
echo "Deploying version: $1"
docker pull myapp:$1
docker compose down
DOCKER_TAG=$1 docker compose up -d
echo "Deployment complete"
EOF
chmod +x deploy.sh
These commands should be run as root or with sudo privileges. If you're using a non-root user, prefix each command with sudo.
Common Issues and Solutions
- Permission denied errors: Ensure files and directories have the correct ownership. Use
chown -Rto fix ownership andchmodfor permissions. - Slow performance: Check for disk I/O bottlenecks with
iostat -x 1and network issues withmtr. Review application logs for slow queries or requests. - High memory usage: Review the configuration for memory-related settings. Reduce worker counts or buffer sizes if running on a low-RAM VPS.
Next Steps
With woodpecker now set up and running, consider implementing monitoring to track performance metrics over time. Regularly review your configuration as your workload changes and scale resources accordingly.