aboutsummaryrefslogtreecommitdiffstats
path: root/.ci/templates/job-uhd-build-installer.yml
blob: 1c22bf9cbe2c22ac54e26384fd5992ae8aa9e374 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
parameters:
- name: 'toolset'
  type: string
  values:
  - fedora_rpm
  - make
  - msbuild
  - ubuntu_deb
- name: 'installer'
  type: string
  values:
  - rpm # fedora_rpm
  - tar # make
  - nsis # msbuild
  - deb # ubuntu_deb
- name: releaseBinaries
  type: boolean
  default: false

jobs:
- job: build_uhd_installer_${{ parameters.toolset }}
  displayName: ${{ parameters.toolset }} UHD installer
  dependsOn: get_latest_uhd_docker
  variables:
    # Docker vars from job-get-latest-uhd-docker.yml
    dockerBuildNumber: $[ dependencies.get_latest_uhd_docker.outputs['setDockerVar.dockerBuildNumber'] ]
    dockerImagePrefix: $[ dependencies.get_latest_uhd_docker.outputs['setDockerVar.dockerImagePrefix'] ]
    dockerImageMatrixLin: $[ dependencies.get_latest_uhd_docker.outputs['setDockerVar.dockerImageMatrixLin'] ]
    dockerImageMatrixWin: $[ dependencies.get_latest_uhd_docker.outputs['setDockerVar.dockerImageMatrixWin'] ]
    dockerImageMatrixUbuntuDeb: $[ dependencies.get_latest_uhd_docker.outputs['setDockerVar.dockerImageMatrixUbuntuDeb'] ]
    macOSBuilders: $[ dependencies.get_latest_uhd_docker.outputs['setDockerVar.macOSBuilders'] ]
    dockerImageMatrixSourcePackageBuilders: $[ dependencies.get_latest_uhd_docker.outputs['setDockerVar.dockerImageMatrixSourcePackageBuilders'] ]
    dockerImageMatrixFedoraRpm: $[ dependencies.get_latest_uhd_docker.outputs['setDockerVar.dockerImageMatrixFedoraRpm'] ]
  pool:
    ${{ if eq(parameters.toolset, 'msbuild') }}:
      name: de-dre-lab
    ${{ if ne(parameters.toolset, 'msbuild') }}:
      name: Drivers-NIBuildFarm-RFMIBUILD
    demands:
      - docker
      - ${{ if eq(parameters.toolset, 'msbuild') }}:
        - Agent.OS -equals Windows_NT
      - ${{ if ne(parameters.toolset, 'msbuild') }}:
        - Agent.OS -equals Linux
  workspace:
    clean: outputs
  strategy:
    ${{ if and(eq(parameters.toolset, 'make'), eq(parameters.installer, 'tarball')) }}:
      matrix: $[ variables.dockerImageMatrixLin ]
    ${{ if and(eq(parameters.toolset, 'msbuild'), eq(parameters.installer, 'nsis')) }}:
      matrix: $[ variables.dockerImageMatrixWin ]
    ${{ if and(eq(parameters.toolset, 'ubuntu_deb'), eq(parameters.installer, 'deb')) }}:
      matrix: $[ variables.dockerImageMatrixUbuntuDeb ]
    ${{ if and(eq(parameters.toolset, 'fedora_rpm'), eq(parameters.installer, 'rpm')) }}:
      matrix: $[ variables.dockerImageMatrixFedoraRpm ]
  container:
    image: '$(dockerImagePrefix)$(DockerImageName):$(dockerBuildNumber)'
    endpoint: 'Docker / Artifactory - rnd-builds-local'
    ${{ if eq(parameters.toolset, 'ubuntu_deb') }}:
      #pbuilder requires access to /proc
      options: --privileged
  steps:
  - checkout: self
    clean: true

  - download: uhd_build_docker_container
  - ${{ if eq(parameters.toolset, 'fedora_rpm') }}:
    - template: steps-build-uhd-installer-fedora-rpm.yml
      parameters:
        uhdSrcDir: $(Build.SourcesDirectory)
        uhdBuildDir: $(Build.BinariesDirectory)/uhddev/build
        uhdInstallerDir: $(Build.BinariesDirectory)/uhddev-installer
        fedoraReleaseName: $(fedoraReleaseName)
        releaseBinaries: ${{ parameters.releaseBinaries }}
  - ${{ if eq(parameters.toolset, 'ubuntu_deb') }}:
    - template: steps-build-uhd-installer-ubuntu-deb.yml
      parameters:
        uhdSrcDir: $(Build.SourcesDirectory)
        uhdInstallerDir: $(Build.BinariesDirectory)/uhddev-installer
        ubuntuReleaseName: $(ubuntuReleaseName)
  - ${{ if and(ne(parameters.toolset, 'ubuntu_deb'), ne(parameters.toolset, 'fedora_rpm')) }}:
    - download: current
      artifact: uhddev-$(buildOSName)-${{ parameters.toolset }}
      displayName: Download pipeline artifact uhddev-$(buildOSName)-${{ parameters.toolset }}
    - task: ExtractFiles@1
      inputs:
        archiveFilePatterns: $(Pipeline.Workspace)/uhddev-$(buildOSName)-${{ parameters.toolset }}/uhddev-$(buildOSName)-${{ parameters.toolset }}.tar.gz
        destinationFolder: $(Build.BinariesDirectory)
        cleanDestinationFolder: true
  - ${{ if and(eq(parameters.toolset, 'msbuild'), eq(parameters.installer, 'nsis')) }}:
    - template: steps-build-uhd-installer-msbuild-nsis.yml
      parameters:
        uhdSrcDir: $(Build.SourcesDirectory)
        uhdBuildDir: $(Build.BinariesDirectory)\\uhddev\\build
        uhdInstallerDir: $(Build.BinariesDirectory)\\uhddev-installer
        cmakeCompiler: $(cmakeCompiler)
        cmakeArch: $(cmakeArch)
        vsArch: $(vsArch)
        vsYear: $(vsYear)
  - task: PublishPipelineArtifact@1
    inputs:
      targetPath: '$(Build.BinariesDirectory)/uhddev-installer'
      artifactName: 'uhddev-$(buildOSName)-${{ parameters.toolset }}-${{ parameters.installer }}-installer'
    displayName: Upload uhd installer artifact