Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
183 views
in Technique[技术] by (71.8m points)

Azure pipeline for mutiple os in same time

I have problem as i have no clue how to solve that, what i like to do is soem like this:

for each OS run: template 1 -> template 2

As for now all pipeline jobs are build one after another - but is take a while to build, is any way to improve speed of jobs, that will be able to run on mutiple OS in same time?

# Build jobs
jobs:

# Windows
- job: Windows_Init
  pool:
    vmImage: 'windows-latest'
  steps:
  - template: ci/windows_init.yml
- job: Windows_Build
  pool:
    vmImage: 'windows-latest'
  dependsOn:
    Windows_Init
  steps:
  - template: ci/windows_build.yml

# MacOS
- job: MacOS_Init
  pool:
    vmImage: 'macOS-latest'
  steps:
  - template: ci/macos_init.yml
- job: MacOS_Build
  pool:
    vmImage: 'macOS-latest'
  dependsOn:
    MacOS_Init
  steps:
  - template: ci/macos_build.yml

# Linux
- job: Linux_Init
  pool:
    vmImage: 'ubuntu-latest'
  steps:
  - template: ci/linux_init.yml
- job: Linux_Build
  pool:
    vmImage: 'ubuntu-latest'
  dependsOn:
    Linux_Init
  steps:
  - template: ci/linux_build.yml
question from:https://stackoverflow.com/questions/66064215/azure-pipeline-for-mutiple-os-in-same-time

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Use stages running in parallel (keyword -> dependsOn: [])

https://docs.microsoft.com/en-us/azure/devops/pipelines/process/stages?view=azure-devops&tabs=yaml#specify-dependencies

stages:
- stage: Ubuntu
  jobs:
  # Linux
  - job: Linux_Init
    pool:
      vmImage: 'ubuntu-latest'
    steps:
    - template: ci/linux_init.yml
  - job: Linux_Build
    pool:
      vmImage: 'ubuntu-latest'
    dependsOn:
      Linux_Init
    steps:
    - template: ci/linux_build.yml

- stage: MacOS
  dependsOn: []
  jobs:
  - job: MacOS_Init
    pool: (...)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...