From 07410dbca42d133dcc7c119e724890fd4e19a29f Mon Sep 17 00:00:00 2001 From: lathadevops3 Date: Wed, 24 Dec 2025 12:49:27 +0530 Subject: [PATCH 01/11] Create azure-pipelines.yml --- azure-pipelines.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000000..0d8b150d95 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,11 @@ +trigger: + branches: + include: + - main + +pool: + vmImage: ubuntu-latest + +steps: +- script: echo "Pipeline triggered from GitHub commit" + displayName: 'Run sample script' From f9ef0349272cb49a9b7bed172c8f479823e9cac7 Mon Sep 17 00:00:00 2001 From: lathadevops3 Date: Wed, 24 Dec 2025 12:58:06 +0530 Subject: [PATCH 02/11] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0d8b150d95..7756bafbe6 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,7 +4,7 @@ trigger: - main pool: - vmImage: ubuntu-latest + vmImage: 'Default' steps: - script: echo "Pipeline triggered from GitHub commit" From c097b8c1028fbcc5e4caf2b807066a90c2691b3f Mon Sep 17 00:00:00 2001 From: lathadevops3 Date: Wed, 24 Dec 2025 14:31:51 +0530 Subject: [PATCH 03/11] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7756bafbe6..89c14d8095 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,7 +4,7 @@ trigger: - main pool: - vmImage: 'Default' + vmImage: 'azure2agent' steps: - script: echo "Pipeline triggered from GitHub commit" From faa4225c5e5dada41354d7a1d8fbab1376b6d449 Mon Sep 17 00:00:00 2001 From: lathadevops3 Date: Wed, 24 Dec 2025 14:33:06 +0530 Subject: [PATCH 04/11] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 89c14d8095..e102601408 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,7 +4,7 @@ trigger: - main pool: - vmImage: 'azure2agent' + name: 'azure2agent' steps: - script: echo "Pipeline triggered from GitHub commit" From 225c17ac1b9e3e04d2ba642d842cdac35839a394 Mon Sep 17 00:00:00 2001 From: lathadevops3 Date: Wed, 24 Dec 2025 14:35:30 +0530 Subject: [PATCH 05/11] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 8516424ba1..f5c20f581d 100644 --- a/README.md +++ b/README.md @@ -63,3 +63,5 @@ The voting application only accepts one vote per client browser. It does not reg This isn't an example of a properly architected perfectly designed distributed app... it's just a simple example of the various types of pieces and languages you might see (queues, persistent data, etc), and how to deal with them in Docker at a basic level. + +##committing to check whether pipeline works ir not by K Hemalatha on 24/12/2025 From 8ac9bbfa828efde9904aeb56597c1484c516b5c4 Mon Sep 17 00:00:00 2001 From: lathadevops3 Date: Wed, 24 Dec 2025 14:53:36 +0530 Subject: [PATCH 06/11] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e102601408..cb5de39efa 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -6,6 +6,40 @@ trigger: pool: name: 'azure2agent' -steps: -- script: echo "Pipeline triggered from GitHub commit" - displayName: 'Run sample script' + +stages: +- stage: Dev + displayName: Deploy to dev + jobs: + - deployment: DeploytoDev + environment: dev + strategy: + runOnce: + deploy: + steps: + - script: echo "Pipeline triggered from GitHub commit" + displayName: 'Run sample script' + - script: echo "deploying to dev" +- stage: QA + displayName: Deploy to QA + dependsOn: Dev + jobs: + - deployment: DeploytoQA + environment: qa + strategy: + runOnce: + deploy: + steps: + - script: echo "deploying to QA" +- stage: Prod + displayName: Deploy to Prod + dependsOn: QA + jobs: + - deployment: DeploytoProd + environment: prod + strategy: + runOnce: + deploy: + steps: + - script: echo "deploying to Prod" + From 8453b28424a15c965d5fe170a6d7fb1c9067cf79 Mon Sep 17 00:00:00 2001 From: lathadevops3 Date: Wed, 24 Dec 2025 15:06:28 +0530 Subject: [PATCH 07/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f5c20f581d..03174baa0c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Example Voting App +# Example Voting App...... A simple distributed application running across multiple Docker containers. From 0b98aef86df25204d6a2020d943a8370f32c2e2f Mon Sep 17 00:00:00 2001 From: lathadevops3 Date: Wed, 24 Dec 2025 15:24:44 +0530 Subject: [PATCH 08/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 03174baa0c..72249465e3 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Example Voting App...... +# Example Voting App. A simple distributed application running across multiple Docker containers. From ef2c06e31d7f3b886bf66955368ae213bae27336 Mon Sep 17 00:00:00 2001 From: lathadevops3 Date: Wed, 24 Dec 2025 15:31:41 +0530 Subject: [PATCH 09/11] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index cb5de39efa..3993a650d4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,7 +1,7 @@ trigger: - branches: + paths: include: - - main + - vote/* pool: name: 'azure2agent' From 5a75fe1e1b116c9f79e9edb12dfc371d4375afd9 Mon Sep 17 00:00:00 2001 From: lathadevops3 Date: Wed, 24 Dec 2025 15:33:01 +0530 Subject: [PATCH 10/11] Update app.py --- vote/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vote/app.py b/vote/app.py index 596546612a..fa7fd9bf7f 100644 --- a/vote/app.py +++ b/vote/app.py @@ -6,8 +6,8 @@ import json import logging -option_a = os.getenv('OPTION_A', "Cats") -option_b = os.getenv('OPTION_B', "Dogs") +option_a = os.getenv('OPTION_A', "Kitten") +option_b = os.getenv('OPTION_B', "Puppy") hostname = socket.gethostname() app = Flask(__name__) From 3793972725d79760cd0dd5c9869d7b0857c9725d Mon Sep 17 00:00:00 2001 From: lathadevops3 Date: Wed, 24 Dec 2025 16:01:52 +0530 Subject: [PATCH 11/11] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3993a650d4..bc5f100b51 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -6,8 +6,51 @@ trigger: pool: name: 'azure2agent' +variables: + # Container registry service connection established during pipeline creation + dockerRegistryServiceConnection: 'acd1e09d-dc2d-498c-bfa8-c5943965a2e0' + imageRepository: 'lathadevopsexamplevotingapp' + containerRegistry: 'azure2registry.azurecr.io' + dockerfilePath: '$(Build.SourcesDirectory)/result/Dockerfile' + tag: '$(Build.BuildId)' + stages: +- stage: Build + displayName: Build + jobs: + - job: Build + displayName: Build + + steps: + - task: Docker@2 + displayName: Build and push an image to container registry + inputs: + containerRegistry: '$(dockerRegistryServiceConnection)' + repository: '$(imageRepository)' + command: 'buildAndPush' + Dockerfile: 'vote/Dockerfile' + tags: '$(tag)' + + +- stage: Push + displayName: Push + jobs: + - job: Push + displayName: Push + + steps: + - task: Docker@2 + displayName: Build and push an image to container registry + inputs: + containerRegistry: '$(dockerRegistryServiceConnection)' + repository: '$(imageRepository)' + command: 'push' + tags: '$(tag)' + + + + - stage: Dev displayName: Deploy to dev jobs: