-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEXPORT.DEV.yml
128 lines (119 loc) · 4.09 KB
/
EXPORT.DEV.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
trigger:
- none
pool:
vmImage: windows-latest
# Set the BuildNumber = Format 1.0.yyyyMMdd.r
name: '1.0.$(Date:yyyyMMdd).$(rev:r)'
steps:
- checkout: self
persistCredentials: true
clean: true
#- task: NodeTool@0
# inputs:
# versionSpec: '10.x'
# displayName: 'Install Node.js'
#- task: Npm@1
# inputs:
# command: 'ci'
# workingDir: './romts_gsrst.uitests/'
#- task: Npm@1
# inputs:
# command: 'custom'
# workingDir: './romts_gsrst.uitests/'
# customCommand: 'run test'
# env:
# D365_UI_TEST_URL: $(UITESTS_XRM_URL)
# D365_UI_TEST_USERNAME: $(UITESTS_USERNAME)
# D365_UI_TEST_PASSWORD: $(UITESTS_PASSWORD)
# D365_UI_TEST_HEADLESS: true
#- task: PublishBuildArtifacts@1
# inputs:
# PathtoPublish: './romts_gsrst.uitests/reports/'
# ArtifactName: 'Reports'
# publishLocation: 'Container'
# condition: always()
#- task: PublishTestResults@2
# inputs:
# testResultsFormat: 'JUnit'
# testResultsFiles: '**/junit_*.xml'
# searchFolder: './romts_gsrst.uitests/reports/'
# condition: always()
- task: PowerPlatformToolInstaller@0
displayName: 'Install Power Platform Build Tools'
inputs:
DefaultVersion: true
# -Start of Power Platform Checker-
- task: PowerPlatformChecker@0
displayName: 'Run Solution Checker'
inputs:
authenticationType: 'PowerPlatformSPN'
PowerPlatformSPN: 'ROMTS-GSRST DEV'
SolutionName: '$(SolutionName)'
RuleSet: '0ad12346-e108-40b8-a956-9a8f95ea18c9' # https://learn.microsoft.com/en-us/power-platform/alm/checker-api/retrieve-rulesets
SaveResults: true
OutputPath: '$(Build.ArtifactStagingDirectory)'
ErrorLevel: 'Informational'
ErrorThreshold: 6000 # Ensures the pipeline proceeds regardless of task outcome
condition: always()
continueOnError: true
- task: PublishPipelineArtifact@1
displayName: 'Publish Solution Checker Results'
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifact: 'SolutionCheckerResults'
publishLocation: 'pipeline'
# -End of Power Platform Checker-
- task: PowerPlatformSetSolutionVersion@0
# Update the PowerApps solution using this build number
displayName: 'Update Solution Version'
inputs:
authenticationType: 'PowerPlatformSPN'
PowerPlatformSPN: 'ROMTS-GSRST DEV'
SolutionName: '$(SolutionName)'
SolutionVersionNumber: '$(Build.BuildNumber)'
- task: PowerPlatformPublishCustomizations@0
displayName: 'Publish All Customizations'
inputs:
authenticationType: 'PowerPlatformSPN'
PowerPlatformSPN: 'ROMTS-GSRST DEV'
- task: MSCRMToolInstaller@12
# We previously used Wael Hamze's Power DevOps Tools to do export of both solution types in the same task
# Now we only export unmanaged so we can look into switching this back to the MS Power Platform Tools
inputs:
nugetFeed: 'official'
psFeed: 'official'
- task: MSCRMExportSolution@12
displayName: 'Export Unmanaged Solutions'
inputs:
crmConnectionString: '$(ConnectionStringDev)'
solutionName: '$(SolutionName)'
exportManaged: false
exportUnmanaged: true
outputPath: '$(Build.ArtifactStagingDirectory)'
crmConnectionTimeout: '1960'
useAsyncMode: true
asyncWaitTimeout: '1900'
- task: PublishPipelineArtifact@1
displayName: 'Publish Artifacts'
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifact: 'drop'
publishLocation: 'pipeline'
- task: PowerPlatformUnpackSolution@0
displayName: 'Unpack Unmanaged Solution'
inputs:
SolutionInputFile: '$(Build.ArtifactStagingDirectory)\$(SolutionName).zip'
SolutionTargetFolder: '$(Build.SourcesDirectory)\$(SolutionName)'
- task: PowerShell@2
displayName: 'Commit Unpacked Solution to Source Control'
inputs:
targetType: 'inline'
script: |
echo "Committing all solution changes"
git config user.email "[email protected]"
git config user.name "tc-buildbot"
git checkout main
git add --all
git commit -m "Update Solution - $env:SOLUTIONNAME $env:BUILD_BUILDNUMBER"
echo "Push solution changes to the remote repository"
git -c http.extraheader="AUTHORIZATION: basuc $(System.AccessToken)" push origin main