Skip to content

Commit

Permalink
Merge pull request #1 from Azure/dev
Browse files Browse the repository at this point in the history
re-sync root.
  • Loading branch information
valluriraj authored Apr 26, 2021
2 parents cbd60c4 + 0b22a46 commit 7dd04fd
Show file tree
Hide file tree
Showing 697 changed files with 49,836 additions and 16,633 deletions.
258 changes: 158 additions & 100 deletions .azure-devops/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,103 +2,161 @@ pr: none

trigger: none

jobs:

- job: 'Build_Publish_Azure_IoT_CLI_Extension'
pool:
vmImage: 'Ubuntu-16.04'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7.x'
architecture: 'x64'

- template: templates/setup-ci-machine.yml

- template: templates/build-publish-azure-iot-cli-extension.yml

- job: 'Build_Publish_Azure_CLI_Test_SDK'
pool:
vmImage: 'Ubuntu-16.04'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7.x'
architecture: 'x64'

- template: templates/setup-ci-machine.yml

- template: templates/build-publish-azure-cli-test-sdk.yml

- job: 'Run_Tests'
dependsOn : Build_Publish_Azure_CLI_Test_SDK
pool:
vmImage: 'Ubuntu-16.04'

steps:
- template: templates/run-tests.yml
parameters:
pythonVersion: '3.7.x'

- script: 'pip install .'
displayName: 'Install the whl locally'
workingDirectory: '.'

- task: PythonScript@0
displayName : 'setupVersion'
name: 'setupVersion'
inputs:
scriptSource: 'inline'
script: |
from azext_iot.constants import VERSION
print("Version is " + VERSION)
print("##vso[task.setvariable variable=CLIVersion;isOutput=true]"+VERSION)
print("##vso[task.setvariable variable=ReleaseTitle;isOutput=true]"+"azure-iot "+VERSION)
- job: 'Calculate_Sha_And_Create_Release'
dependsOn : Run_Tests
pool:
vmImage: 'vs2017-win2016'
variables:
CLIVersion: $[dependencies.Run_Tests.outputs['setupVersion.CLIVersion']]
ReleaseTitle: $[dependencies.Run_Tests.outputs['setupVersion.ReleaseTitle']]

steps:
- task: DownloadBuildArtifacts@0
displayName : 'Download Extension wheel from Build Artifacts'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'azure-iot'
downloadPath: '$(System.ArtifactsDirectory)/extension'

- task: PowerShell@2
displayName: 'Calculate sha for downloaded extension'
inputs:
targetType: 'inline'
script: |
$extensions = Get-ChildItem -Filter "*.whl" -Recurse | Select-Object FullName
Foreach ($extension in $extensions)
{
Write-Host "calculating sha256 for " $extension.FullName
(Get-Filehash -Path $extension.Fullname -Algorithm SHA256).Hash.ToLower()
}
Write-Host "done"
workingDirectory: '$(System.ArtifactsDirectory)/extension'

- task: GitHubRelease@0
inputs:
gitHubConnection: GitHub
repositoryName: $(Build.Repository.Name)
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: manual
tag: 'v$(CLIVersion)'
title: $(ReleaseTitle)
assets: '$(System.ArtifactsDirectory)/extension/**/*.whl'
assetUploadMode: 'replace'
isDraft: true
isPreRelease: false
addChangeLog: false
variables:
pythonVersion: '3.6.x'
architecture: 'x64'

stages:
- stage: 'build'
displayName: 'Build and Publish Artifacts'
jobs:

- job: 'Build_Publish_Azure_IoT_CLI_Extension'
pool:
vmImage: 'Ubuntu-16.04'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: $(pythonVersion)
architecture: $(architecture)

- template: templates/setup-ci-machine.yml

- template: templates/build-publish-azure-iot-cli-extension.yml

- job: 'Build_Publish_Azure_CLI_Test_SDK'
pool:
vmImage: 'Ubuntu-16.04'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: $(pythonVersion)
architecture: $(architecture)

- template: templates/setup-ci-machine.yml

- template: templates/build-publish-azure-cli-test-sdk.yml

- job: 'recordVersion'
displayName: 'Install and verify version'
dependsOn: [Build_Publish_Azure_IoT_CLI_Extension, Build_Publish_Azure_CLI_Test_SDK]
steps:
- template: templates/setup-dev-test-env.yml
parameters:
pythonVersion: $(pythonVersion)
architecture: $(architecture)

- template: templates/install-and-record-version.yml

- stage: 'test'
displayName: 'Run tests'
pool:
vmImage: 'Ubuntu-16.04'
dependsOn: build
jobs:
- job: 'testCentral'
displayName: 'Test IoT Central'
steps:
- template: templates/run-tests.yml
parameters:
path: 'azext_iot/tests/central'
name: 'iot-central'

- job: 'testADT'
displayName: 'Test Azure DigitalTwins'
steps:
- template: templates/run-tests.yml
parameters:
path: 'azext_iot/tests/digitaltwins'
name: 'azure-digitaltwins'

- job: 'testDPS'
displayName: 'Test DPS'
steps:
- template: templates/run-tests.yml
parameters:
path: 'azext_iot/tests/dps'
name: 'device-provisioning-service'

- job: 'testHub'
displayName: 'Test IoT Hub'
steps:
- template: templates/run-tests.yml
parameters:
path: 'azext_iot/tests/iothub'
name: 'iot-hub'

- job: 'unitTests'
displayName: 'Unit tests and code coverage'
steps:
- template: templates/run-tests.yml
parameters:
runIntTests: 'false'
runUnitTests: 'true'

- stage: 'kpi'
displayName: 'Build KPIs'
dependsOn: [build, test]
jobs:
- job: 'calculateCodeCoverage'
displayName: 'Calculate distributed code coverage'
steps:
- template: templates/calculate-code-coverage.yml
parameters:
pythonVersion: $(pythonVersion)
architecture: $(architecture)

- stage: 'release'
displayName: 'Stage GitHub release'
dependsOn: [build, test]
jobs:
- deployment: 'StageGitHub'
displayName: 'Stage CLI extension on GitHub'
environment: 'production'

- job: 'Calculate_Sha_And_Create_Release'
pool:
vmImage: 'vs2017-win2016'
variables:
CLIVersion: $[ stageDependencies.build.recordVersion.outputs['setupVersion.CLIVersion'] ]
ReleaseTitle: $[ stageDependencies.build.recordVersion.outputs['setupVersion.ReleaseTitle'] ]

steps:
- task: DownloadBuildArtifacts@0
displayName : 'Download Extension wheel from Build Artifacts'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'azure-iot'
downloadPath: '$(System.ArtifactsDirectory)/extension'

- task: PowerShell@2
displayName: 'Calculate sha for downloaded extension'
inputs:
targetType: 'inline'
script: |
$extensions = Get-ChildItem -Filter "*.whl" -Recurse | Select-Object FullName
Foreach ($extension in $extensions)
{
Write-Host "calculating sha256 for " $extension.FullName
(Get-Filehash -Path $extension.Fullname -Algorithm SHA256).Hash.ToLower()
}
Write-Host "done"
workingDirectory: '$(System.ArtifactsDirectory)/extension'

- task: GitHubRelease@0
inputs:
gitHubConnection: AzIoTCLIGitHub
repositoryName: $(Build.Repository.Name)
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: manual
tag: 'v$(CLIVersion)'
title: $(ReleaseTitle)
assets: '$(System.ArtifactsDirectory)/extension/**/*.whl'
assetUploadMode: 'replace'
isDraft: true
isPreRelease: false
addChangeLog: false
Loading

0 comments on commit 7dd04fd

Please sign in to comment.