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
30 commits
Select commit Hold shift + click to select a range
4a3126f
feat(dto): add request DTO classes for admin service module
Suweka Oct 31, 2025
1ca6fa4
feat(dto): add response DTO classes for admin service module
Suweka Oct 31, 2025
080bd72
feat(entity): add JPA entity classes for reports, audit logs, schedul…
Suweka Oct 31, 2025
d440321
feat(repository): add JPA repository interfaces for reports, audit lo…
Suweka Oct 31, 2025
735082c
Added Admin service layer implementations and interfaces
Suweka Oct 31, 2025
beb7674
feat(repository): add derived query methods for ServiceType entity
Suweka Oct 31, 2025
096198d
feat(entity): add report and service configuration entities for admin…
Suweka Oct 31, 2025
41590b0
fix(dto): add missing imports and default field initialization for re…
Suweka Oct 31, 2025
37fdc42
build: Update dependencies and project configuration
RandithaK Nov 5, 2025
6dfd490
feat: Add OpenAPI/Swagger configuration
RandithaK Nov 5, 2025
24cbc27
feat: Add comprehensive data seeder for development
RandithaK Nov 5, 2025
51b63d1
feat: Add WebClient configuration for inter-service communication
RandithaK Nov 5, 2025
3bdaf36
feat: Add request DTOs for admin operations
RandithaK Nov 5, 2025
350e85e
refactor: Enhance ServiceType entity
RandithaK Nov 5, 2025
675ab3f
feat: Add audit log and system configuration controllers
RandithaK Nov 5, 2025
999a263
feat: Enhance analytics and reporting controllers
RandithaK Nov 5, 2025
da52be4
feat: Enhance service configuration and user management controllers
RandithaK Nov 5, 2025
66ab48f
feat: Implement comprehensive admin service business logic
RandithaK Nov 5, 2025
de563d1
refactor: Update main application class
RandithaK Nov 5, 2025
16c27fc
config: Update application properties
RandithaK Nov 5, 2025
31dca23
test: Update application tests
RandithaK Nov 5, 2025
a5bb0bc
docs: Add comprehensive implementation documentation
RandithaK Nov 5, 2025
2702d81
feat: Add response DTOs, exception handling, and additional services
RandithaK Nov 5, 2025
dc07bb3
feat: Enhance user fetching with authentication details in headers
RandithaK Nov 5, 2025
e790a87
feat: Enhance user role handling and add userId conversion logic
RandithaK Nov 6, 2025
a16e75d
Merge pull request #2 from TechTorque-2025/integration_bug_fixes
RandithaK Nov 6, 2025
13afb0e
feat: Add GitHub Actions workflows for building, packaging, and deplo…
RandithaK Nov 8, 2025
e39724c
feat: Add Dockerfile for building and running the microservice
RandithaK Nov 8, 2025
2217ba3
Merge pull request #3 from TechTorque-2025/devOps
RandithaK Nov 8, 2025
aa1f484
Merge branch 'main' into dev
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
90 changes: 90 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# .github/workflows/build.yml
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 admin-service/pom.xml

- name: Upload Build Artifact (JAR)
uses: actions/upload-artifact@v4
with:
name: admin-service-jar
path: admin-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: admin-service-jar
path: admin-service/target/

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/techtorque-2025/admin_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 }}
60 changes: 60 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Admin_Service/.github/workflows/deploy.yml

name: Deploy Admin Service to Kubernetes

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

jobs:
deploy:
name: Deploy Admin 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/admin_service:${{ steps.get_sha.outputs.sha }}"' config-repo/k8s/services/admin-deployment.yaml

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

- name: Deploy to Kubernetes
run: |
kubectl apply -f config-repo/k8s/services/admin-deployment.yaml
kubectl rollout status deployment/admin-deployment
34 changes: 34 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Dockerfile for admin-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 admin-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 admin-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 8087

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