- π Overview
- β‘ Requirements
- π¦ Installation
- π How to use
- βοΈ Commands
- π§ͺ Test
- π€ Contributing
- π License
- π¬ Support
Ops is an all-purpose deployment automation tool tailored for DevOps & SRE teams. Built in Go, it provides a unified CLI interface for managing deployments, Kubernetes configurations, container registries, secrets, and various DevOps operations across different cloud environments (AWS, Azure, and more).
This tool streamlines common DevOps workflows by combining multiple operations into a single, easy-to-use command-line interface, reducing the complexity of managing multi-cloud deployments and infrastructure operations.
- Go: 1.23.6 or later
- Operating System: macOS, Linux, or Windows
The following tools are required for full functionality:
- AWS CLI: 2.24.5 or later (for AWS operations)
- Werf: 2.26.4 or later (for deployment operations)
- kubectl: For Kubernetes operations
- Docker: For container operations
- Node.js: 22.13.0 (for development and release automation)
- GoReleaser: 2.7.0 (for building releases)
-
Clone the repository:
git clone <repository-url> cd ops
-
Build from source:
go build -o ops
-
Install globally (optional):
go install
go install github.com/gbh-tech/ops@latestDownload the latest binary from the releases page.
If you're contributing to the project:
-
Install development tools:
# Using asdf (recommended) asdf install # Or install tools manually according to .tool-versions
-
Install dependencies:
go mod download
The ops tool is designed with a simple command structure that follows the
pattern:
ops [command] [subcommand] [flags]-
Check version:
ops --version
-
Get help:
ops --help ops [command] --help
-
Set target environment: Most commands support the
-eor--envflag to specify the target environment:ops [command] --env production
The tool uses configuration files to manage different environments and settings. Configure your environments and cloud credentials according to your infrastructure setup.
# Display current environment
ops env
# Set specific environment
ops env --env staging# Configure kubectl context for AWS EKS
ops kube config --env production
# Configure kubectl context for Azure AKS
ops kube config --env staging# Login to container registry (ECR, etc.)
ops registry login --env production# Deploy using Werf
ops deploy werf --env production
# Deploy with custom values
ops deploy werf --env staging --set image.tag=v1.2.3Manages deployments, migrations, and operations for ECS-based services.
The --app flag is optional in single-repo mode and required in mono-repo mode
(repo_mode: mono in .ops/config.yaml).
# Deploy an app: register task definition, run migrations, update service
ops ecs deploy --env production --app my-app --tag v1.2.3
# Dry-run: print the resolved task definition without deploying
ops ecs render --env staging --app my-app --tag v1.2.3
# Show current ECS service status
ops ecs status --env production --app my-app
# Wait for the service to reach a stable state
ops ecs wait --env production --app my-app
# Roll back the service to the previous task definition revision
ops ecs rollback --env production --app my-app
# Run a standalone database migration task
ops ecs db-migrate --env production --app my-app
# Remove old task definition revisions, keeping the latest 5 (default)
ops ecs cleanup --env production --app my-app --keep 5
# Tail recent CloudWatch logs for a service (default: last 10 minutes)
ops ecs logs --env production --app my-app --since 30m# Extract ticket ID from current branch
ops git get-ticket-id
# Clean up old Git tags
ops git tag-cleaner# Encrypt secrets
ops secrets encrypt --env production
# Decrypt secrets
ops secrets decrypt --env staging-e, --env string: Specify the target environment-h, --help: Show help for any command--version: Show version information
Currently, the project uses Go's built-in testing framework. To run tests:
# Run all tests
go test ./...
# Run tests with verbose output
go test -v ./...
# Run tests for a specific package
go test ./pkg/...The project uses automated linting in CI/CD. To run linting locally:
# Using golangci-lint (if installed)
golangci-lint run
# Or use go vet
go vet ./...Verify the build works correctly:
# Build the project
go build
# Run built binary
./ops --versionThe project uses GitHub Actions for automated testing and building:
- Build: Automated builds on pull requests
- Lint: Code quality checks
- Release: Automated releases using GoReleaser
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
See the LICENSE file for details.
For questions, issues, or contributions, please contact devops@gbh.tech.