Skip to content
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Example Voting App
# Example Voting App.

A simple distributed application running across multiple Docker containers.

Expand Down Expand Up @@ -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
88 changes: 88 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
trigger:
paths:
include:
- vote/*

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:
- 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"

4 changes: 2 additions & 2 deletions vote/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down