This repository contains a Java Spring Boot implementation of a simple Counter Service for the CI/CD Tools and Practices Final Project.
The Counter Service is a RESTful web service that allows clients to create, read, update, and delete counters. Each counter has a name and a value that can be incremented.
- Java 21
- Spring Boot 3.2.0
- Maven
- JUnit 5 for testing
- GitHub Actions for CI/CD
- Tekton for Kubernetes-based CI/CD
- JDK 21
- Maven 3.8+
- Docker (for containerization)
To set up the development environment, run:
# Clone the repository
git clone https://github.com/yourusername/ci-cd-final-project.git
cd ci-cd-final-project
# Build the project
./mvnw clean package
./mvnw spring-boot:run
java -jar target/counter-service-1.0.0.jar
# Build the Docker image
docker build -t counter-service .
# Run the container
docker run -p 8000:8000 counter-service
The application will be available at http://localhost:8000
Method | Endpoint | Description |
---|---|---|
GET | / | Service information |
GET | /health | Health check |
GET | /counters | List all counters |
POST | /counters/{name} | Create a new counter |
GET | /counters/{name} | Get a counter by name |
PUT | /counters/{name} | Increment a counter |
DELETE | /counters/{name} | Delete a counter |
./mvnw test
The project includes CI/CD configurations for:
- GitHub Actions (.github/workflows/workflow.yml)
- Tekton (.tekton/tasks.yml)
These pipelines handle:
- Building the application
- Running tests
- Generating test coverage reports
- Code quality analysis
- Building and scanning Docker images
Licensed under the Apache License. See LICENSE
Skills Network