Skip to content

Commit 878612f

Browse files
PIE Easy StartKotanaSai21
PIE Easy Start
authored andcommitted
Merged PR 309731: Adding OneBranch pipeline YAML config file for powerbi-javascript-Buddy
Generate OneBranch Pipeline YAML config files. This pull request is initially auto-generated by Easy Start, for more details, please visit our [wiki](https://aka.ms/easystart). **Difference Compared to powerbi-models repo PR:** 1. In the PR of powerbi-models, we ran power script files in CmdLine@2 using onebranch_run_ps.cmd file. But after May comment, in all the following PR we are using PowerShell@2 task to run our power script files and deleted onebranch_run_ps.cmd file. 2. In powerbi-javascript we also have a task to copy source artifacts to Output folder. Took a reference of this task from CDPx pipelines 3. We also have nuget_pack, so Added nugetInstaller task and to run nuget_pack.ps file and copy nugetpack to output folder **Result of OneBranch Buddy Pipeline** https://dev.azure.com/powerbi/Embedded/_build/results?buildId=5886126&view=results **Drop Folder from OneBranch** ![image (3).png](https://dev.azure.com/powerbi/4c7b5adb-c2d0-4f18-b23c-edc4ac30f4e1/_apis/git/repositories/1dd63332-e003-46a3-ac6f-70213a1bcc2e/pullRequests/309731/attachments/image%20%283%29.png) **Drop Folder from CDPx** ![image (2).png](https://dev.azure.com/powerbi/4c7b5adb-c2d0-4f18-b23c-edc4ac30f4e1/_apis/git/repositories/1dd63332-e003-46a3-ac6f-70213a1bcc2e/pullRequests/309731/attachments/image%20%282%29.png)
1 parent 402c513 commit 878612f

File tree

5 files changed

+178
-124
lines changed

5 files changed

+178
-124
lines changed

.pipelines/OneBranch.Buddy.yml

+174
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
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)'

.pipelines/cdpx_run_ps.cmd

-6
This file was deleted.

.pipelines/nuget_pack.ps1

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Write-Host "Start running nuget_pack.ps1"
22

3-
$versionNumber = [Environment]::GetEnvironmentVariable("CustomBuildNumber", "User");
3+
$versionNumber = (Get-Content "package.json") -join "`n" | ConvertFrom-Json | Select -ExpandProperty "version"
44
$exitCode = 0;
55

6-
Write-Host "Nuget Pack ..\PowerBI.JavaScript.nuspec -Version "$versionNumber
7-
& nuget pack "..\PowerBI.JavaScript.nuspec" -Version $versionNumber
6+
Write-Host "Nuget Pack PowerBI.JavaScript.nuspec -Version "$versionNumber
7+
& nuget pack "PowerBI.JavaScript.nuspec" -Version $versionNumber
88

99
$exitCode += $LASTEXITCODE;
1010

.pipelines/pipeline.user.windows.yml

-113
This file was deleted.

.pipelines/version.ps1

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ try {
55

66
Write-Host "Build Number is" $buildNumber
77

8-
[Environment]::SetEnvironmentVariable("CustomBuildNumber", $buildNumber, "User") # This will allow you to use it from env var in later steps of the same phase
9-
Write-Host "##vso[build.updatebuildnumber]${buildNumber}" # This will update build number on your build
8+
Write-Host "##vso[task.setvariable variable=CustomBuildNumber]${buildNumber}" # This will allow you to use it from env var in later steps of the same phase
109
}
1110
catch {
1211
Write-Error $_.Exception

0 commit comments

Comments
 (0)