Sentry is an automated deployment tool that monitors Git repositories for changes and automatically deploys Tekton pipeline configurations to Kubernetes clusters. It supports both GitHub and GitLab repositories with intelligent change detection and robust error handling.
- Multi-Platform Support: Works with GitHub and GitLab repositories
- Automatic Detection: Monitors repository changes and triggers deployments
- Tekton Integration: Scans for
.tektondirectories and deploys pipeline configurations - Robust Error Handling: Includes retry mechanisms and rollback capabilities
- Secure: Uses environment variables for sensitive information
- Kubernetes Native: Designed to run in Kubernetes with proper RBAC
- Cross-Platform: Supports Linux, macOS, and Windows
- Go 1.21 or later
- Kubernetes cluster with Tekton Pipelines installed
- kubectl configured for your cluster
- Git access tokens for your repositories
git clone https://github.com/your-org/sentry.git
cd sentry
make build
./build/sentry -versiondocker pull localhost:5000/sentry:1.0.0
docker run --rm -v $(pwd)/sentry.yaml:/app/sentry.yaml \
-e GITHUB_TOKEN=your_token \
-e GITLAB_TOKEN=your_token \
localhost:5000/sentry:1.0.0 -action=validate# Update tokens in k8s/02-secret.yaml
kubectl apply -f k8s/# Quick install with inline values
helm install sentry ./helm/sentry \
--set secrets.githubToken="your_github_token" \
--set secrets.gitlabToken="your_gitlab_token"
# Install development environment
helm install sentry-dev ./helm/sentry -f ./helm/sentry/values-dev.yaml
# Install production environment
helm install sentry-prod ./helm/sentry -f ./helm/sentry/values-production.yamlCreate a sentry.yaml configuration file:
polling_interval: 60
groups:
my-projects:
execution_strategy: "parallel"
max_parallel: 3
continue_on_error: true
global_timeout: 900
repositories:
- name: "my-project"
group: "my-projects"
monitor:
repo_url: "https://github.com/owner/repo"
branches: ["main"]
repo_type: "github"
auth:
username: "${GITHUB_USERNAME}"
token: "${GITHUB_TOKEN}"
deploy:
qa_repo_url: "https://gitlab.com/qa/repo"
qa_repo_branch: "main"
repo_type: "gitlab"
auth:
username: "${GITLAB_USERNAME}"
token: "${GITLAB_TOKEN}"
project_name: "my-project"
commands:
- "cd .tekton/my-project"
- "kubectl apply -f . --namespace=tekton-pipelines"
global:
tmp_dir: "/tmp/sentry"
cleanup: true
log_level: "info"
timeout: 300Set environment variables:
export GITHUB_TOKEN="your_github_token"
export GITLAB_TOKEN="your_gitlab_token"sentry -action=validatesentry -action=triggersentry -action=watch -verbose# Build for current platform
make build
# Cross-compile for all platforms
make cross-compile
# Build Docker image
make docker
# Run tests
make test
# Run end-to-end tests
make test-e2e# Install dependencies
make deps
# Run linting
make lint
# Clean build artifacts
make clean- Quick Start:
helm install sentry ./helm/sentry \
--create-namespace \
--namespace sentry-system \
--set secrets.githubToken="your_github_token" \
--set secrets.gitlabToken="your_gitlab_token"- Custom Configuration:
Create a my-values.yaml:
config:
pollingInterval: 60
repositories:
- name: "my-project"
monitor:
repo_url: "https://github.com/your-org/your-repo"
branches: ["main"]
repo_type: "github"
auth:
username: "${GITHUB_USERNAME}"
token: "${GITHUB_TOKEN}"
deploy:
qa_repo_url: "https://gitlab.com/qa/repo"
qa_repo_branch: "main"
repo_type: "gitlab"
auth:
username: "${GITLAB_USERNAME}"
token: "${GITLAB_TOKEN}"
project_name: "my-project"
commands:
- "cd .tekton/my-project"
- "kubectl apply -f ."
secrets:
githubToken: "your_github_token"
gitlabToken: "your_gitlab_token"Deploy with custom values:
helm install sentry ./helm/sentry -f my-values.yaml- Environment-Specific Deployments:
# Development
helm install sentry-dev ./helm/sentry -f ./helm/sentry/values-dev.yaml
# Production
helm install sentry-prod ./helm/sentry -f ./helm/sentry/values-production.yaml- Verify Deployment:
kubectl get pods -n sentry-system
kubectl logs -f deployment/sentry -n sentry-system- Update Secrets: Edit
k8s/02-secret.yamlwith your actual tokens (base64 encoded):
echo -n "your_github_token" | base64
echo -n "your_gitlab_token" | base64-
Update Configuration: Modify
k8s/03-configmap.yamlwith your repository URLs. -
Deploy:
kubectl apply -f k8s/- Verify:
kubectl get pods -n sentry-system
kubectl logs -f deployment/sentry -n sentry-system- Use dedicated service accounts with minimal required permissions
- Store sensitive tokens in Kubernetes Secrets
- Enable read-only root filesystem in containers
- Run containers as non-root user
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Run
make test lint - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For questions and support:
- Create an issue on GitHub
- Check the documentation in the
docs/directory - Review the implementation plan for technical details
- Initial release
- GitHub and GitLab support
- Automatic Tekton deployment
- Kubernetes integration
- Comprehensive error handling
- Full test coverage