Skip to content
This repository was archived by the owner on Nov 23, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
f31617f
feat: Enhance project and service management with new endpoints and DTOs
AdithaBuwaneka Oct 31, 2025
31092ed
Merge pull request #2 from TechTorque-2025/Backend-backup
RandithaK Nov 5, 2025
8894ebb
build: Update dependencies and project configuration
RandithaK Nov 5, 2025
3d15c24
feat: Add comprehensive data seeder for development
RandithaK Nov 5, 2025
623a851
refactor: Restructure DTO package with proper request/response DTOs
RandithaK Nov 5, 2025
4e4b4f4
feat: Implement comprehensive project and service management endpoints
RandithaK Nov 5, 2025
2ca73db
feat: Implement complete project business logic
RandithaK Nov 5, 2025
1ea1881
feat: Implement standard service business logic
RandithaK Nov 5, 2025
6b486ec
refactor: Improve error handling with enhanced GlobalExceptionHandler
RandithaK Nov 5, 2025
948e04b
config: Update application properties
RandithaK Nov 5, 2025
53cf8df
test: Update application tests
RandithaK Nov 5, 2025
ff82600
docs: Add comprehensive documentation and quick start guide
RandithaK Nov 5, 2025
f2b5ab3
feat: Add OpenAPI/Swagger configuration
RandithaK Nov 5, 2025
8940120
feat: Add supporting entities, repositories, services, and file storage
RandithaK Nov 5, 2025
5b3306b
feat: Update DataSeeder with correct USERNAMEs and enhance GlobalExce…
RandithaK Nov 5, 2025
766ca0e
feat: Enhance role-based access control for project and service listings
RandithaK Nov 6, 2025
d05ee64
Merge pull request #3 from TechTorque-2025/integration_bug_fixes
RandithaK Nov 6, 2025
5190af6
feat: Add GitHub Actions workflows for building, packaging, and deplo…
RandithaK Nov 8, 2025
b270e57
feat: Add Dockerfile for building and running the microservice
RandithaK Nov 8, 2025
2e00692
Merge pull request #4 from TechTorque-2025/devOps
RandithaK Nov 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Build and Package Service
on:
push:
branches:
- 'main'
- 'devOps'
- 'dev'
pull_request:
branches:
- 'main'
- 'devOps'
- 'dev'

permissions:
contents: read
packages: write

jobs:
build-test:
name: Install and Build (Tests Skipped)
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven

- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-

- name: Build with Maven (Skip Tests)
run: mvn -B clean package -DskipTests --file project-service/pom.xml

- name: Upload Build Artifact (JAR)
uses: actions/upload-artifact@v4
with:
name: project-service-jar
path: project-service/target/*.jar

build-and-push-docker:
name: Build & Push Docker Image
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/devOps' || github.ref == 'refs/heads/dev'
runs-on: ubuntu-latest
needs: build-test

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download JAR Artifact
uses: actions/download-artifact@v4
with:
name: project-service-jar
path: project-service/target/

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/techtorque-2025/project_service
tags: |
type=sha,prefix=
type=raw,value=latest,enable={{is_default_branch}}

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
58 changes: 58 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Deploy Project Service to Kubernetes

on:
workflow_run:
workflows: ["Build and Package Service"]
types:
- completed
branches:
- 'main'
- 'devOps'

jobs:
deploy:
name: Deploy Project Service to Kubernetes
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest

steps:
- name: Get Commit SHA
id: get_sha
run: |
echo "sha=$(echo ${{ github.event.workflow_run.head_sha }} | cut -c1-7)" >> $GITHUB_OUTPUT

- name: Checkout K8s Config Repo
uses: actions/checkout@v4
with:
repository: 'TechTorque-2025/k8s-config'
token: ${{ secrets.REPO_ACCESS_TOKEN }}
path: 'config-repo'
ref: 'main'

- name: Install kubectl
uses: azure/setup-kubectl@v3

- name: Install yq
run: |
sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq
sudo chmod +x /usr/bin/yq

- name: Set Kubernetes context
uses: azure/k8s-set-context@v4
with:
kubeconfig: ${{ secrets.KUBE_CONFIG_DATA }}

- name: Update image tag in YAML
run: |
yq -i '(select(.kind == "Deployment") | .spec.template.spec.containers[0].image) = "ghcr.io/techtorque-2025/project_service:${{ steps.get_sha.outputs.sha }}"' config-repo/k8s/services/projectservice-deployment.yaml

- name: Display file contents before apply
run: |
echo "--- Displaying k8s/services/projectservice-deployment.yaml ---"
cat config-repo/k8s/services/projectservice-deployment.yaml
echo "------------------------------------------------------------"

- name: Deploy to Kubernetes
run: |
kubectl apply -f config-repo/k8s/services/projectservice-deployment.yaml
kubectl rollout status deployment/projectservice-deployment
34 changes: 34 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Dockerfile for project-service

# --- Build Stage ---
# Use the official Maven image which contains the Java JDK
FROM maven:3.8-eclipse-temurin-17 AS build

# Set the working directory
WORKDIR /app

# Copy the pom.xml and download dependencies
COPY project-service/pom.xml .
RUN mvn -B dependency:go-offline

# Copy the rest of the source code and build the application
# Note: We copy the pom.xml *first* to leverage Docker layer caching.
COPY project-service/src ./src
RUN mvn -B clean package -DskipTests

# --- Run Stage ---
# Use a minimal JRE image for the final container
FROM eclipse-temurin:17-jre-jammy

# Set a working directory
WORKDIR /app

# Copy the built JAR from the 'build' stage
# The wildcard is used in case the version number is in the JAR name
COPY --from=build /app/target/*.jar app.jar

# Expose the port your application runs on
EXPOSE 8084

# The command to run your application
ENTRYPOINT ["java", "-jar", "app.jar"]
Loading
Loading