1- name : Argo Continuous Deployment for Comment Service
1+ # name: Argo Continuous Deployment for Comment Service
22
3- on :
4- push :
5- branches :
6- - main
3+ # on:
4+ # push:
5+ # branches:
6+ # - main
77
8- env :
9- PROJECT_ID : devops-project-426109
10- CLUSTER_NAME : autopilot-cluster-1
11- ZONE : us-central1
8+ # env:
9+ # PROJECT_ID: devops-project-426109
10+ # CLUSTER_NAME: autopilot-cluster-1
11+ # ZONE: us-central1
1212
13- jobs :
14- deploy :
15- name : Deploy to GKE Autopilot
16- runs-on : ubuntu-latest
17- steps :
18- - name : Checkout code
19- uses : actions/checkout@v3
13+ # jobs:
14+ # deploy:
15+ # name: Deploy to GKE Autopilot
16+ # runs-on: ubuntu-latest
17+ # steps:
18+ # - name: Checkout code
19+ # uses: actions/checkout@v3
2020
21- - name : Setup JDK 17
22- uses : actions/setup-java@v3
23- with :
24- distribution : ' corretto'
25- java-version : 17
21+ # - name: Setup JDK 17
22+ # uses: actions/setup-java@v3
23+ # with:
24+ # distribution: 'corretto'
25+ # java-version: 17
2626
27- - name : Authenticate
28- uses : google-github-actions/auth@v2
29- with :
30- credentials_json : ${{ secrets.GCP_SA_KEY_2 }}
27+ # - name: Authenticate
28+ # uses: google-github-actions/auth@v2
29+ # with:
30+ # credentials_json: ${{ secrets.GCP_SA_KEY_2 }}
3131
32- - name : Configure gcloud
33- uses : google-github-actions/setup-gcloud@v2
34- with :
35- project_id : ${{ env.PROJECT_ID }}
36- install_components : ' gke-gcloud-auth-plugin'
32+ # - name: Configure gcloud
33+ # uses: google-github-actions/setup-gcloud@v2
34+ # with:
35+ # project_id: ${{ env.PROJECT_ID }}
36+ # install_components: 'gke-gcloud-auth-plugin'
3737
38- - name : Set cluster context
39- run : |
40- gcloud container clusters get-credentials ${{ env.CLUSTER_NAME }} --zone ${{ env.ZONE }} --project ${{ env.PROJECT_ID }}
38+ # - name: Set cluster context
39+ # run: |
40+ # gcloud container clusters get-credentials ${{ env.CLUSTER_NAME }} --zone ${{ env.ZONE }} --project ${{ env.PROJECT_ID }}
4141
42- - name : Install ArgoCD CLI
43- run : |
44- curl -sSL -o argocd-linux-amd64 https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64
45- sudo install -m 555 argocd-linux-amd64 /usr/local/bin/argocd
46- rm argocd-linux-amd64
42+ # - name: Install ArgoCD CLI
43+ # run: |
44+ # curl -sSL -o argocd-linux-amd64 https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64
45+ # sudo install -m 555 argocd-linux-amd64 /usr/local/bin/argocd
46+ # rm argocd-linux-amd64
4747
48- - name : Install ArgoCD in Kubernetes cluster
49- run : |
50- kubectl create namespace argocd || true
51- kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
48+ # - name: Install ArgoCD in Kubernetes cluster
49+ # run: |
50+ # kubectl create namespace argocd || true
51+ # kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
5252
53- - name : Wait for ArgoCD server to be ready
54- run : |
55- kubectl wait --for=condition=available --timeout=1200s deployment/argocd-server -n argocd
53+ # - name: Wait for ArgoCD server to be ready
54+ # run: |
55+ # kubectl wait --for=condition=available --timeout=1200s deployment/argocd-server -n argocd
5656
57- - name : Get ArgoCD initial admin password
58- id : argocd_password
59- run : |
60- ARGOCD_PASSWORD=$(kubectl get pods -n argocd -l app.kubernetes.io/name=argocd-server -o jsonpath='{.items[0].metadata.name}')
61- echo "::set-output name=ARGOCD_PASSWORD::${ARGOCD_PASSWORD}"
57+ # - name: Get ArgoCD initial admin password
58+ # id: argocd_password
59+ # run: |
60+ # ARGOCD_PASSWORD=$(kubectl get pods -n argocd -l app.kubernetes.io/name=argocd-server -o jsonpath='{.items[0].metadata.name}')
61+ # echo "::set-output name=ARGOCD_PASSWORD::${ARGOCD_PASSWORD}"
6262
63- - name : Login to ArgoCD
64- run : |
65- argocd login --insecure --username admin --password ${{ steps.argocd_password.outputs.ARGOCD_PASSWORD }} --grpc-web argocd-server.argocd.svc.cluster.local:443
63+ # - name: Login to ArgoCD
64+ # run: |
65+ # argocd login --insecure --username admin --password ${{ steps.argocd_password.outputs.ARGOCD_PASSWORD }} --grpc-web argocd-server.argocd.svc.cluster.local:443
6666
67- - name : Create ArgoCD application
68- run : |
69- argocd app create comment-service \
70- --repo https://github.com/DevOps-Video-Sharing/CommentService \
71- --path k8s \
72- --dest-server https://kubernetes.default.svc \
73- --dest-namespace default
67+ # - name: Create ArgoCD application
68+ # run: |
69+ # argocd app create comment-service \
70+ # --repo https://github.com/DevOps-Video-Sharing/CommentService \
71+ # --path k8s \
72+ # --dest-server https://kubernetes.default.svc \
73+ # --dest-namespace default
7474
75- - name : Sync ArgoCD application
76- run : |
77- argocd app sync comment-service
75+ # - name: Sync ArgoCD application
76+ # run: |
77+ # argocd app sync comment-service
7878
79- notify :
80- if : always()
81- needs : deploy
82- uses : ./.github/workflows/notifyCD.yaml
83- secrets :
84- SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
79+ # notify:
80+ # if: always()
81+ # needs: deploy
82+ # uses: ./.github/workflows/notifyCD.yaml
83+ # secrets:
84+ # SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
0 commit comments