Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinh-Tan-Dat committed Jun 17, 2024
1 parent ffebbbb commit cf84c49
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 228 deletions.
35 changes: 0 additions & 35 deletions .github/workflows/SonarQube.yaml

This file was deleted.

56 changes: 0 additions & 56 deletions .github/workflows/deploymentCD.yaml

This file was deleted.

36 changes: 21 additions & 15 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ name: Continuous Integration for Comment Service
on:
push:
branches:
- main
- dev

jobs:
testing:
name: Testing Comment Service
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v3

Expand All @@ -26,25 +25,32 @@ jobs:
- name: Unit Tests
run: mvn -B test --file pom.xml

sonar-cloud-scan:
needs: testing
uses: ./.github/workflows/SonarQube.yaml
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

build-image:
needs: testing
uses: ./.github/workflows/build-image.yaml
secrets:
DOCKER_HUB_ACCESS_TOKEN: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

scan-image:

deploy:
needs: build-image
uses: ./.github/workflows/scan-image.yaml
runs-on: ubuntu-latest

notify:
needs: scan-image
uses: ./.github/workflows/notifyCI.yaml
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

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

- name: Set up Kubectl
uses: azure/setup-kubectl@v2
with:
version: 'latest'

- name: Set up Kubeconfig
run: |
mkdir -p $HOME/.kube
echo "${{ secrets.KUBE_CONFIG }}" > $HOME/.kube/config
- name: Deploy to Kubernetes
run: |
kubectl apply -f resources.yml
36 changes: 0 additions & 36 deletions .github/workflows/notifyCD.yaml

This file was deleted.

36 changes: 0 additions & 36 deletions .github/workflows/notifyCI.yaml

This file was deleted.

47 changes: 0 additions & 47 deletions .github/workflows/scan-image.yaml

This file was deleted.

7 changes: 4 additions & 3 deletions resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ spec:
resources:
requests:
memory: "32Mi"
cpu: "0.2"
cpu: "200m"
limits:
memory: "64Mi"
cpu: "0.4"
cpu: "400m"
---
apiVersion: v1
kind: Service
Expand All @@ -41,4 +41,5 @@ spec:
- protocol: TCP
port: 8081
targetPort: 8081
type: NodePort
type: NodePort
nodePort: 30001 # Gán cụ thể nodePort để dễ dàng truy cập

0 comments on commit cf84c49

Please sign in to comment.