GitLab on CloudSonic

Push to GitLab and deploy to your CloudSonic server automatically on every merge to main

TL;DR GitLab

Connect your GitLab repository to CloudSonic and deploy via Git push. Full root SSH access means you can set up any deployment workflow that works for your team.

GitLab is a web-based DevOps platform offering Git repository management, CI/CD pipelines, and project management in a single application. CloudSonic works with GitLab out of the box, letting you deploy to your server via Git push or GitLab CI/CD pipelines that run commands over SSH. With full root access available, you can configure GitLab runners to automatically deploy to your server and run database migrations on every merge to your production branch.

Prerequisites
  • GitGit

GitLab for Deployment and CI/CD on CloudSonic

CloudSonic works with GitLab via SSH key authentication, allowing your GitLab CI/CD pipelines to connect to your server on port 2222 and run deployment commands, database migrations, cache clears, and service restarts as part of your pipeline. Store your CloudSonic SSH private key as a GitLab CI/CD variable, reference it in your pipeline configuration, and you have a complete automated deployment workflow from merge to production. Tailscale can also be used within GitLab runners to connect to your server over your private Tailscale network rather than exposing SSH publicly.

Warning Store your SSH private key as a CI/CD variable in GitLab and never hard-code it in your pipeline configuration or repository.

Useful Commands

deploy:
  stage: deploy
  script:
    - eval $(ssh-agent -s)
    - echo "$SSH_KEY" | ssh-add -
    - ssh -p 2222 -o StrictHostKeyChecking=no cloudsonic@$SERVER_IP "cd /applications/your-site/public_html && git pull origin main && wp cache flush"
  only:
    - main