|
1 |
| -jobs: |
2 |
| -- job: BuildAndTestJob |
3 |
| - displayName: Build and Test |
4 |
| - variables: |
5 |
| - - name: GitVersion.SemVer |
6 |
| - value: '' |
7 |
| - - name: solution |
8 |
| - value: '**/*.sln' |
9 |
| - - name: buildPlatform |
10 |
| - value: 'anycpu' |
11 |
| - - name: buildConfiguration |
12 |
| - value: 'Release' |
13 |
| - - group: Cap Dev - CI |
14 |
| - steps: |
15 |
| - |
16 |
| - - task: gitversion/setup@0 |
17 |
| - displayName: Install GitVersion |
18 |
| - inputs: |
19 |
| - versionSpec: '5.x' |
20 |
| - |
21 |
| - - task: gitversion/execute@0 |
22 |
| - displayName: Execute GitVersion |
23 |
| - inputs: |
24 |
| - useConfigFile: true |
25 |
| - configFilePath: '$(Build.SourcesDirectory)\GitVersion.yml' |
26 |
| - updateAssemblyInfo: false |
27 |
| - |
28 |
| - - pwsh: Write-Host "##vso[task.setvariable variable=SemVer;isOutput=true]$(GitVersion.SemVer)" |
29 |
| - name: OutputSemVerTask |
30 |
| - displayName: Output SemVer |
31 |
| - |
32 |
| - - task: DotNetCoreCLI@2 |
33 |
| - displayName: Restore NuGet packages |
34 |
| - inputs: |
35 |
| - command: restore |
36 |
| - projects: '**/*.csproj' |
37 |
| - |
38 |
| - - task: SonarCloudPrepare@1 |
39 |
| - displayName: Prepare SonarCloud |
40 |
| - inputs: |
41 |
| - SonarCloud: 'SonarCloud' |
42 |
| - organization: 'capgemini-1' |
43 |
| - scannerMode: 'MSBuild' |
44 |
| - projectKey: 'Capgemini_xrm-packagedeployer' |
45 |
| - projectName: 'xrm-packagedeployer' |
46 |
| - projectVersion: '$(GitVersion.SemVer)' |
47 |
| - extraProperties: | |
48 |
| - sonar.exclusions=**\*.css |
| 1 | +parameters: |
| 2 | + - name: environmentUrl |
| 3 | + displayName: Environment URL |
| 4 | + type: string |
| 5 | + - name: environmentName |
| 6 | + displayName: environmentName |
| 7 | + type: string |
| 8 | + - name: username |
| 9 | + displayName: Username |
| 10 | + type: string |
| 11 | + - name: password |
| 12 | + displayName: Password |
| 13 | + type: string |
49 | 14 |
|
50 |
| - - task: VSBuild@1 |
51 |
| - displayName: Build solution |
52 |
| - inputs: |
53 |
| - solution: '$(solution)' |
54 |
| - platform: '$(buildPlatform)' |
55 |
| - configuration: '$(buildConfiguration)' |
56 |
| - |
57 |
| - - task: VSTest@2 |
58 |
| - displayName: Run tests |
59 |
| - env: |
60 |
| - CAPGEMINI_PACKAGE_DEPLOYER_TESTS_URL: $(URL) |
61 |
| - CAPGEMINI_PACKAGE_DEPLOYER_TESTS_USERNAME: $(User ADO Integration Username) |
62 |
| - CAPGEMINI_PACKAGE_DEPLOYER_TESTS_PASSWORD: $(User ADO Integration Password) |
63 |
| - inputs: |
64 |
| - codeCoverageEnabled: true |
65 |
| - platform: '$(buildPlatform)' |
66 |
| - configuration: '$(buildConfiguration)' |
67 |
| - testAssemblyVer2: '**\*Tests.dll' |
68 |
| - searchFolder: tests |
69 |
| - |
70 |
| - - task: SonarCloudAnalyze@1 |
71 |
| - displayName: Analyse with SonarCloud |
72 |
| - |
73 |
| - - task: SonarCloudPublish@1 |
74 |
| - displayName: Publish SonarCloud results |
75 |
| - inputs: |
76 |
| - pollingTimeoutSec: '300' |
77 |
| - |
78 |
| - - task: WhiteSource Bolt@20 |
79 |
| - displayName: Detect security and licence issues |
80 |
| - inputs: |
81 |
| - cwd: '$(Build.SourcesDirectory)' |
82 |
| - |
83 |
| - - task: DotNetCoreCLI@2 |
84 |
| - displayName: Pack NuGet package |
85 |
| - inputs: |
86 |
| - command: pack |
87 |
| - packagesToPack: src\Capgemini.PowerApps.PackageDeployerTemplate\Capgemini.PowerApps.PackageDeployerTemplate.csproj |
88 |
| - modifyOutputPath: true |
89 |
| - versioningScheme: byEnvVar |
90 |
| - versionEnvVar: GitVersion.NuGetVersionV2 |
91 |
| - includesymbols: false |
92 |
| - buildProperties: Configuration=$(buildConfiguration) |
93 |
| - packDirectory: $(Build.ArtifactStagingDirectory)/out |
94 |
| - |
95 |
| - - publish: $(Build.ArtifactStagingDirectory)/out |
96 |
| - displayName: Publish NuGet artifact |
97 |
| - artifact: Capgemini.PowerApps.PackageDeployerTemplate |
| 15 | +jobs: |
| 16 | + - job: BuildAndTestJob |
| 17 | + displayName: Build and Test |
| 18 | + variables: |
| 19 | + - name: GitVersion.SemVer |
| 20 | + value: '' |
| 21 | + - name: solution |
| 22 | + value: '**/*.sln' |
| 23 | + - name: buildPlatform |
| 24 | + value: 'anycpu' |
| 25 | + - name: buildConfiguration |
| 26 | + value: 'Release' |
| 27 | + steps: |
| 28 | + - task: gitversion/setup@0 |
| 29 | + displayName: Install GitVersion |
| 30 | + inputs: |
| 31 | + versionSpec: '5.x' |
| 32 | + - task: gitversion/execute@0 |
| 33 | + displayName: Execute GitVersion |
| 34 | + inputs: |
| 35 | + useConfigFile: true |
| 36 | + configFilePath: '$(Build.SourcesDirectory)\GitVersion.yml' |
| 37 | + updateAssemblyInfo: false |
| 38 | + - pwsh: Write-Host "##vso[task.setvariable variable=SemVer;isOutput=true]$(GitVersion.SemVer)" |
| 39 | + name: OutputSemVerTask |
| 40 | + displayName: Output SemVer |
| 41 | + - task: DotNetCoreCLI@2 |
| 42 | + displayName: Restore NuGet packages |
| 43 | + inputs: |
| 44 | + command: restore |
| 45 | + projects: '**/*.csproj' |
| 46 | + - task: SonarCloudPrepare@1 |
| 47 | + displayName: Prepare SonarCloud |
| 48 | + inputs: |
| 49 | + SonarCloud: 'SonarCloud' |
| 50 | + organization: 'capgemini-1' |
| 51 | + scannerMode: 'MSBuild' |
| 52 | + projectKey: 'Capgemini_xrm-packagedeployer' |
| 53 | + projectName: 'xrm-packagedeployer' |
| 54 | + projectVersion: '$(GitVersion.SemVer)' |
| 55 | + extraProperties: | |
| 56 | + sonar.exclusions=**\*.css |
| 57 | + - task: VSBuild@1 |
| 58 | + displayName: Build solution |
| 59 | + inputs: |
| 60 | + solution: '$(solution)' |
| 61 | + platform: '$(buildPlatform)' |
| 62 | + configuration: '$(buildConfiguration)' |
| 63 | + - task: PowerShell@2 |
| 64 | + displayName: Create Approvals connection |
| 65 | + inputs: |
| 66 | + filePath: $(Build.SourcesDirectory)\scripts\New-PowerAppFlowConnection.ps1 |
| 67 | + arguments: > |
| 68 | + -Username ${{ parameters.username }} |
| 69 | + -Password (ConvertTo-SecureString -String $env:CONNECTIONOWNER_PASSWORD -AsPlainText -Force) |
| 70 | + -EnvironmentName ${{ parameters.environmentName }} |
| 71 | + -Region unitedkingdom |
| 72 | + -Connector shared_approvals |
| 73 | + -ConnectionParameters @{ } |
| 74 | + -OutputVariable "TestEnvironment.Connection.Approvals" |
| 75 | + targetType: filePath |
| 76 | + env: |
| 77 | + CONNECTIONOWNER_PASSWORD: ${{ parameters.password }} |
| 78 | + - task: VSTest@2 |
| 79 | + displayName: Run tests |
| 80 | + env: |
| 81 | + CAPGEMINI_PACKAGE_DEPLOYER_TESTS_URL: ${{ parameters.environmentUrl }} |
| 82 | + CAPGEMINI_PACKAGE_DEPLOYER_TESTS_USERNAME: ${{ parameters.username }} |
| 83 | + CAPGEMINI_PACKAGE_DEPLOYER_TESTS_PASSWORD: ${{ parameters.password }} |
| 84 | + PACKAGEDEPLOYER_SETTINGS_CONNREF_PDT_SHAREDAPPROVALS_D7DCB: $(TestEnvironment.Connection.Approvals) |
| 85 | + PACKAGEDEPLOYER_SETTINGS_ENVVAR_PDT_TESTVARIABLE: Any string |
| 86 | + PACKAGEDEPLOYER_SETTINGS_CONNBASEURL_pdt_5Fexample-20api: https://anyurl.com |
| 87 | + inputs: |
| 88 | + codeCoverageEnabled: true |
| 89 | + platform: '$(buildPlatform)' |
| 90 | + configuration: '$(buildConfiguration)' |
| 91 | + testAssemblyVer2: '**\*Tests.dll' |
| 92 | + searchFolder: tests |
| 93 | + - task: SonarCloudAnalyze@1 |
| 94 | + displayName: Analyse with SonarCloud |
| 95 | + - task: SonarCloudPublish@1 |
| 96 | + displayName: Publish SonarCloud results |
| 97 | + inputs: |
| 98 | + pollingTimeoutSec: '300' |
| 99 | + - task: WhiteSource Bolt@20 |
| 100 | + displayName: Detect security and licence issues |
| 101 | + inputs: |
| 102 | + cwd: '$(Build.SourcesDirectory)' |
| 103 | + - task: DotNetCoreCLI@2 |
| 104 | + displayName: Pack NuGet package |
| 105 | + inputs: |
| 106 | + command: pack |
| 107 | + packagesToPack: src\Capgemini.PowerApps.PackageDeployerTemplate\Capgemini.PowerApps.PackageDeployerTemplate.csproj |
| 108 | + modifyOutputPath: true |
| 109 | + versioningScheme: byEnvVar |
| 110 | + versionEnvVar: GitVersion.NuGetVersionV2 |
| 111 | + includesymbols: false |
| 112 | + buildProperties: Configuration=$(buildConfiguration) |
| 113 | + packDirectory: $(Build.ArtifactStagingDirectory)/out |
| 114 | + - publish: $(Build.ArtifactStagingDirectory)/out |
| 115 | + displayName: Publish NuGet artifact |
| 116 | + artifact: Capgemini.PowerApps.PackageDeployerTemplate |
0 commit comments