diff --git a/README.md b/README.md index 8516424ba1..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. @@ -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 diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000000..bc5f100b51 --- /dev/null +++ b/azure-pipelines.yml @@ -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" + 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__)