From fa089d46245055389514dce18a9d860ab0a6123f Mon Sep 17 00:00:00 2001 From: sooraj126 Date: Tue, 16 Sep 2025 02:09:37 +1000 Subject: [PATCH 01/13] Adding secret and image name --- k8s/order-service.yaml | 2 +- k8s/product-service.yaml | 2 +- k8s/secrets.yaml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/k8s/order-service.yaml b/k8s/order-service.yaml index c9d92e4d..055f5e14 100644 --- a/k8s/order-service.yaml +++ b/k8s/order-service.yaml @@ -18,7 +18,7 @@ spec: spec: containers: - name: order-service-container - image: durgeshsamariya.azurecr.io/order_service:latest + image: soorajw8acr.azurecr.io/order_service:latest imagePullPolicy: Always ports: - containerPort: 8000 diff --git a/k8s/product-service.yaml b/k8s/product-service.yaml index 0cbbd505..64d0df9b 100644 --- a/k8s/product-service.yaml +++ b/k8s/product-service.yaml @@ -18,7 +18,7 @@ spec: spec: containers: - name: product-service-container - image: durgeshsamariya.azurecr.io/product_service:latest + image: soorajw8acr.azurecr.io/product_service:latest imagePullPolicy: Always ports: - containerPort: 8000 diff --git a/k8s/secrets.yaml b/k8s/secrets.yaml index 5eebe1fa..f72262b4 100644 --- a/k8s/secrets.yaml +++ b/k8s/secrets.yaml @@ -13,6 +13,6 @@ data: # Azure Storage Account Credentials for Product Service image uploads # REPLACE WITH YOUR ACTUAL BASE64 ENCODED VALUES from your Azure Storage Account # Example: echo -n 'myblobstorageaccount' | base64 - AZURE_STORAGE_ACCOUNT_NAME: "ZHVyZ2VzaHNhbWFyaXlh" + AZURE_STORAGE_ACCOUNT_NAME: "c29vcmFqdzhzdG9yYWdl" # Example: echo -n 'your_storage_account_key_string' | base64 - AZURE_STORAGE_ACCOUNT_KEY: "aEFNQ24rbkh2cmhwSGFEaW5jSnAxNFlHaU5nTnJja2NJR05Bc3Y5VXZPUlpsblJkbkVUR3drdTREdSszblBDR3E4ZEVTVjlFNE1jMytBU3RubmZ5QVE9PQ==" + AZURE_STORAGE_ACCOUNT_KEY: "S0tvOWNicFh3VXFMWDQvc0hVdVRmMXNqNytVTTJ5ejk0U2Q5SVEzWEdQYWFLUSs5V1dpTGZCbXl5NG55VjNidTdwUmQyaVE4Z0FKeitBU3QwMkNEOVE9PQ==" From 5ffdbf93ebc2d7e7392e11f7908fcea68453d920 Mon Sep 17 00:00:00 2001 From: sooraj126 Date: Tue, 16 Sep 2025 02:57:04 +1000 Subject: [PATCH 02/13] Update frontend.yaml updated image name --- k8s/frontend.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/frontend.yaml b/k8s/frontend.yaml index 1948536d..6b0662a6 100644 --- a/k8s/frontend.yaml +++ b/k8s/frontend.yaml @@ -18,7 +18,7 @@ spec: spec: containers: - name: frontend-container - image: durgeshsamariya.azurecr.io/frontend:latest + image: soorajw8acr.azurecr.io/frontend:latest imagePullPolicy: Always ports: - containerPort: 80 From 108220482b2377cdc9a79048fed6c54a226cb82b Mon Sep 17 00:00:00 2001 From: sooraj126 Date: Thu, 25 Sep 2025 21:21:07 +1000 Subject: [PATCH 03/13] task9c baseline --- k8s/order-service.yaml | 2 +- k8s/product-service.yaml | 2 +- k8s/secrets.yaml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/k8s/order-service.yaml b/k8s/order-service.yaml index 055f5e14..58b7bef7 100644 --- a/k8s/order-service.yaml +++ b/k8s/order-service.yaml @@ -18,7 +18,7 @@ spec: spec: containers: - name: order-service-container - image: soorajw8acr.azurecr.io/order_service:latest + image: soorajw9cacr.azurecr.io/order_service:latest imagePullPolicy: Always ports: - containerPort: 8000 diff --git a/k8s/product-service.yaml b/k8s/product-service.yaml index 64d0df9b..984094d7 100644 --- a/k8s/product-service.yaml +++ b/k8s/product-service.yaml @@ -18,7 +18,7 @@ spec: spec: containers: - name: product-service-container - image: soorajw8acr.azurecr.io/product_service:latest + image: soorajw9cacr.azurecr.io/product_service:latest imagePullPolicy: Always ports: - containerPort: 8000 diff --git a/k8s/secrets.yaml b/k8s/secrets.yaml index f72262b4..fc170798 100644 --- a/k8s/secrets.yaml +++ b/k8s/secrets.yaml @@ -13,6 +13,6 @@ data: # Azure Storage Account Credentials for Product Service image uploads # REPLACE WITH YOUR ACTUAL BASE64 ENCODED VALUES from your Azure Storage Account # Example: echo -n 'myblobstorageaccount' | base64 - AZURE_STORAGE_ACCOUNT_NAME: "c29vcmFqdzhzdG9yYWdl" + AZURE_STORAGE_ACCOUNT_NAME: "c29vcmFqd2Vlazljc3RvcmFnZQ==" # Example: echo -n 'your_storage_account_key_string' | base64 - AZURE_STORAGE_ACCOUNT_KEY: "S0tvOWNicFh3VXFMWDQvc0hVdVRmMXNqNytVTTJ5ejk0U2Q5SVEzWEdQYWFLUSs5V1dpTGZCbXl5NG55VjNidTdwUmQyaVE4Z0FKeitBU3QwMkNEOVE9PQ==" + AZURE_STORAGE_ACCOUNT_KEY: "YXREN3MwRWF0TkFXbFk5ZUJkUFZqdnRYQzljS1dvZVlhN05HZkRZNkxGZjhpVDliS1g1c0g0RVBUZTVWcGovZGlLSDNPQ3JvWGtsRitBU3RlVWZaUGc9PQ==" From 5f8f46a16d81c935cbf5a3a39e4378bed18afe00 Mon Sep 17 00:00:00 2001 From: sooraj126 Date: Thu, 25 Sep 2025 22:17:38 +1000 Subject: [PATCH 04/13] Update frontend.yaml --- k8s/frontend.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/frontend.yaml b/k8s/frontend.yaml index 6b0662a6..4a23411b 100644 --- a/k8s/frontend.yaml +++ b/k8s/frontend.yaml @@ -18,7 +18,7 @@ spec: spec: containers: - name: frontend-container - image: soorajw8acr.azurecr.io/frontend:latest + image: soorajw9cacr.azurecr.io/frontend:latest imagePullPolicy: Always ports: - containerPort: 80 From f2ebd65f813f93eac848695214cfeb69c6b96129 Mon Sep 17 00:00:00 2001 From: sooraj126 Date: Thu, 25 Sep 2025 22:58:12 +1000 Subject: [PATCH 05/13] task9c cicd --- .github/workflows/backend-cd.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/backend-cd.yml b/.github/workflows/backend-cd.yml index 6035ed15..8c8be6ff 100644 --- a/.github/workflows/backend-cd.yml +++ b/.github/workflows/backend-cd.yml @@ -5,20 +5,28 @@ on: inputs: aks_cluster_name: description: 'Name of the AKS Cluster to deploy to' - required: true + required: false default: '' aks_resource_group: description: 'Resource Group of the AKS Cluster' - required: true + required: false default: '' aks_acr_name: description: 'Name of ACR' - required: true + required: false default: '' +################################################################################ + workflow_run: + workflows: ["Backend CI - Test, Build and Push Images to ACR"] + types: [completed] + jobs: deploy_backend: runs-on: ubuntu-latest + ################################################################################### + if: ${{ github.event_name == 'workflow_dispatch' || (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main') }} + environment: Production outputs: @@ -37,12 +45,12 @@ jobs: - name: Set Kubernetes context (get AKS credentials) run: | - az aks get-credentials --resource-group ${{ github.event.inputs.aks_resource_group }} --name ${{ github.event.inputs.aks_cluster_name }} --overwrite-existing - + + az aks get-credentials --resource-group "$AKS_RESOURCE_GROUP" --name "$AKS_CLUSTER_NAME" --overwrite-existing - name: Attach ACR run: | - az aks update --name ${{ github.event.inputs.aks_cluster_name }} --resource-group ${{ github.event.inputs.aks_resource_group }} --attach-acr ${{ github.event.inputs.aks_acr_name }} - + + az aks update --name "$AKS_CLUSTER_NAME" --resource-group "$AKS_RESOURCE_GROUP" --attach-acr "$ACR_NAME" - name: Deploy Backend Infrastructure (Namespace, ConfigMaps, Secrets, Databases) run: | echo "Deploying backend infrastructure..." From 97e02063fa35561e474b8a71f6cdca33a6e26399 Mon Sep 17 00:00:00 2001 From: sooraj126 Date: Thu, 25 Sep 2025 23:00:30 +1000 Subject: [PATCH 06/13] task9c cicd1 --- k8s/secrets.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/secrets.yaml b/k8s/secrets.yaml index fc170798..533f25dd 100644 --- a/k8s/secrets.yaml +++ b/k8s/secrets.yaml @@ -14,5 +14,5 @@ data: # REPLACE WITH YOUR ACTUAL BASE64 ENCODED VALUES from your Azure Storage Account # Example: echo -n 'myblobstorageaccount' | base64 AZURE_STORAGE_ACCOUNT_NAME: "c29vcmFqd2Vlazljc3RvcmFnZQ==" - # Example: echo -n 'your_storage_account_key_string' | base64 + # Example: echo -n 'your_storage_account_key_string' | base64 wq swq s AZURE_STORAGE_ACCOUNT_KEY: "YXREN3MwRWF0TkFXbFk5ZUJkUFZqdnRYQzljS1dvZVlhN05HZkRZNkxGZjhpVDliS1g1c0g0RVBUZTVWcGovZGlLSDNPQ3JvWGtsRitBU3RlVWZaUGc9PQ==" From 942a7a390fb6ece3bc927e3725a70b4c2bca4bb2 Mon Sep 17 00:00:00 2001 From: sooraj126 Date: Thu, 25 Sep 2025 23:04:48 +1000 Subject: [PATCH 07/13] Update backend-cd.yml --- .github/workflows/backend-cd.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/backend-cd.yml b/.github/workflows/backend-cd.yml index 6035ed15..57f971dc 100644 --- a/.github/workflows/backend-cd.yml +++ b/.github/workflows/backend-cd.yml @@ -5,20 +5,25 @@ on: inputs: aks_cluster_name: description: 'Name of the AKS Cluster to deploy to' - required: true + required: false default: '' aks_resource_group: description: 'Resource Group of the AKS Cluster' - required: true + required: false default: '' aks_acr_name: description: 'Name of ACR' - required: true + required: false default: '' +################################################################################ + workflow_run: + workflows: ["Backend CI - Test, Build and Push Images to ACR"] + types: [completed] jobs: deploy_backend: runs-on: ubuntu-latest + if: ${{ github.event_name == 'workflow_dispatch' || (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main') }} environment: Production outputs: @@ -37,11 +42,11 @@ jobs: - name: Set Kubernetes context (get AKS credentials) run: | - az aks get-credentials --resource-group ${{ github.event.inputs.aks_resource_group }} --name ${{ github.event.inputs.aks_cluster_name }} --overwrite-existing + az aks get-credentials --resource-group "$AKS_RESOURCE_GROUP" --name "$AKS_CLUSTER_NAME" --overwrite-existing - name: Attach ACR run: | - az aks update --name ${{ github.event.inputs.aks_cluster_name }} --resource-group ${{ github.event.inputs.aks_resource_group }} --attach-acr ${{ github.event.inputs.aks_acr_name }} + az aks update --name "$AKS_CLUSTER_NAME" --resource-group "$AKS_RESOURCE_GROUP" --attach-acr "$ACR_NAME" - name: Deploy Backend Infrastructure (Namespace, ConfigMaps, Secrets, Databases) run: | From 095b721c36b3befd999c3dfd42a242432fc36b0f Mon Sep 17 00:00:00 2001 From: sooraj126 Date: Thu, 25 Sep 2025 23:27:15 +1000 Subject: [PATCH 08/13] Update backend-cd.yml --- .github/workflows/backend-cd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/backend-cd.yml b/.github/workflows/backend-cd.yml index 57f971dc..96a12210 100644 --- a/.github/workflows/backend-cd.yml +++ b/.github/workflows/backend-cd.yml @@ -42,11 +42,11 @@ jobs: - name: Set Kubernetes context (get AKS credentials) run: | - az aks get-credentials --resource-group "$AKS_RESOURCE_GROUP" --name "$AKS_CLUSTER_NAME" --overwrite-existing + az aks get-credentials --resource-group "${{ vars.AKS_RESOURCE_GROUP }}" --name "${{ vars.AKS_CLUSTER_NAME }}" --overwrite-existing - name: Attach ACR run: | - az aks update --name "$AKS_CLUSTER_NAME" --resource-group "$AKS_RESOURCE_GROUP" --attach-acr "$ACR_NAME" + az aks update --name "${{ vars.AKS_CLUSTER_NAME }}" --resource-group "${{ vars.AKS_RESOURCE_GROUP }}" --attach-acr "${{ vars.ACR_NAME }}" - name: Deploy Backend Infrastructure (Namespace, ConfigMaps, Secrets, Databases) run: | From 561f212439cd46fa746bf7d69c25133f20554c13 Mon Sep 17 00:00:00 2001 From: sooraj126 Date: Fri, 26 Sep 2025 00:11:54 +1000 Subject: [PATCH 09/13] Update frontend_ci.yml --- .github/workflows/frontend_ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/frontend_ci.yml b/.github/workflows/frontend_ci.yml index 9f9e76d9..5f1d0896 100644 --- a/.github/workflows/frontend_ci.yml +++ b/.github/workflows/frontend_ci.yml @@ -13,6 +13,9 @@ on: paths: # Only trigger if changes are in the frontend directory - 'frontend/**' - '.github/workflows/frontend_ci.yml' # Trigger if this workflow file changes + workflow_run: + workflows: ["CD - Deploy Backend Services to AKS"] + types: [completed] # Define global environment variables that can be used across jobs env: @@ -26,6 +29,8 @@ env: jobs: build_and_push_frontend: runs-on: ubuntu-latest + if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'push' || (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main') }} + steps: - name: Checkout repository From 53e1f1a03cfe307c5758257421eac510a1f4f07a Mon Sep 17 00:00:00 2001 From: sooraj126 Date: Fri, 26 Sep 2025 02:00:51 +1000 Subject: [PATCH 10/13] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 23009398..53abbef8 100644 --- a/README.md +++ b/README.md @@ -36,3 +36,6 @@ image: .azurecr.io/: ### 2. Update Backend Pipeline (`.github/workflows/backend-cd.yml`) & Frontend Pipeline (`.github/workflows/frontend-cd.yml`) Ensure you replace all placeholders value to actual values. + + +# Adding a line to trigger the code. From c3917510a0bb67fe44dcd238ab49373f8e361ea2 Mon Sep 17 00:00:00 2001 From: sooraj126 Date: Fri, 26 Sep 2025 02:03:17 +1000 Subject: [PATCH 11/13] Update backend-cd.yml --- .github/workflows/backend-cd.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/backend-cd.yml b/.github/workflows/backend-cd.yml index 8c8be6ff..bf776222 100644 --- a/.github/workflows/backend-cd.yml +++ b/.github/workflows/backend-cd.yml @@ -107,3 +107,5 @@ jobs: - name: Logout from Azure run: az logout + + #Adding a line to trigger the code From 539f7ddb0fa870c3096cd3ca349cc3eada1c308d Mon Sep 17 00:00:00 2001 From: sooraj126 Date: Fri, 26 Sep 2025 02:13:23 +1000 Subject: [PATCH 12/13] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 53abbef8..81245d6b 100644 --- a/README.md +++ b/README.md @@ -38,4 +38,4 @@ image: .azurecr.io/: Ensure you replace all placeholders value to actual values. -# Adding a line to trigger the code. +# Adding a line to trigger the code... From 02df4c0b26ddaa0e267185c55775aa2475be48e3 Mon Sep 17 00:00:00 2001 From: sooraj126 Date: Fri, 26 Sep 2025 02:17:43 +1000 Subject: [PATCH 13/13] Update backend-cd.yml --- .github/workflows/backend-cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backend-cd.yml b/.github/workflows/backend-cd.yml index cb8d046c..e1545c98 100644 --- a/.github/workflows/backend-cd.yml +++ b/.github/workflows/backend-cd.yml @@ -113,4 +113,4 @@ jobs: - name: Logout from Azure run: az logout - #Adding a line to trigger the code + #Adding a line to trigger the code...