From ebf7290b6dbccf2920b2b41102976764c71ad9d0 Mon Sep 17 00:00:00 2001 From: Kotana Sai Date: Mon, 2 Jan 2023 07:54:31 +0000 Subject: [PATCH] Merged PR 333894: Update Windows Container Image for powerbi-models Related work items: #964642 --- .pipelines/OneBranch.Buddy.yml | 71 ++++++++++++++++--------------- .pipelines/OneBranch.Official.yml | 45 +++++++++----------- .pipelines/onebranch_run_ps.cmd | 6 --- 3 files changed, 57 insertions(+), 65 deletions(-) delete mode 100644 .pipelines/onebranch_run_ps.cmd diff --git a/.pipelines/OneBranch.Buddy.yml b/.pipelines/OneBranch.Buddy.yml index 9dc4384..6247562 100644 --- a/.pipelines/OneBranch.Buddy.yml +++ b/.pipelines/OneBranch.Buddy.yml @@ -17,15 +17,14 @@ parameters: # parameters are shown up in ADO UI in a build queue time default: false variables: - CDP_DEFINITION_BUILD_COUNT: $[counter('', 0)] # needed for onebranch.pipeline.version task https://aka.ms/obpipelines/versioning system.debug: ${{ parameters.debug }} ENABLE_PRS_DELAYSIGN: 1 ROOT: $(Build.SourcesDirectory) REPOROOT: $(Build.SourcesDirectory) OUTPUTROOT: $(REPOROOT)\out - NUGET_XMLDOC_MODE: none + NUGET_XMLDOC_MODE: skip - WindowsContainerImage: 'cdpxwin1809.azurecr.io/global/obinfra/windows/1809/vs2019:latest' # Docker image which is used to build the project https://aka.ms/obpipelines/containers + WindowsContainerImage: 'onebranch.azurecr.io/windows/ltsc2019/vse2022:latest' # Docker image which is used to build the project https://aka.ms/obpipelines/containers resources: repositories: @@ -58,10 +57,11 @@ extends: steps: # Custom Versioning - we will build the version using package.json in versioning commands. - - task: CmdLine@2 + - task: PowerShell@2 displayName: 'Set Version' inputs: - script: '$(Build.SourcesDirectory)\.pipelines\onebranch_run_ps.cmd version.ps1' + targetType: 'filePath' + filePath: '$(Build.SourcesDirectory)\.pipelines\version.ps1' workingDirectory: '$(Build.SourcesDirectory)' # Add the versioning task after running Version script @@ -80,27 +80,47 @@ extends: inputs: workingFile: '$(Build.SourcesDirectory)\.npmrc' - # Commands to run during the restore stage - - task: CmdLine@2 + - task: PowerShell@2 displayName: 'Restore' inputs: - script: '$(Build.SourcesDirectory)\.pipelines\onebranch_run_ps.cmd restore.ps1' + targetType: 'filePath' + filePath: '$(Build.SourcesDirectory)\.pipelines\restore.ps1' workingDirectory: '$(Build.SourcesDirectory)' - # Commands to run during the build stage. - - task: CmdLine@2 + - task: PowerShell@2 displayName: 'Build' inputs: - script: '$(Build.SourcesDirectory)\.pipelines\onebranch_run_ps.cmd build.ps1' + targetType: 'filePath' + filePath: '$(Build.SourcesDirectory)\.pipelines\build.ps1' workingDirectory: '$(Build.SourcesDirectory)' - # Commands to run during the packaging stage. - - task: CmdLine@2 + - task: PowerShell@2 displayName: 'Package' inputs: - script: '$(Build.SourcesDirectory)\.pipelines\onebranch_run_ps.cmd package.ps1' + targetType: 'filePath' + filePath: '$(Build.SourcesDirectory)\.pipelines\package.ps1' workingDirectory: '$(Build.SourcesDirectory)' + # Copying build artifacts to the Output folder. + - task: CopyFiles@2 + displayName: 'Copy Dist to Output folder' + inputs: + SourceFolder: '$(Build.SourcesDirectory)' + Contents: | + dist\**\* + LICENSE.txt + package.json + README.md + TargetFolder: '$(OUTPUTROOT)\outputs\build\build_artifacts' + + - task: CopyFiles@2 + displayName: 'Copy tgz-package to Output folder' + inputs: + SourceFolder: '$(Build.SourcesDirectory)' + Contents: | + *.tgz + TargetFolder: '$(OUTPUTROOT)\outputs\package\tgz-package' + # Signing the files created by the build and packaging script - task: onebranch.pipeline.signing@1 displayName: 'Sign binaries' @@ -108,24 +128,5 @@ extends: command: 'sign' signing_environment: 'azure-ado' signing_profile: 'internal_azure_service' - files_to_sign: 'dist\**\*;LICENSE.txt;package.json;README.md;**\*.tgz' - search_root: '$(Build.SourcesDirectory)' - - # Copying build artifacts to the Output folder. - - task: CopyFiles@2 - displayName: 'Copy Dist to Output folder' - inputs: - Contents: | - $(Build.SourcesDirectory)\dist\**\* - $(Build.SourcesDirectory)\LICENSE.txt - $(Build.SourcesDirectory)\package.json - $(Build.SourcesDirectory)\README.md - TargetFolder: '$(OUTPUTROOT)\outputs\build\build_artifacts' - - # Copying tgz package to the Output folder. - - task: CopyFiles@2 - displayName: 'Copy tgz-package to Output folder' - inputs: - Contents: | - $(Build.SourcesDirectory)\*.tgz - TargetFolder: '$(OUTPUTROOT)\outputs\package\tgz-package' \ No newline at end of file + files_to_sign: '**' + search_root: '$(OUTPUTROOT)' \ No newline at end of file diff --git a/.pipelines/OneBranch.Official.yml b/.pipelines/OneBranch.Official.yml index 8d877c5..1119484 100644 --- a/.pipelines/OneBranch.Official.yml +++ b/.pipelines/OneBranch.Official.yml @@ -17,15 +17,18 @@ parameters: # parameters are shown up in ADO UI in a build queue time default: false variables: - CDP_DEFINITION_BUILD_COUNT: $[counter('', 0)] # needed for onebranch.pipeline.version task https://aka.ms/obpipelines/versioning system.debug: ${{ parameters.debug }} ENABLE_PRS_DELAYSIGN: 1 ROOT: $(Build.SourcesDirectory) REPOROOT: $(Build.SourcesDirectory) OUTPUTROOT: $(REPOROOT)\out NUGET_XMLDOC_MODE: skip + ${{ if eq(variables['Build.DefinitionName'], 'powerbi-models-Official') }}: + obpTemplate: v2/OneBranch.Official.CrossPlat.yml@templates # https://aka.ms/obpipelines/templates + ${{ else }}: + obpTemplate: v2/OneBranch.NonOfficial.CrossPlat.yml@templates # https://aka.ms/obpipelines/templates - WindowsContainerImage: 'cdpxwin1809.azurecr.io/global/obinfra/windows/1809/vs2019:latest' # Docker image which is used to build the project https://aka.ms/obpipelines/containers + WindowsContainerImage: 'onebranch.azurecr.io/windows/ltsc2019/vse2022:latest' # Docker image which is used to build the project https://aka.ms/obpipelines/containers resources: repositories: @@ -35,10 +38,8 @@ resources: ref: refs/heads/main extends: - template: v2/OneBranch.Official.CrossPlat.yml@templates # https://aka.ms/obpipelines/templates + template: ${{ variables.obpTemplate }} parameters: - cloudvault: # https://aka.ms/obpipelines/cloudvault - enabled: false globalSdl: # https://aka.ms/obpipelines/sdl tsa: enabled: false # onebranch publish all sdl results to TSA. If TSA is disabled all SDL tools will forced into 'break' build mode. @@ -52,11 +53,9 @@ extends: pool: type: windows # read more about custom job pool types at https://aka.ms/obpipelines/yaml/jobs - variables: + variables: # More settings at https://aka.ms/obpipelines/yaml/jobs ob_outputDirectory: '$(OUTPUTROOT)' # this directory is uploaded to pipeline artifacts, reddog and cloudvault. More info at https://aka.ms/obpipelines/artifacts ob_sdl_binskim_break: true # https://aka.ms/obpipelines/sdl - ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/master') }}: # conditionally enable symbolsPublishing for master branch only - ob_symbolsPublishing_enabled: true # https://aka.ms/obpipelines/symbols ob_artifactBaseName: 'drop' ob_sdl_cg_failOnAlert: false @@ -85,7 +84,6 @@ extends: inputs: workingFile: '$(Build.SourcesDirectory)\.npmrc' - - task: PowerShell@2 displayName: 'Restore' inputs: @@ -107,21 +105,11 @@ extends: filePath: '$(Build.SourcesDirectory)\.pipelines\package.ps1' workingDirectory: '$(Build.SourcesDirectory)' - # Signing the files created by the build and packaging script - - task: onebranch.pipeline.signing@1 - displayName: 'Sign binaries' - inputs: - command: 'sign' - signing_environment: 'azure-ado' - signing_profile: 'internal_azure_service' - files_to_sign: 'dist\**\*;LICENSE.txt;package.json;README.md;**\*.tgz' - search_root: '$(Build.SourcesDirectory)' - # Copying build artifacts to the Output folder. - task: CopyFiles@2 displayName: 'Copy Dist to Output folder' inputs: - SourceFolder: $(Build.SourcesDirectory) + SourceFolder: '$(Build.SourcesDirectory)' Contents: | dist\**\* LICENSE.txt @@ -129,11 +117,20 @@ extends: README.md TargetFolder: '$(OUTPUTROOT)\outputs\build\build_artifacts' - # Copying tgz package to the Output folder. - task: CopyFiles@2 displayName: 'Copy tgz-package to Output folder' inputs: - SourceFolder: $(Build.SourcesDirectory) + SourceFolder: '$(Build.SourcesDirectory)' Contents: | - **\*.tgz - TargetFolder: '$(OUTPUTROOT)\outputs\package\tgz-package' \ No newline at end of file + *.tgz + TargetFolder: '$(OUTPUTROOT)\outputs\package\tgz-package' + + # Signing the files created by the build and packaging script + - task: onebranch.pipeline.signing@1 + displayName: 'Sign binaries' + inputs: + command: 'sign' + signing_environment: 'azure-ado' + signing_profile: 'internal_azure_service' + files_to_sign: '**' + search_root: '$(OUTPUTROOT)' \ No newline at end of file diff --git a/.pipelines/onebranch_run_ps.cmd b/.pipelines/onebranch_run_ps.cmd deleted file mode 100644 index 64ddad9..0000000 --- a/.pipelines/onebranch_run_ps.cmd +++ /dev/null @@ -1,6 +0,0 @@ -setlocal enabledelayedexpansion -pushd "%~dp0\.." -powershell.exe -ExecutionPolicy Unrestricted -NoProfile -WindowStyle Hidden -NonInteractive -File "%~dp0%~1" -endlocal -popd -exit /B %ERRORLEVEL%