Octo-Manager is a REST API service written in Go that allows users to create, destroy, and list GitHub repositories, as well as list open pull requests for a specific repository.
Octo-Manager provides endpoints to:
- Create GitHub repositories.
- Delete GitHub repositories.
- List GitHub repositories.
- List open pull requests for a given repository with an optional limit.
- Go 1.23
- GitHub Token with repo permissions
- Docker
- Minikube
- Kubectl
Create a .env
file in the project root:
GITHUB_TOKEN=your_github_token
GITHUB_OWNER=your_github_owner
- Build the Docker Image:
docker build -t jorgebaptista/octo-manager:latest .
- Run the Docker Container:
docker login
docker push jorgebaptista/octo-manager:latest
- Access the API: Open
http://localhost:8080
in your browser.
- Push the Docker Image to Docker Hub:
docker login
docker push jorgebaptista/octo-manager:latest
- Apply Kubernetes Manifests:
kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/service.yaml
- Access the Service:
minikube service octo-manager
- Create a Repo:
POST /repos
Request Body (JSON): {"name": "new-repo-name"}
- Delete a Repo:
DELETE /repos/:name
Path parameter :name
is the repository name.
-
List All Repos:
GET /repos
-
List Pull Requests:
GET /repos/:name/pulls
Path parameter :name
is the repository name.
Optional query parameter ?n=x
to limit the number of PRs.
Run unit tests for the GitHub client:
go test ./tests/unit -v
Run integration tests for the API endpoints:
go test ./tests/integration -v
GitHub Actions workflows are set up to:
- Lint: Run
golangci-lint
. - Security: Run
gosec
. - Unit Tests: Execute unit tests.
- Integration Tests: Execute integration tests.
- Build & Push: Build the Docker image and push it to Docker Hub.
- Deploy: Deploy the latest Docker image to Kubernetes/Minikube.