A Spring Boot application designed for DevOps training with linting, testing, and CI/CD pipeline examples.
- Spring Boot 3.2.0 with Java 17
- REST API with simple endpoints
- Unit Tests using Spring Boot Test
- Linting with Checkstyle and SpotBugs
- Docker containerization
- GitHub Actions CI pipeline
./mvnw spring-boot:run
# Build and run with Docker Compose
docker-compose up --build
# Or build and run manually
docker build -t devops-training .
docker run -p 8080:8080 devops-training
./mvnw test
./mvnw checkstyle:check
./mvnw spotbugs:check
GET /api/hello
- Returns a hello messageGET /api/hello/{name}
- Returns a personalized hello messageGET /api/health
- Health check endpoint
This project serves as a starting point for DevOps training. Students should:
- Current State: The project builds, tests pass, and basic CI runs
- Add More Pipeline Steps: Extend the GitHub Actions workflow with:
- Security scanning
- Code coverage reporting
- Docker image scanning
- Deployment stages
- Integration testing
- Performance testing
The current .github/workflows/ci.yml
includes:
- Running tests
- Code linting (Checkstyle & SpotBugs)
- Building the application
- Docker image build and basic testing
Students can extend the pipeline by adding:
- Slack/email notifications
- Publish container to Github Registry
- Add secrets / environment variables to the application
The current code has intentional Checkstyle violations to demonstrate linting in action. This is perfect for training scenarios where students learn to:
- Identify code quality issues
- Fix linting violations
- Understand the importance of code standards