Skip to content

Commit

Permalink
Add "build images" yaml definition (#699)
Browse files Browse the repository at this point in the history
* Convert images build to yaml

* Update yaml

* Fix typo

* Fix another typo

* Add demand for windows

* Fix docker login on windows

* Fix demands on windows

* Fix typo

* Add templates for windows and fix version tag

* Fix typo

* Remove functions sample

* Disable arm build for functions

* Update arm param name

* Add namespace parameter
  • Loading branch information
myagley authored Jan 9, 2019
1 parent e5dcd0d commit e85bc9d
Show file tree
Hide file tree
Showing 3 changed files with 220 additions and 0 deletions.
190 changes: 190 additions & 0 deletions builds/misc/images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
trigger:
batch: true
branches:
include:
- master
pr: none
jobs:

################################################################################
- job: linux
################################################################################
displayName: Linux
pool:
name: Hosted Ubuntu 1604
vmImage: 'ubuntu-16.04'
variables:
NetCorePackageUri: https://download.microsoft.com/download/4/0/9/40920432-3302-47a8-b13c-bbc4848ad114/dotnet-sdk-2.1.302-linux-x64.tar.gz
steps:
- script: scripts/linux/installPrereqs.sh -u $(NetCorePackageUri)
name: install
displayName: Install dependencies
- script: scripts/linux/buildBranch.sh -c Release --no-rocksdb-bin
name: build
displayName: Build (release)
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifacts'
inputs:
PathtoPublish: '$(Build.BinariesDirectory)/publish'
ArtifactName: 'core-linux'

# Edge Agent
- template: templates/image-linux.yaml
parameters:
name: Edge Agent
imageName: azureiotedge-agent
project: Microsoft.Azure.Devices.Edge.Agent.Service

# Edge Hub
- template: templates/image-linux.yaml
parameters:
name: Edge Hub
imageName: azureiotedge-hub
project: Microsoft.Azure.Devices.Edge.Hub.Service

# Simulated Temperature Sensor
- template: templates/image-linux.yaml
parameters:
name: Temperature Sensor
imageName: azureiotedge-simulated-temperature-sensor
project: SimulatedTemperatureSensor

# Temperature Filter
- template: templates/image-linux.yaml
parameters:
name: Temperature Filter
imageName: azureiotedge-temperature-filter
project: TemperatureFilter

# Load Gen
- template: templates/image-linux.yaml
parameters:
name: Load Gen
imageName: azureiotedge-load-gen
project: load-gen

# Messages Analyzer
- template: templates/image-linux.yaml
parameters:
name: Messages Analyzer
imageName: azureiotedge-analyzer
project: MessagesAnalyzer

# Functions Sample
- template: templates/image-linux.yaml
parameters:
name: FunctionsSample
imageName: azureiotedge-functions-filter
project: EdgeHubTriggerCSharp

# Direct Method Sender
- template: templates/image-linux.yaml
parameters:
name: Direct Method Sender
imageName: azureiotedge-direct-method-sender
project: DirectMethodSender

# Direct Method Receiver
- template: templates/image-linux.yaml
parameters:
name: Direct Method Receiver
imageName: azureiotedge-direct-method-receiver
project: DirectMethodReceiver

################################################################################
- job: windows
################################################################################
displayName: Windows
pool:
name: Azure-IoT-Edge-Core
demands:
- Build_image -equals true
- win-rs5
variables:
NetCorePackageUri: https://download.microsoft.com/download/4/0/9/40920432-3302-47a8-b13c-bbc4848ad114/dotnet-sdk-2.1.302-win-x64.zip
steps:
- powershell: scripts/windows/setup/Install-Prerequisites.ps1 -DotnetSdkUrl $(NetCorePackageUri) -Dotnet -Nuget
name: install
displayName: Install
- powershell: scripts/windows/build/Publish-Branch.ps1 -Configuration:"Release" -PublishTests:$False -UpdateVersion
name: build
displayName: Build
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifacts'
inputs:
PathtoPublish: '$(Build.BinariesDirectory)/publish'
ArtifactName: 'core-windows'
- powershell: '"$(registry.password)" | docker login "edgebuilds.azurecr.io" -u "$(registry.user)" --password-stdin'
displayName: 'Docker Login'

# Edge Agent
- template: templates/image-windows.yaml
parameters:
name: Edge Agent
imageName: azureiotedge-agent
project: Microsoft.Azure.Devices.Edge.Agent.Service

# Edge Hub
- template: templates/image-windows.yaml
parameters:
name: Edge Hub
imageName: azureiotedge-hub
project: Microsoft.Azure.Devices.Edge.Hub.Service

# Simulated Temperature Sensor
- template: templates/image-windows.yaml
parameters:
name: Temperature Sensor
imageName: azureiotedge-simulated-temperature-sensor
project: SimulatedTemperatureSensor

# Temperature Filter
- template: templates/image-windows.yaml
parameters:
name: Temperature Filter
imageName: azureiotedge-temperature-filter
project: TemperatureFilter

# Functions Sample
- template: templates/image-windows.yaml
parameters:
name: FunctionsSample
imageName: azureiotedge-functions-filter
project: EdgeHubTriggerCSharp
arm32v7: 'false'

# Direct Method Sender
- template: templates/image-windows.yaml
parameters:
name: Direct Method Sender
imageName: azureiotedge-direct-method-sender
project: DirectMethodSender

# Direct Method Receiver
- template: templates/image-windows.yaml
parameters:
name: Direct Method Receiver
imageName: azureiotedge-direct-method-receiver
project: DirectMethodReceiver

- powershell: docker system prune -a -f
displayName: Clean Machine

################################################################################
- job: manifest
################################################################################
displayName: Manifest
pool:
vmImage: 'ubuntu-16.04'
dependsOn:
- linux
- windows
variables:
tags: "['latest']"
steps:
- script: scripts/linux/buildManifest.sh -r $(registry.address) -u $(registry.user) -p $(registry.password) -v $(Build.BuildNumber) -t $(System.DefaultWorkingDirectory)/edge-agent/docker/manifest.yaml.template -n microsoft --tags "$(tags)"
displayName: 'Publish Edge Agent Manifest'
- script: scripts/linux/buildManifest.sh -r $(registry.address) -u $(registry.user) -p $(registry.password) -v $(Build.BuildNumber) -t $(System.DefaultWorkingDirectory)/edge-hub/docker/manifest.yaml.template -n microsoft --tags "$(tags)"
displayName: 'Publish Edge Hub Manifest'
- script: scripts/linux/buildManifest.sh -r $(registry.address) -u $(registry.user) -p $(registry.password) -v $(Build.BuildNumber) -t $(System.DefaultWorkingDirectory)/edge-modules/SimulatedTemperatureSensor/docker/manifest.yaml.template -n microsoft --tags "$(tags)"
displayName: 'Publish Temperature Sensor Manifest'
17 changes: 17 additions & 0 deletions builds/misc/templates/image-linux.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
parameters:
name: ''
imageName: ''
namespace: 'microsoft'
project: ''

steps:
- task: Bash@3
displayName: Build Image - ${{ parameters.name }} - amd64
inputs:
filePath: scripts/linux/buildImage.sh
arguments: -r $(registry.address) -u $(registry.user) -p $(registry.password) -i ${{ parameters.imageName }} -n ${{ parameters.namespace }} -P ${{ parameters.project }}
- task: Bash@3
displayName: Build Image - ${{ parameters.name }} - arm32
inputs:
filePath: scripts/linux/buildImage.sh
arguments: -r $(registry.address) -u $(registry.user) -p $(registry.password) -i ${{ parameters.imageName }} -n ${{ parameters.namespace }} -P ${{ parameters.project }} --target-arch armv7l
13 changes: 13 additions & 0 deletions builds/misc/templates/image-windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
parameters:
name: ''
imageName: ''
namespace: 'microsoft'
project: ''
arm32v7: 'true'

steps:
- powershell: scripts/windows/build/Publish-DockerImage.ps1 -Name "${{ parameters.imageName }}" -Project "${{ parameters.project }}" -Version $(Build.BuildNumber) -Registry $(registry.address) -Namespace "${{ parameters.namespace }}" -Push
displayName: Build Image - ${{ parameters.name }} - amd64
- powershell: scripts/windows/build/Publish-DockerImage.ps1 -Name "${{ parameters.imageName }}" -Project "${{ parameters.project }}" -Version $(Build.BuildNumber) -Registry $(registry.address) -Namespace "${{ parameters.namespace }}" -Architecture "arm32v7" -Push
displayName: Build Image - ${{ parameters.name }} - arm32
condition: eq('${{ parameters.arm32v7 }}', 'true')

0 comments on commit e85bc9d

Please sign in to comment.