# # Copyright 2021 Ettus Research, a National Instruments Brand # # SPDX-License-Identifier: LGPL-3.0-or-later # trigger: branches: include: - UHD-4.2 paths: include: - .ci/docker - .ci/uhd-build-docker-container.yml pr: branches: include: - UHD-4.2 paths: include: - .ci/docker - .ci/uhd-build-docker-container.yml schedules: - cron: "0 18 * * SAT" displayName: Weekly Docker Build master branch branches: include: - master always: true - cron: "0 22 * * SAT" displayName: Weekly Docker Build UHD-4.1 branch branches: include: - UHD-4.1 always: true - cron: "0 2 * * SUN" displayName: Weekly Docker Build UHD-4.2 branch branches: include: - UHD-4.2 always: true variables: - template: uhd-pipeline-vars.yml - name: linuxDockerImages value: "{'Fedora-34-builder':{'buildOSName':'fedora34','dockerImageName':'uhd-builder-fedora34'}, 'Fedora-35-builder':{'buildOSName':'fedora35','dockerImageName':'uhd-builder-fedora35'}, 'Ubuntu-1804-builder':{'buildOSName':'ubuntu1804','dockerImageName':'uhd-builder-ubuntu1804'}, 'Ubuntu-2004-builder':{'buildOSName':'ubuntu2004','dockerImageName':'uhd-builder-ubuntu2004'}, 'Ubuntu-2204-builder':{'buildOSName':'ubuntu2204','dockerImageName':'uhd-builder-ubuntu2204'}}" - name: winDockerImages value: "{'VS2017-x86-builder':{'buildOSName':'win-vs17-v141-x86','dockerImageName':'uhd-builder-vs2017-v141-x86','cmakeCompiler':'Visual Studio 15 2017','cmakeArch':'Win32','vsArch':'x86','vsYear':'2017'}, 'VS2017-x64-builder':{'buildOSName':'win-vs17-v141-x64','dockerImageName':'uhd-builder-vs2017-v141-x64','cmakeCompiler':'Visual Studio 15 2017','cmakeArch':'x64','vsArch':'x64','vsYear':'2017'}, 'VS2019-x86-builder':{'buildOSName':'win-vs19-v142-x86','dockerImageName':'uhd-builder-vs2019-v142-x86','cmakeCompiler':'Visual Studio 16 2019','cmakeArch':'Win32','vsArch':'x86','vsYear':'2019'}, 'VS2019-x64-builder':{'buildOSName':'win-vs19-v142-x64','dockerImageName':'uhd-builder-vs2019-v142-x64','cmakeCompiler':'Visual Studio 16 2019','cmakeArch':'x64','vsArch':'x64','vsYear':'2019'}}" - name: ubuntuDebDockerImages # Match with Ubuntu images in linuxDockerImages value: "{'Ubuntu-1804-builder':{'buildOSName':'ubuntu1804','dockerImageName':'uhd-builder-ubuntu1804','ubuntuReleaseName':'bionic'}, 'Ubuntu-2004-builder':{'buildOSName':'ubuntu2004','dockerImageName':'uhd-builder-ubuntu2004','ubuntuReleaseName':'focal'}, 'Ubuntu-2204-builder':{'buildOSName':'ubuntu2204','dockerImageName':'uhd-builder-ubuntu2204','ubuntuReleaseName':'jammy'}}" - name: fedoraRpmDockerImages # Match with Fedora images in linuxDockerImages value: "{'Fedora-34-builder':{'buildOSName':'fedora34','dockerImageName':'uhd-builder-fedora34','fedoraReleaseName':'34'}, 'Fedora-35-builder':{'buildOSName':'fedora35','dockerImageName':'uhd-builder-fedora35','fedoraReleaseName':'35'}}" - name: macOSBuilders value: "{'macOS-12-x64':{'buildOSName':'macOS-12-x64', 'macOSVersionDemand':'12', 'macOSArchDemand': 'X64'}}" - name: sourcePackageBuilders # Match with one of the Ubuntu images in linuxDockerImages value: "{'Ubuntu-2004-builder':{'buildOSName':'ubuntu2004','dockerImageName':'uhd-builder-ubuntu2004','ubuntuReleaseName':'focal'}}" - name: dockerImagePrefix value: 'rfsdr/' jobs: - job: build_image_linux displayName: Build Docker Image pool: name: Drivers-NIBuildFarm-RFMIBUILD demands: - agent.os -equals Linux - docker strategy: matrix: $[ variables.linuxDockerImages ] steps: - checkout: self clean: true - task: Docker@2 displayName: Build Image inputs: command: 'build' Dockerfile: '$(Build.SourcesDirectory)/.ci/docker/$(dockerImageName).Dockerfile' containerRegistry: 'Docker / Artifactory - rnd-builds-local' repository: '$(dockerImagePrefix)$(dockerImageName)' tags: $(Build.BuildNumber) arguments: --no-cache --pull - task: Docker@2 displayName: Push Image inputs: command: 'push' containerRegistry: 'Docker / Artifactory - rnd-builds-local' repository: '$(dockerImagePrefix)$(dockerImageName)' tags: $(Build.BuildNumber) - job: test_image_linux displayName: Test Docker Image dependsOn: build_image_linux pool: name: Drivers-NIBuildFarm-RFMIBUILD demands: - agent.os -equals Linux - docker strategy: matrix: $[ variables.linuxDockerImages ] container: image: '$(dockerImagePrefix)$(dockerImageName):$(Build.BuildNumber)' endpoint: 'Docker / Artifactory - rnd-builds-local' workspace: clean: outputs steps: - checkout: self clean: true - script: | cd $(Build.BinariesDirectory) mkdir -p uhddev/build cd uhddev/build cmake $(Build.SourcesDirectory)/host displayName: Test image with cmake uhd - script: | cd $(Build.BinariesDirectory) mkdir -p uhddev/build-ninja cd uhddev/build-ninja cmake -G Ninja $(Build.SourcesDirectory)/host displayName: Test image with cmake ninja uhd - job: build_image_win displayName: Build Docker Image Windows timeoutInMinutes: 120 pool: name: de-dre-lab demands: - agent.os -equals Windows_NT - docker strategy: matrix: $[ variables.winDockerImages ] maxParallel: 2 steps: - checkout: self clean: true - task: Docker@2 displayName: Build Image inputs: command: 'build' Dockerfile: '$(Build.SourcesDirectory)/.ci/docker/$(dockerImageName).Dockerfile' containerRegistry: 'Docker / Artifactory - rnd-builds-local' repository: '$(dockerImagePrefix)$(dockerImageName)' tags: $(Build.BuildNumber) buildContext: $(Build.SourcesDirectory) arguments: --no-cache --pull - task: Docker@2 displayName: Push Image inputs: command: 'push' containerRegistry: 'Docker / Artifactory - rnd-builds-local' repository: '$(dockerImagePrefix)$(dockerImageName)' tags: $(Build.BuildNumber) - job: test_image_win displayName: Test Docker Image Windows dependsOn: build_image_win pool: name: de-dre-lab demands: - agent.os -equals Windows_NT - docker strategy: matrix: $[ variables.winDockerImages ] container: image: '$(dockerImagePrefix)$(dockerImageName):$(Build.BuildNumber)' endpoint: 'Docker / Artifactory - rnd-builds-local' workspace: clean: outputs steps: - checkout: self clean: true - script: | cd $(Build.BinariesDirectory) mkdir uhddev\build cd uhddev\build cmake $(Build.SourcesDirectory)/host ^ -DVCPKG_TARGET_TRIPLET=uhd-$(vsArch)-windows-static-md ^ -DCMAKE_TOOLCHAIN_FILE=%VCPKG_INSTALL_DIR%\scripts\buildsystems\vcpkg.cmake ^ -G "$(cmakeCompiler)" -A $(cmakeArch) displayName: Test image with cmake uhd - script: | cd $(Build.BinariesDirectory) cd uhddev\build "C:\Program Files (x86)\Microsoft Visual Studio\$(vsYear)\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" $(vsArch) displayName: Load Visual C++ Env - job: export_build_number displayName: Export Image List to Artifacts pool: name: Drivers-NIBuildFarm-RFMIBUILD demands: sh steps: - checkout: none - script: | cd $(Build.ArtifactStagingDirectory) touch $(UHDPipelineDockerImageArtifactName) echo "$(Build.BuildNumber)" > $(UHDPipelineDockerImageArtifactName) echo "${{ variables.dockerImagePrefix }}" >> $(UHDPipelineDockerImageArtifactName) echo "${{ variables.linuxDockerImages }}" >> $(UHDPipelineDockerImageArtifactName) echo "${{ variables.winDockerImages }}" >> $(UHDPipelineDockerImageArtifactName) echo "${{ variables.ubuntuDebDockerImages }}" >> $(UHDPipelineDockerImageArtifactName) echo "${{ variables.macOSBuilders }}" >> $(UHDPipelineDockerImageArtifactName) echo "${{ variables.sourcePackageBuilders }}" >> $(UHDPipelineDockerImageArtifactName) echo "${{ variables.fedoraRpmDockerImages }}" >> $(UHDPipelineDockerImageArtifactName) displayName: Generate created image list - task: PublishPipelineArtifact@1 inputs: targetPath: $(Build.ArtifactStagingDirectory) artifactName: $(UHDPipelineDockerImageArtifactName) displayName: Upload image list artifact