diff --git "a/.gitlab \342\200\216-ci.yml" "b/.gitlab \342\200\216-ci.yml" deleted file mode 100644 index 92f8bf8c29195e42ca7baad6f28effe341317720..0000000000000000000000000000000000000000 --- "a/.gitlab \342\200\216-ci.yml" +++ /dev/null @@ -1,118 +0,0 @@ -################## -# CI/CD Pipeline # -################## -stages: - - build - - test - - deploy - - -############### -# Build Stage # -############### -build_user_service: - stage: build - script: - - echo "Building User Microservice" - - dotnet publish UserMicroservice -c Release -o ./output/UserMicroservice - artifacts: - paths: - - output/UserMicroservice/ - -build_flight_service: - stage: build - script: - - echo "Building Flight Microservice" - - dotnet publish FlightMicroservice -c Release -o ./output/FlightMicroservice - artifacts: - paths: - - output/FlightMicroservice/ - -build_booking_service: - stage: build - script: - - echo "Building Booking Microservice" - - dotnet publish BookingMicroservice -c Release -o ./output/BookingMicroservice - artifacts: - paths: - - output/BookingMicroservice/ - -build_gateway_api: - stage: build - script: - - echo "Building Gateway API" - - dotnet publish GatewayAPI -c Release -o ./output/GatewayAPI - artifacts: - paths: - - output/GatewayAPI/ - -build_client_app: - stage: build - script: - - echo "Building Client Application" - - cd client - - npm install - - npm run build - - mkdir -p ../output/client - - cp -R dist/* ../output/client/ - artifacts: - paths: - - output/client/ - - -############## -# Test Stage # -############## -test-services: - stage: test - script: - - echo "Running unit tests..." - - find . -name "*.Tests.csproj" -exec dotnet test {} \; - artifacts: - when: always - reports: - junit: - - "**/TestResults/*.xml" - coverage: '/^Total coverage: (\d+\.\d+)%/' - - -################ -# Deploy Stage # -################ -deploy_services_to_registry: - stage: deploy - script: - - echo "Publishing User Microservice to GitLab Package Registry..." - - dotnet nuget push "output/UserMicroservice/*.nupkg" --source "https://gitlab.example.com/api/v4/projects/$CI_PROJECT_ID/packages/nuget" --api-key $CI_JOB_TOKEN - - - echo "Publishing Flight Microservice to GitLab Package Registry..." - - dotnet nuget push "output/FlightMicroservice/*.nupkg" --source "https://gitlab.example.com/api/v4/projects/$CI_PROJECT_ID/packages/nuget" --api-key $CI_JOB_TOKEN - - - echo "Publishing Booking Microservice to GitLab Package Registry..." - - dotnet nuget push "output/BookingMicroservice/*.nupkg" --source "https://gitlab.example.com/api/v4/projects/$CI_PROJECT_ID/packages/nuget" --api-key $CI_JOB_TOKEN - - - echo "Publishing Gateway API to GitLab Package Registry..." - - dotnet nuget push "output/GatewayAPI/*.nupkg" --source "https://gitlab.example.com/api/v4/projects/$CI_PROJECT_ID/packages/nuget" --api-key $CI_JOB_TOKEN - - - echo "Publishing Client Application to GitLab NPM Registry..." - - cd output/client - - npm pack - - npm publish --registry "https://gitlab.example.com/api/v4/projects/$CI_PROJECT_ID/packages/npm" --auth "//gitlab.example.com/api/v4/projects/$CI_PROJECT_ID/packages/npm/:_authToken=$CI_JOB_TOKEN" - dependencies: - - build_user_service - - build_client_app - - build_gateway_api - - build_booking_service - - build_flight_service - only: - - /^release\/.*$/ - -deploy_docker_images: - stage: deploy - script: - - echo "Building and pushing Docker images..." - - docker-compose -f docker-compose.yml build - - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - - docker-compose -f docker-compose.yml push - only: - - /^release\/.*$/ \ No newline at end of file