Skip to content

ESousa97/gogitopsdeployer

Go GitOps Deployer

A lightweight, modular GitOps agent for automated repository monitoring and remote deployment via SSH.

Go GitOps Deployer Banner

CI Go Report Card CodeFactor Go Reference License Go Version Last Commit


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.

Roadmap

  • 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.

Quick Start

Installation

# Via go install
go install github.com/esousa97/gogitopsdeployer/cmd/agent@latest

From source

git clone https://github.com/esousa97/gogitopsdeployer.git
cd gogitopsdeployer
make build

Makefile Targets

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

Architecture

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.

API Reference

Detailed package and function documentation is available via Godoc: "Check the full documentation at pkg.go.dev."

Configuration

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 -

Contributing

See how to contribute in CONTRIBUTING.md.

License

This project is licensed under the MIT License.

Author

Enoque Sousa

LinkedIn GitHub Portfolio

⬆ Back to top

Made with ❤️ by Enoque Sousa

Project Status: Active Development

About

62 - A lightweight GitOps agent for automated repository monitoring and remote SSH deployment.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors