This commit is contained in:
Atul Bagga 2020-01-13 15:21:14 +05:30
Родитель 1f6757fa85
Коммит d33c6ff239
10 изменённых файлов: 188 добавлений и 42 удалений

Просмотреть файл

@ -0,0 +1,51 @@
# Python package
# Create and test a Python package on multiple Python versions.
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/python
trigger:
- master
pr: none
jobs:
- job: 'Build_Publish_AKS_Deploy_CLI_Extension'
pool:
vmImage: 'Ubuntu-16.04'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.x'
architecture: 'x64'
- template: templates/setup-ci-machine.yml
- template: templates/build-publish-aks-deploy-cli-extension.yml
- job: 'Run_Style_Check'
pool:
vmImage: 'macOS-10.13'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.x'
architecture: 'x64'
- template: templates/install-azure-cli-edge.yml
- template: templates/download-install-local-azure-test-sdk.yml
- template: templates/setup-ci-machine.yml
- template: templates/download-install-local-aks-deploy-cli-extension-with-pip.yml
- task: PowerShell@2
displayName: 'Run Style Check'
inputs:
targetType: 'filePath'
filePath: 'scripts/runStyleCheck.ps1'

Просмотреть файл

@ -0,0 +1,15 @@
steps:
- script: 'pip install --upgrade .'
displayName: 'Install AKS Deploy CLI extension'
workingDirectory: 'deploy-aks/'
- script: 'python setup.py sdist bdist_wheel'
displayName: 'Build wheel for AKS Deploy CLI extension'
workingDirectory: 'deply-aks/'
- task: PublishBuildArtifacts@1
displayName: 'Publish AKS Deploy CLI extension as artifact'
inputs:
pathtoPublish: 'deploy-aks/dist'
artifactName: 'aks-deploy-cli-extension'
publishLocation: 'Container'

Просмотреть файл

@ -0,0 +1,21 @@
steps:
- script: 'rm -rf azure-cli'
displayName: 'delete azure cli directory'
- script: 'git clone https://github.com/Azure/azure-cli.git'
displayName: 'Clone Azure CLI repository'
- script: 'pip install --upgrade .'
displayName: 'Install Azure CLI test SDK'
workingDirectory: 'azure-cli/src/azure-cli-testsdk/'
- script: 'python setup.py sdist bdist_wheel'
displayName: 'Build wheel for Azure CLI test SDK'
workingDirectory: 'azure-cli/src/azure-cli-testsdk/'
- task: PublishBuildArtifacts@1
displayName: 'Publish Azure CLI test SDK as artifact'
inputs:
pathtoPublish: 'azure-cli/src/azure-cli-testsdk/dist'
artifactName: 'azure-cli-test-sdk'
publishLocation: 'Container'

Просмотреть файл

@ -0,0 +1,22 @@
steps:
- task: DownloadBuildArtifacts@0
displayName : 'Download Extension wheel from Build Artifacts'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'azure-devops-cli-extension'
downloadPath: '$(System.ArtifactsDirectory)/extension'
- task: PowerShell@2
displayName: 'Install Downloaded Extension'
inputs:
targetType: 'inline'
script: |
$extensions = Get-ChildItem -Filter "*.whl" -Recurse | Select-Object FullName
Foreach ($extension in $extensions)
{
Write-Host "installing " $extension.FullName
pip install $extension.FullName
}
Write-Host "done"
workingDirectory: '$(System.ArtifactsDirectory)/extension'

Просмотреть файл

@ -0,0 +1,22 @@
steps:
- task: DownloadBuildArtifacts@0
displayName : 'Download Extension wheel from Build Artifacts'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'ak-deploy-cli-extension'
downloadPath: '$(System.ArtifactsDirectory)/extension'
- task: PowerShell@2
displayName: 'Install Downloaded Extension'
inputs:
targetType: 'inline'
script: |
$extensions = Get-ChildItem -Filter "*.whl" -Recurse | Select-Object FullName
Foreach ($extension in $extensions)
{
Write-Host "installing " $extension.FullName
az extension add --source $extension.FullName -y --debug
}
Write-Host "done"
workingDirectory: '$(System.ArtifactsDirectory)/extension'

Просмотреть файл

@ -0,0 +1,22 @@
steps:
- task: DownloadBuildArtifacts@0
displayName : 'Download Azure CLI test SDK wheel from Build Artifacts'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'azure-cli-test-sdk'
downloadPath: '$(System.ArtifactsDirectory)/wheels'
- task: PowerShell@2
displayName: 'Install Downloaded Wheels'
inputs:
targetType: 'inline'
script: |
$wheels = Get-ChildItem -Filter "*.whl" -Recurse | Select-Object FullName
Foreach ($wheel in $wheels)
{
Write-Host "installing" $wheel.FullName
pip install $wheel.FullName
}
Write-Host "done"
workingDirectory: '$(System.ArtifactsDirectory)/wheels'

Просмотреть файл

@ -0,0 +1,21 @@
steps:
- script: 'python -m pip install --upgrade pip'
displayName: 'Upgrade pip'
- script: 'python --version'
displayName: 'Display Python version'
- script: 'az --version'
displayName: 'Display az version before update'
- script: 'pip uninstall azure-cli -y'
displayName: 'Remove Azure CLI'
- script: 'pip install --pre azure-cli --extra-index-url https://azurecliprod.blob.core.windows.net/edge --upgrade-strategy eager'
displayName: 'Install Azure CLI Edge'
- script: 'python --version'
displayName: 'Display Python version'
- script: 'az --version'
displayName: 'Display az version after update'

Просмотреть файл

@ -0,0 +1,3 @@
steps:
- script: pip install azure-cli
displayName: 'Install Azure CLI released version'

Просмотреть файл

@ -0,0 +1,11 @@
steps:
- script: python -m pip install --upgrade pip
displayName: 'Upgrade pip'
- script: pip install wheel==0.30.0
displayName: 'Install Wheel'
- script: pip install pytest==4.6.6
displayName: 'Install pytest'
- script: pip install coverage
displayName: 'Install coverage'
- script: pip install pytest-cov
displayName: 'Install pytest-cov'

Просмотреть файл

@ -1,42 +0,0 @@
# Python package
# Create and test a Python package on multiple Python versions.
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/python
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
strategy:
matrix:
Python36:
python.version: '3.6'
steps:
- script: python -m pip install --upgrade pip
displayName: 'Upgrade Pip'
- script: python -m pip install --user wheel==0.30.0
displayName: 'Install Wheel'
- script: 'python -m pip install --user --upgrade .'
displayName: 'Pip Upgrade'
workingDirectory: 'deploy-aks/'
- script: 'python ./setup.py bdist_wheel'
displayName: 'Build wheel for CLI Extension'
workingDirectory: 'deploy-aks/'
- task: PowerShell@2
displayName: 'Style Check'
inputs:
filePath: 'scripts/runStyleCheck.ps1'
errorActionPreference: 'continue'
- task: PublishBuildArtifacts@1
displayName: 'Publish Azure AKS deploy CLI Extension as Artifact'
inputs:
pathtoPublish: 'deploy-aks/dist'
artifactName: 'deploy-aks-cli-extension'
publishLocation: Container