Skip to content

Commit 93d526f

Browse files
author
Abdullah Utku Yertutan
committed
fix: clean up conflict markers from all files
1 parent 5a04bc0 commit 93d526f

6 files changed

Lines changed: 0 additions & 1250 deletions

File tree

β€Ž.github/workflows/ci-cd.ymlβ€Ž

Lines changed: 0 additions & 205 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,6 @@ jobs:
125125
- name: πŸ§ͺ Run Java Unit Tests
126126
run: |
127127
echo "πŸ§ͺ Running Java unit tests..."
128-
<<<<<<< HEAD
129-
cd server/user-service && ./mvnw test -q
130-
cd ../workout-plan-service && ./mvnw test -q
131-
cd ../tts-service && ./mvnw test -q
132-
=======
133-
cd server/user-service && chmod +x ./mvnw && ./mvnw test -Dspring.profiles.active=test
134-
cd ../workout-plan-service && chmod +x ./mvnw && ./mvnw test -Dspring.profiles.active=test
135-
>>>>>>> 8ee4364d68a838d9dfdbb262658698d1e9f4ec0b
136128
echo "βœ… Java unit tests completed"
137129
138130
- name: πŸ§ͺ Run Python Unit Tests
@@ -364,190 +356,6 @@ jobs:
364356
with:
365357
version: 'latest'
366358

367-
<<<<<<< HEAD
368-
# Job 7: Deploy to Kubernetes (only for main branch)
369-
deploy-k8s:
370-
name: πŸš€ Deploy to Kubernetes
371-
runs-on: ubuntu-latest
372-
needs: [setup, unit-tests, integration-tests, system-tests, build-package, build-and-push-ghcr]
373-
if: always() && needs.setup.outputs.is_main == 'true' && needs.unit-tests.result == 'success' && (needs.integration-tests.result == 'success' || needs.integration-tests.result == 'skipped') && (needs.system-tests.result == 'success' || needs.system-tests.result == 'skipped')
374-
steps:
375-
- name: πŸ“₯ Checkout code
376-
uses: actions/checkout@v4
377-
378-
- name: πŸ”‘ Configure AWS credentials
379-
uses: aws-actions/configure-aws-credentials@v4
380-
with:
381-
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
382-
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
383-
aws-region: us-east-1
384-
385-
- name: πŸ”§ Configure kubectl
386-
run: |
387-
aws eks update-kubeconfig --name flexfit-cluster-production --region us-east-1
388-
389-
- name: πŸ“¦ Install Helm
390-
run: |
391-
curl https://get.helm.sh/helm-v3.12.0-linux-amd64.tar.gz | tar xz
392-
sudo mv linux-amd64/helm /usr/local/bin/helm
393-
394-
- name: πŸš€ Deploy to Kubernetes
395-
env:
396-
GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}
397-
CHAIR_API_KEY: ${{ secrets.CHAIR_API_KEY }}
398-
run: |
399-
# Create namespace if it doesn't exist
400-
kubectl create namespace flexfit --dry-run=client -o yaml | kubectl apply -f -
401-
402-
# Create Google credentials secret
403-
kubectl create secret generic flexfit-google-credentials \
404-
--from-literal=google-credentials.json="$GOOGLE_CREDENTIALS" \
405-
--namespace flexfit --dry-run=client -o yaml | kubectl apply -f -
406-
407-
# Deploy using Helm
408-
helm upgrade --install flexfit ./helm/flexfit \
409-
--namespace flexfit \
410-
--set googleCredentials="$GOOGLE_CREDENTIALS" \
411-
--set chairApiKey="$CHAIR_API_KEY" \
412-
--set global.imageTag="${{ github.sha }}" \
413-
--wait --timeout=10m
414-
415-
- name: πŸ₯ Health Check
416-
run: |
417-
echo "Waiting for services to be ready..."
418-
kubectl wait --for=condition=ready pod -l app.kubernetes.io/name=flexfit --namespace flexfit --timeout=300s
419-
420-
echo "Checking service endpoints..."
421-
kubectl get services -n flexfit
422-
kubectl get pods -n flexfit
423-
424-
# Job 8: Summary
425-
summary:
426-
name: πŸ“Š Pipeline Summary
427-
runs-on: ubuntu-latest
428-
needs: [setup, unit-tests, integration-tests, system-tests, build-package, build-and-push-ghcr, deploy-k8s]
429-
=======
430-
- name: πŸ”‘ Configure Kubernetes context
431-
run: |
432-
echo "πŸ”§ Setting up TUM Kubernetes cluster access..."
433-
434-
# Create .kube directory
435-
mkdir -p ~/.kube
436-
437-
# Write kubeconfig from GitHub secret
438-
echo "${{ secrets.TUM_KUBECONFIG }}" | base64 -d > ~/.kube/config
439-
chmod 600 ~/.kube/config
440-
441-
# Verify connection
442-
kubectl config current-context
443-
kubectl version --client
444-
445-
echo "βœ… Connected to TUM Kubernetes cluster"
446-
447-
- name: 🌍 Set deployment environment
448-
id: env
449-
run: |
450-
if [[ "${{ needs.setup.outputs.is_development }}" == "true" ]]; then
451-
echo "namespace=team-code-compass-development" >> $GITHUB_OUTPUT
452-
echo "values_file=values-tum.yaml" >> $GITHUB_OUTPUT
453-
echo "environment=development" >> $GITHUB_OUTPUT
454-
elif [[ "${{ needs.setup.outputs.is_main }}" == "true" ]]; then
455-
echo "namespace=team-code-compass-production" >> $GITHUB_OUTPUT
456-
echo "values_file=values-tum-production.yaml" >> $GITHUB_OUTPUT
457-
echo "environment=production" >> $GITHUB_OUTPUT
458-
else
459-
echo "namespace=team-code-compass-development" >> $GITHUB_OUTPUT
460-
echo "values_file=values-tum.yaml" >> $GITHUB_OUTPUT
461-
echo "environment=development" >> $GITHUB_OUTPUT
462-
fi
463-
464-
- name: πŸ”„ Wait for image propagation
465-
run: |
466-
echo "⏳ Waiting 30 seconds for GHCR images to propagate..."
467-
sleep 30
468-
469-
- name: πŸš€ Deploy to Kubernetes using Helm
470-
run: |
471-
echo "🎯 Deploying to ${{ steps.env.outputs.environment }} environment"
472-
echo "πŸ“¦ Namespace: ${{ steps.env.outputs.namespace }}"
473-
echo "πŸ“ Values file: ${{ steps.env.outputs.values_file }}"
474-
475-
# Set required environment variables for deployment
476-
export TUM_ID="${{ secrets.TUM_ID }}"
477-
export CHAIR_API_KEY="${{ secrets.CHAIR_API_KEY }}"
478-
export POSTGRES_PASSWORD="${{ secrets.POSTGRES_PASSWORD }}"
479-
export GRAFANA_ADMIN_PASSWORD="${{ secrets.GRAFANA_ADMIN_PASSWORD }}"
480-
481-
# Email alerts (optional)
482-
export ALERT_EMAIL_FROM="${{ secrets.ALERT_EMAIL_FROM || 'hakanduranyt@gmail.com' }}"
483-
export ALERT_EMAIL_TO="${{ secrets.ALERT_EMAIL_TO || 'hakanduranyt@gmail.com' }}"
484-
export ALERT_EMAIL_USERNAME="${{ secrets.ALERT_EMAIL_USERNAME || 'hakanduranyt@gmail.com' }}"
485-
export ALERT_EMAIL_PASSWORD="${{ secrets.ALERT_EMAIL_PASSWORD || 'your_gmail_app_password_here' }}"
486-
export SMTP_HOST="${{ secrets.SMTP_HOST || 'smtp.gmail.com:587' }}"
487-
488-
# Set IMAGE_TAG based on branch
489-
if [[ "${{ needs.setup.outputs.is_main }}" == "true" ]]; then
490-
export IMAGE_TAG="main"
491-
echo "🏷️ Using IMAGE_TAG=main for production deployment"
492-
else
493-
export IMAGE_TAG="latest"
494-
echo "🏷️ Using IMAGE_TAG=latest for development deployment"
495-
fi
496-
497-
# Validate required secrets
498-
if [[ -z "$TUM_ID" || -z "$CHAIR_API_KEY" || -z "$POSTGRES_PASSWORD" || -z "$GRAFANA_ADMIN_PASSWORD" ]]; then
499-
echo "❌ Missing required secrets. Please configure:"
500-
echo " - TUM_ID"
501-
echo " - CHAIR_API_KEY"
502-
echo " - POSTGRES_PASSWORD"
503-
echo " - GRAFANA_ADMIN_PASSWORD"
504-
echo ""
505-
echo "πŸ“‹ Optional TUM Kubernetes secrets:"
506-
echo " - TUM_KUBECONFIG (base64 encoded kubeconfig)"
507-
echo " - TUM_NAMESPACE (e.g., ge85zat-devops25)"
508-
echo " - TUM_INGRESS_HOST (e.g., ge85zat-devops25.student.k8s.aet.cit.tum.de)"
509-
exit 1
510-
fi
511-
512-
# Deploy using envsubst and helm
513-
cd helm/flexfit
514-
envsubst < ${{ steps.env.outputs.values_file }} | \
515-
helm upgrade --install flexfit . \
516-
--namespace ${{ steps.env.outputs.namespace }} \
517-
--create-namespace \
518-
--wait \
519-
--timeout=10m \
520-
-f -
521-
522-
- name: βœ… Verify deployment
523-
run: |
524-
echo "πŸ” Verifying deployment in ${{ steps.env.outputs.namespace }}"
525-
kubectl get pods -n ${{ steps.env.outputs.namespace }}
526-
kubectl get services -n ${{ steps.env.outputs.namespace }}
527-
528-
echo "🌐 Checking service health..."
529-
kubectl wait --for=condition=ready pod -l app=frontend -n ${{ steps.env.outputs.namespace }} --timeout=300s || true
530-
kubectl wait --for=condition=ready pod -l app=api-gateway -n ${{ steps.env.outputs.namespace }} --timeout=300s || true
531-
532-
- name: πŸ“Š Deployment summary
533-
run: |
534-
echo "## πŸš€ Deployment Summary" >> $GITHUB_STEP_SUMMARY
535-
echo "- **Environment**: ${{ steps.env.outputs.environment }}" >> $GITHUB_STEP_SUMMARY
536-
echo "- **Namespace**: ${{ steps.env.outputs.namespace }}" >> $GITHUB_STEP_SUMMARY
537-
echo "- **Branch**: ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
538-
echo "- **Commit**: ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY
539-
echo "" >> $GITHUB_STEP_SUMMARY
540-
echo "### πŸ“¦ Deployed Services:" >> $GITHUB_STEP_SUMMARY
541-
kubectl get pods -n ${{ steps.env.outputs.namespace }} --no-headers | while read line; do
542-
echo "- $line" >> $GITHUB_STEP_SUMMARY
543-
done
544-
545-
# Job 6: Pipeline Summary
546-
summary:
547-
name: πŸ“Š Pipeline Summary
548-
runs-on: ubuntu-latest
549-
needs: [setup, unit-tests, integration-tests, build-and-push-ghcr, deploy-to-kubernetes]
550-
>>>>>>> 8ee4364d68a838d9dfdbb262658698d1e9f4ec0b
551359
if: always()
552360
steps:
553361
- name: πŸ“Š Pipeline Results
@@ -562,16 +370,3 @@ jobs:
562370
echo " πŸ§ͺ Unit Tests: ${{ needs.unit-tests.result || 'skipped' }}"
563371
echo " πŸ”— Integration Tests: ${{ needs.integration-tests.result || 'skipped' }}"
564372
echo " 🐳 GHCR Push: ${{ needs.build-and-push-ghcr.result || 'skipped' }}"
565-
<<<<<<< HEAD
566-
echo " πŸš€ Kubernetes Deploy: ${{ needs.deploy-k8s.result || 'skipped' }}"
567-
echo ""
568-
569-
if [ "${{ needs.unit-tests.result }}" == "success" ] && [ "${{ needs.integration-tests.result }}" != "failure" ] && [ "${{ needs.system-tests.result }}" != "failure" ]; then
570-
echo "πŸŽ‰ Pipeline completed successfully!"
571-
else
572-
echo "❌ Pipeline failed - check logs for details"
573-
fi
574-
=======
575-
echo " πŸš€ Kubernetes Deploy: ${{ needs.deploy-to-kubernetes.result || 'skipped' }}"
576-
echo ""
577-
>>>>>>> 8ee4364d68a838d9dfdbb262658698d1e9f4ec0b

0 commit comments

Comments
Β (0)