gogitopsdeployer

module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2026 License: MIT

README

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

Directories

Path Synopsis
cmd
agent command
Package main is the entry point for the gogitopsdeployer agent.
Package main is the entry point for the gogitopsdeployer agent.
internal
config
Package config provides typed configuration management for the GitOps agent, using environment variables as the source of truth.
Package config provides typed configuration management for the GitOps agent, using environment variables as the source of truth.
gitops
Package gitops provides a simplified interface for Git operations, specifically for monitoring and Updating repositories.
Package gitops provides a simplified interface for Git operations, specifically for monitoring and Updating repositories.
monitor
Package monitor acts as the core orchestrator for the GitOps agent.
Package monitor acts as the core orchestrator for the GitOps agent.
notification
Package notification provides integration with external communication platforms like Discord to broadcast deployment status.
Package notification provides integration with external communication platforms like Discord to broadcast deployment status.
ssh
Package ssh provides capabilities for remote command execution using the SSH protocol, including support for primary and rollback commands.
Package ssh provides capabilities for remote command execution using the SSH protocol, including support for primary and rollback commands.
storage
Package storage provides a persistence layer using SQLite to maintain a history of all deployment attempts and their outcomes.
Package storage provides a persistence layer using SQLite to maintain a history of all deployment attempts and their outcomes.
webhook
Package webhook provides an HTTP server to receive and validate push event notifications from GitHub.
Package webhook provides an HTTP server to receive and validate push event notifications from GitHub.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL