| 
 | 1 | +#################################################################################  | 
 | 2 | +#   Onebranch Pipelines - Buddy MSBuild (CDPXMigrated)                          #  | 
 | 3 | +# This pipeline was created by EasyStart from a sample located at:              #  | 
 | 4 | +#   https://aka.ms/obpipelines/easystart/samples                                #  | 
 | 5 | +# Documentation:  https://aka.ms/obpipelines                                    #  | 
 | 6 | +# Yaml Schema:    https://aka.ms/obpipelines/yaml/schema                        #  | 
 | 7 | +# Retail Tasks:   https://aka.ms/obpipelines/tasks                              #  | 
 | 8 | +# Support:        https://aka.ms/onebranchsup                                   #  | 
 | 9 | +#################################################################################  | 
 | 10 | + | 
 | 11 | +trigger: none # https://aka.ms/obpipelines/triggers  | 
 | 12 | + | 
 | 13 | +parameters: # parameters are shown up in ADO UI in a build queue time  | 
 | 14 | +- name: 'debug'  | 
 | 15 | +  displayName: 'Enable debug output'  | 
 | 16 | +  type: boolean  | 
 | 17 | +  default: false  | 
 | 18 | + | 
 | 19 | +variables:  | 
 | 20 | +  CDP_DEFINITION_BUILD_COUNT: $[counter('', 0)] # needed for onebranch.pipeline.version task https://aka.ms/obpipelines/versioning  | 
 | 21 | +  system.debug: ${{ parameters.debug }}  | 
 | 22 | +  ENABLE_PRS_DELAYSIGN: 1  | 
 | 23 | +  ROOT: $(Build.SourcesDirectory)  | 
 | 24 | +  REPOROOT: $(Build.SourcesDirectory)  | 
 | 25 | +  OUTPUTROOT: $(REPOROOT)\out  | 
 | 26 | +  NUGET_XMLDOC_MODE: skip  | 
 | 27 | + | 
 | 28 | +  WindowsContainerImage: 'cdpxwin1809.azurecr.io/global/obinfra/windows/1809/vs2019:latest' # Docker image which is used to build the project https://aka.ms/obpipelines/containers  | 
 | 29 | + | 
 | 30 | +resources:  | 
 | 31 | +  repositories:  | 
 | 32 | +    - repository: templates  | 
 | 33 | +      type: git  | 
 | 34 | +      name: OneBranch.Pipelines/GovernedTemplates  | 
 | 35 | +      ref: refs/heads/main  | 
 | 36 | + | 
 | 37 | +extends:  | 
 | 38 | +  template: v2/OneBranch.NonOfficial.CrossPlat.yml@templates # https://aka.ms/obpipelines/templates  | 
 | 39 | +  parameters:  | 
 | 40 | +    globalSdl: # https://aka.ms/obpipelines/sdl  | 
 | 41 | +      tsa:  | 
 | 42 | +        enabled: false # onebranch publish all sdl results to TSA. If TSA is disabled all SDL tools will forced into 'break' build mode.  | 
 | 43 | +      cg:  | 
 | 44 | +        failOnAlert: false  | 
 | 45 | + | 
 | 46 | +    stages:  | 
 | 47 | +    - stage: build  | 
 | 48 | +      jobs:  | 
 | 49 | +      - job: main  | 
 | 50 | +        pool:  | 
 | 51 | +          type: windows  # read more about custom job pool types at https://aka.ms/obpipelines/yaml/jobs  | 
 | 52 | + | 
 | 53 | +        variables: # More settings at https://aka.ms/obpipelines/yaml/jobs  | 
 | 54 | +          ob_outputDirectory: '$(OUTPUTROOT)' # this directory is uploaded to pipeline artifacts, reddog and cloudvault. More info at https://aka.ms/obpipelines/artifacts  | 
 | 55 | +          ob_sdl_binskim_break: true # https://aka.ms/obpipelines/sd  | 
 | 56 | +          ob_artifactBaseName: 'drop'  | 
 | 57 | +          ob_sdl_cg_failOnAlert: false  | 
 | 58 | + | 
 | 59 | +        steps:  | 
 | 60 | +          # Custom Versioning - we will build the version using package.json in versioning commands.  | 
 | 61 | +          - task: PowerShell@2  | 
 | 62 | +            displayName: 'Set Version'  | 
 | 63 | +            inputs:  | 
 | 64 | +              targetType: 'filePath'  | 
 | 65 | +              filePath: '$(Build.SourcesDirectory)\.pipelines\version.ps1'  | 
 | 66 | +              workingDirectory: '$(Build.SourcesDirectory)'  | 
 | 67 | + | 
 | 68 | +          # Add the versioning task after running Version script  | 
 | 69 | +          - task: onebranch.pipeline.version@1  | 
 | 70 | +            inputs:  | 
 | 71 | +              system: 'Custom'  | 
 | 72 | +              customVersion: '$(CustomBuildNumber)'  | 
 | 73 | + | 
 | 74 | +          - task: NodeTool@0  | 
 | 75 | +            displayName: 'Install Node.js'  | 
 | 76 | +            inputs:  | 
 | 77 | +              versionSpec: '16.x'  | 
 | 78 | + | 
 | 79 | +          - task: npmAuthenticate@0  | 
 | 80 | +            displayName: 'NPM Authenticate'  | 
 | 81 | +            inputs:  | 
 | 82 | +              workingFile: '$(Build.SourcesDirectory)/.npmrc'  | 
 | 83 | + | 
 | 84 | +          - task: PowerShell@2  | 
 | 85 | +            displayName: 'Restore'  | 
 | 86 | +            inputs:  | 
 | 87 | +              targetType: 'filePath'  | 
 | 88 | +              filePath: '$(Build.SourcesDirectory)\.pipelines\restore.ps1'  | 
 | 89 | +              workingDirectory: '$(Build.SourcesDirectory)'  | 
 | 90 | + | 
 | 91 | +          - task: PowerShell@2  | 
 | 92 | +            displayName: 'Build'  | 
 | 93 | +            inputs:  | 
 | 94 | +              targetType: 'filePath'  | 
 | 95 | +              filePath: '$(Build.SourcesDirectory)\.pipelines\build.ps1'  | 
 | 96 | +              workingDirectory: '$(Build.SourcesDirectory)'  | 
 | 97 | + | 
 | 98 | +          - task: PowerShell@2  | 
 | 99 | +            displayName: 'Package'  | 
 | 100 | +            inputs:  | 
 | 101 | +              targetType: 'filePath'  | 
 | 102 | +              filePath: '$(Build.SourcesDirectory)\.pipelines\package.ps1'  | 
 | 103 | +              workingDirectory: '$(Build.SourcesDirectory)'  | 
 | 104 | + | 
 | 105 | +          - task: NuGetToolInstaller@1  | 
 | 106 | +            displayName: 'Install Nuget'  | 
 | 107 | +            inputs:  | 
 | 108 | +              versionSpec: '*'  | 
 | 109 | +              checkLatest: true  | 
 | 110 | + | 
 | 111 | +          - task: PowerShell@2  | 
 | 112 | +            displayName: 'Nuget Package'  | 
 | 113 | +            inputs:  | 
 | 114 | +              targetType: 'filePath'  | 
 | 115 | +              filePath: '$(Build.SourcesDirectory)\.pipelines\nuget_pack.ps1'  | 
 | 116 | +              workingDirectory: '$(Build.SourcesDirectory)'  | 
 | 117 | + | 
 | 118 | +          # Copying build artifacts to the Output folder  | 
 | 119 | +          - task: CopyFiles@2  | 
 | 120 | +            displayName: 'Copy Dist to Output folder'  | 
 | 121 | +            inputs:  | 
 | 122 | +              SourceFolder: $(Build.SourcesDirectory)  | 
 | 123 | +              Contents: |  | 
 | 124 | +                dist\**\*  | 
 | 125 | +                LICENSE.txt  | 
 | 126 | +                package.json  | 
 | 127 | +                README.md  | 
 | 128 | +              TargetFolder: '$(OUTPUTROOT)\outputs\build\build_artifacts'  | 
 | 129 | + | 
 | 130 | +          # Copying source artifacts to the Output folder  | 
 | 131 | +          - task: CopyFiles@2  | 
 | 132 | +            displayName: 'Copy source to Output folder'  | 
 | 133 | +            inputs:  | 
 | 134 | +              SourceFolder: $(Build.SourcesDirectory)  | 
 | 135 | +              Contents: |  | 
 | 136 | +                **\*  | 
 | 137 | +                !**\.pipelines\**\*  | 
 | 138 | +                !**\.vscode\**\*  | 
 | 139 | +                !**\test\**\*.*  | 
 | 140 | +                !**\demo\**\*  | 
 | 141 | +                !**\dist\**\*  | 
 | 142 | +                !**\out\**\*  | 
 | 143 | +                !**\*.tgz  | 
 | 144 | +                !**\**.nupkg  | 
 | 145 | +                !**\node_modules\**\*  | 
 | 146 | +              TargetFolder: '$(OUTPUTROOT)\outputs\build\source'  | 
 | 147 | + | 
 | 148 | +          # Copying tgz package to the Output folder  | 
 | 149 | +          - task: CopyFiles@2  | 
 | 150 | +            displayName: 'Copy tgz-package to Output folder'  | 
 | 151 | +            inputs:  | 
 | 152 | +              SourceFolder: $(Build.SourcesDirectory)  | 
 | 153 | +              Contents: |  | 
 | 154 | +                *.tgz  | 
 | 155 | +              TargetFolder: '$(OUTPUTROOT)\outputs\package\tgz-package'  | 
 | 156 | + | 
 | 157 | +          # Copying nuget pack to the Output folder  | 
 | 158 | +          - task: CopyFiles@2  | 
 | 159 | +            displayName: 'Copy nuget pack to Output folder'  | 
 | 160 | +            inputs:  | 
 | 161 | +              SourceFolder: $(Build.SourcesDirectory)  | 
 | 162 | +              Contents: |  | 
 | 163 | +                Microsoft.PowerBI.JavaScript.*.nupkg  | 
 | 164 | +              TargetFolder: '$(OUTPUTROOT)\outputs\package\Release'  | 
 | 165 | + | 
 | 166 | +          # Signing the files created by the build and packaging script  | 
 | 167 | +          - task: onebranch.pipeline.signing@1  | 
 | 168 | +            displayName: 'Sign binaries'  | 
 | 169 | +            inputs:  | 
 | 170 | +              command: 'sign'  | 
 | 171 | +              signing_environment: 'azure-ado'  | 
 | 172 | +              signing_profile: 'internal_azure_service'  | 
 | 173 | +              files_to_sign: '**'  | 
 | 174 | +              search_root: '$(OUTPUTROOT)'  | 
0 commit comments