Skip to content

Instantly share code, notes, and snippets.

@tulik
Last active September 19, 2022 13:33
Show Gist options
  • Save tulik/c8216fa581226f40d6d43fa185405cd8 to your computer and use it in GitHub Desktop.
Save tulik/c8216fa581226f40d6d43fa185405cd8 to your computer and use it in GitHub Desktop.
Azure CI pipeline example
# 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:
- master
pr:
branches:
include:
- master
variables:
acrLogin: 'docker login $(registryServerName) -u $(registryLogin) -p $(registryPassword) &> /dev/null;'
envRun: 'docker-compose -f docker-compose.ci.yaml up -d &> /dev/null;'
prepare: '$(acrLogin) $(envRun)'
subsciptionName: 'Pay-As-You-Go (697c9854-7b90-4a94-852b-4efc3e3e6e39)'
jobs:
- job: checking_code_style
displayName: Code Style check
pool:
vmImage: 'ubuntu-latest'
condition: always()
steps:
- task: AzureKeyVault@1
inputs:
azureSubscription: $(subsciptionName)
KeyVaultName: 'ContinuousIntegration'
SecretsFilter: '*'
- bash: |
$(prepare) \
docker-compose -f docker-compose.ci.yaml exec -T php bin/phpcs src
displayName: 'Code Style check'
condition: always()
- job: phpmd_check
displayName: PHP Mess Decector
pool:
vmImage: 'ubuntu-latest'
condition: always()
steps:
- task: AzureKeyVault@1
inputs:
azureSubscription: $(subsciptionName)
KeyVaultName: 'ContinuousIntegration'
SecretsFilter: '*'
- bash: |
$(prepare) \
docker-compose -f docker-compose.ci.yaml exec -T php bin/phpmd src
displayName: 'PHP Mess Detector check'
condition: always()
- job: phpstan_check
displayName: PHPStan check
pool:
vmImage: 'ubuntu-latest'
variables:
registryServerName: $(registryName).azurecr.io
condition: always()
steps:
- task: AzureKeyVault@1
inputs:
azureSubscription: $(subsciptionName)
KeyVaultName: 'ContinuousIntegration'
SecretsFilter: '*'
- bash: |
$(prepare) \
docker-compose -f docker-compose.ci.yaml exec -T php bin/phpstan analyse
displayName: 'PHPStan check'
condition: always()
- job: phpunit_tests
displayName: PHPUnit tests
pool:
vmImage: 'ubuntu-latest'
variables:
registryServerName: $(registryName).azurecr.io
condition: always()
steps:
- task: AzureKeyVault@1
inputs:
azureSubscription: $(subsciptionName)
KeyVaultName: 'ContinuousIntegration'
SecretsFilter: '*'
- bash: |
$(prepare) \
docker-compose -f docker-compose.ci.yaml exec -T php bin/phpunit
displayName: 'PHPUnit tests'
condition: always()
- job: php_metrics
displayName: PHP Metrics
pool:
vmImage: 'ubuntu-latest'
condition: always()
steps:
- task: AzureKeyVault@1
inputs:
azureSubscription: $(subsciptionName)
KeyVaultName: 'ContinuousIntegration'
SecretsFilter: '*'
- bash: |
$(prepare) \
docker-compose -f docker-compose.ci.yaml exec -T php -e bin/phpmetrics src
displayName: 'PHP Metrics'
condition: always()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment