Skip to content

Commit

Permalink
Update azure-pipelines.yml for Azure Pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
KishorABCodz committed Aug 5, 2024
1 parent 18986cc commit 8f890a1
Showing 1 changed file with 44 additions and 26 deletions.
70 changes: 44 additions & 26 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,50 @@
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml

trigger:
branches:
exclude:
- '*'
branches:
exclude:
- '*'

pr:
branches:
include:
- '*'
branches:
include:
- '*'

pool:
name: Default
demands:
- agent.name -equals WIN-4G3TNA4VMUF

stages:
- stage: Build
- stage: ValidateComposeFile
jobs:
- job: PrintFile
pool:
name: Default
demands:
- agent.name -equals WIN-4G3TNA4VMUF
- job: Validate
steps:
- powershell: |
Write-Host "Creating a sample file"
"Hello, Azure Pipelines!" | Out-File -FilePath print.txt
displayName: 'Create a sample file'
- powershell: |
Write-Host "Printing the file contents"
Get-Content -Path print.txt
displayName: 'Print the file contents'
- script: |
docker-compose config
displayName: 'Validate docker-compose.yml'
- stage: BuildAndTest
dependsOn: ValidateComposeFile
jobs:
- job: Build
steps:
- task: DockerCompose@0
inputs:
action: 'Build services'
dockerComposeFile: 'docker-compose.yml'
displayName: 'Build Docker Services'

- task: DockerCompose@0
inputs:
action: 'Run services'
dockerComposeFile: 'docker-compose.yml'
displayName: 'Run Docker Services'

- script: |
docker-compose run my-service ./run-tests.sh
displayName: 'Run Tests'
- task: DockerCompose@0
inputs:
action: 'Down services'
dockerComposeFile: 'docker-compose.yml'
displayName: 'Tear Down Services'

0 comments on commit 8f890a1

Please sign in to comment.