A lightweight, modular GitOps agent for automated repository monitoring and remote deployment via SSH.
gogitopsdeployer is a GitOps agent designed for simplicity and reliability. It monitors a Git repository for changes and automatically triggers a deployment process to remote servers via SSH. It features built-in rollback mechanisms, Discord notifications, and a GitHub webhook listener for instantaneous updates.
- Phase 1: Foundation — Project structure, Configuration (Env Vars), and standard Logging.
- Phase 2: GitOps Core — Repository monitoring (
go-git), commit hash comparison, and change detection. - Phase 3: Deployment & Infrastructure — SSH client implementation, remote command execution, and rollback logic.
- Phase 4: Persistence & Observability — SQLite storage for deployment history and Discord webhook notifications.
- Phase 5: Immediate Triggers — GitHub Webhook listener with HMAC signature validation.
# Via go install
go install github.com/esousa97/gogitopsdeployer/cmd/agent@latestgit clone https://github.com/esousa97/gogitopsdeployer.git
cd gogitopsdeployer
make build| Target | Description |
|---|---|
make build |
Compiles the agent binary in bin/ |
make run |
Executes the agent directly via Go |
make test |
Runs the unit test suite |
make lint |
Performs static analysis via go vet |
make tidy |
Cleans and updates go.mod dependencies |
make clean |
Removes binary and temporary files |
The project follows Dependency Inversion and Modular Architecture principles, ensuring that the business core remains infrastructure-agnostic.
cmd/agent: Entry point and CLI commands.internal/gitops: Abstraction for Git operations and commit detection.internal/ssh: Remote execution engine and rollback logic.internal/monitor: Resilient reconciliation loop orchestrator.internal/storage: SQLite persistence layer.internal/notification: Discord notification integration.internal/webhook: GitHub Push event receiver.
Detailed package and function documentation is available via Godoc: "Check the full documentation at pkg.go.dev."
| Variable | Description | Type | Default |
|---|---|---|---|
GOGITOPS_REPO_URL |
Target Git repository URL | String | Current repo |
GOGITOPS_INTERVAL |
Check interval duration | Duration | 30s |
GOGITOPS_DB_PATH |
Path to SQLite database | String | ./deployments.db |
GOGITOPS_SSH_HOST |
Deployment machine Host or IP | String | - |
GOGITOPS_SSH_USER |
SSH connection username | String | - |
GOGITOPS_SSH_KEY_PATH |
Path to private SSH key | String | - |
GOGITOPS_DISCORD_WEBHOOK |
Discord Webhook URL | String | - |
See how to contribute in CONTRIBUTING.md.
This project is licensed under the MIT License.