@khester/create-dynamics-app 1.1.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/README.md +74 -0
  2. package/dist/artifacts/registry.d.ts +18 -0
  3. package/dist/artifacts/registry.d.ts.map +1 -0
  4. package/dist/artifacts/registry.js +340 -0
  5. package/dist/artifacts/registry.js.map +1 -0
  6. package/dist/artifacts/types.d.ts +122 -0
  7. package/dist/artifacts/types.d.ts.map +1 -0
  8. package/dist/artifacts/types.js +7 -0
  9. package/dist/artifacts/types.js.map +1 -0
  10. package/dist/artifacts/validators.d.ts +16 -0
  11. package/dist/artifacts/validators.d.ts.map +1 -0
  12. package/dist/artifacts/validators.js +45 -0
  13. package/dist/artifacts/validators.js.map +1 -0
  14. package/dist/fromDesign.d.ts +5 -0
  15. package/dist/fromDesign.d.ts.map +1 -0
  16. package/dist/fromDesign.js +98 -0
  17. package/dist/fromDesign.js.map +1 -0
  18. package/dist/index.js +129 -177
  19. package/dist/index.js.map +1 -1
  20. package/dist/injectDevTools.d.ts +28 -0
  21. package/dist/injectDevTools.d.ts.map +1 -0
  22. package/dist/injectDevTools.js +148 -0
  23. package/dist/injectDevTools.js.map +1 -0
  24. package/dist/scaffold.d.ts +48 -0
  25. package/dist/scaffold.d.ts.map +1 -0
  26. package/dist/scaffold.js +180 -0
  27. package/dist/scaffold.js.map +1 -0
  28. package/dist/templatePlan.d.ts +3 -0
  29. package/dist/templatePlan.d.ts.map +1 -0
  30. package/dist/templatePlan.js +43 -0
  31. package/dist/templatePlan.js.map +1 -0
  32. package/dist/utils/copyTemplate.d.ts +13 -1
  33. package/dist/utils/copyTemplate.d.ts.map +1 -1
  34. package/dist/utils/copyTemplate.js +98 -4
  35. package/dist/utils/copyTemplate.js.map +1 -1
  36. package/dist/utils/updatePackageJson.d.ts +11 -1
  37. package/dist/utils/updatePackageJson.d.ts.map +1 -1
  38. package/dist/utils/updatePackageJson.js +12 -10
  39. package/dist/utils/updatePackageJson.js.map +1 -1
  40. package/package.json +10 -7
  41. package/templates/_shared/dev-tools/auth/get-token.js +72 -0
  42. package/templates/_shared/dev-tools/dev/mock-xrm.js +42 -0
  43. package/templates/_shared/dev-tools/metadata-sync/index.js +152 -0
  44. package/templates/_shared/dev-tools/smoke/test-retrieve.js +44 -0
  45. package/templates/dialog-form/README.md +27 -0
  46. package/templates/dialog-form/_variants/App.v8.tsx +39 -0
  47. package/templates/dialog-form/_variants/App.v9.tsx +41 -0
  48. package/templates/dialog-form/gitignore +5 -0
  49. package/templates/dialog-form/package.json +27 -0
  50. package/templates/dialog-form/public/index.html +11 -0
  51. package/templates/dialog-form/src/index.tsx +10 -0
  52. package/templates/dialog-form/src/services/dataverse.ts +30 -0
  53. package/templates/dialog-form/tsconfig.json +15 -0
  54. package/templates/dialog-form/webpack.config.js +17 -0
  55. package/templates/grid-customizer/README.md +28 -0
  56. package/templates/grid-customizer/gitignore +4 -0
  57. package/templates/grid-customizer/package.json +25 -0
  58. package/templates/grid-customizer/src/GridCustomizer.ts +28 -0
  59. package/templates/grid-customizer/src/cell-renderers.tsx +35 -0
  60. package/templates/grid-customizer/src/index.ts +4 -0
  61. package/templates/grid-customizer/src/types/grid-types.ts +30 -0
  62. package/templates/grid-customizer/src/utils/color-utils.ts +24 -0
  63. package/templates/grid-customizer/tsconfig.json +15 -0
  64. package/templates/grid-customizer/webpack.config.js +17 -0
  65. package/templates/pcf-dataset/ControlManifest.Input.xml +16 -0
  66. package/templates/pcf-dataset/README.md +21 -0
  67. package/templates/pcf-dataset/gitignore +5 -0
  68. package/templates/pcf-dataset/index.ts +39 -0
  69. package/templates/pcf-dataset/package.json +30 -0
  70. package/templates/pcf-dataset/strings/{{componentName}}.1033.resx +47 -0
  71. package/templates/pcf-dataset/tsconfig.json +8 -0
  72. package/templates/pcf-dataset/{{componentName}}Component.tsx +39 -0
  73. package/templates/pcf-field/ControlManifest.Input.xml +17 -0
  74. package/templates/pcf-field/README.md +95 -0
  75. package/templates/pcf-field/_variants/ValueInput.boolean.tsx +24 -0
  76. package/templates/pcf-field/_variants/ValueInput.date.tsx +27 -0
  77. package/templates/pcf-field/_variants/ValueInput.number.tsx +35 -0
  78. package/templates/pcf-field/_variants/ValueInput.text.tsx +27 -0
  79. package/templates/pcf-field/gitignore +5 -0
  80. package/templates/pcf-field/index.ts +61 -0
  81. package/templates/pcf-field/package.json +30 -0
  82. package/templates/pcf-field/strings/{{componentName}}.1033.resx +47 -0
  83. package/templates/pcf-field/tsconfig.json +8 -0
  84. package/templates/pcf-field/{{componentName}}Component.tsx +35 -0
  85. package/templates/power-pages-starter/gitignore +5 -0
  86. package/templates/react-custom-page/gitignore +5 -0
  87. package/templates/{dynamics-365-starter → react-custom-page}/package.json +3 -3
  88. package/templates/react-custom-page/tools/metadata-sync/index.js +152 -0
  89. package/templates/static-web-app/README.md +36 -0
  90. package/templates/static-web-app/_variants/App.v8.tsx +32 -0
  91. package/templates/static-web-app/_variants/App.v9.tsx +31 -0
  92. package/templates/static-web-app/api/host.json +12 -0
  93. package/templates/static-web-app/api/package.json +19 -0
  94. package/templates/static-web-app/api/src/functions/hello.ts +16 -0
  95. package/templates/static-web-app/api/tsconfig.json +14 -0
  96. package/templates/static-web-app/frontend/index.html +12 -0
  97. package/templates/static-web-app/frontend/package.json +23 -0
  98. package/templates/static-web-app/frontend/src/index.tsx +8 -0
  99. package/templates/static-web-app/frontend/tsconfig.json +16 -0
  100. package/templates/static-web-app/frontend/vite.config.ts +13 -0
  101. package/templates/static-web-app/gitignore +8 -0
  102. package/templates/static-web-app/package.json +15 -0
  103. package/templates/static-web-app/staticwebapp.config.json +7 -0
  104. package/templates/teams-app/README.md +27 -0
  105. package/templates/teams-app/_variants/graph.off.ts +7 -0
  106. package/templates/teams-app/_variants/graph.on.ts +22 -0
  107. package/templates/teams-app/appPackage/manifest.json +26 -0
  108. package/templates/teams-app/gitignore +5 -0
  109. package/templates/teams-app/index.html +12 -0
  110. package/templates/teams-app/package.json +26 -0
  111. package/templates/teams-app/src/App.tsx +25 -0
  112. package/templates/teams-app/src/index.tsx +8 -0
  113. package/templates/teams-app/tsconfig.json +16 -0
  114. package/templates/teams-app/vite.config.ts +9 -0
  115. package/templates/web-resource/README.md +39 -0
  116. package/templates/web-resource/_variants/App.v8.tsx +29 -0
  117. package/templates/web-resource/_variants/App.v9.tsx +28 -0
  118. package/templates/web-resource/gitignore +5 -0
  119. package/templates/web-resource/package.json +27 -0
  120. package/templates/web-resource/public/index.html +11 -0
  121. package/templates/web-resource/src/index.tsx +10 -0
  122. package/templates/web-resource/src/services/dataverse.ts +30 -0
  123. package/templates/web-resource/tsconfig.json +15 -0
  124. package/templates/web-resource/webpack.config.js +17 -0
  125. package/dist/utils/consultingHelpers.d.ts +0 -13
  126. package/dist/utils/consultingHelpers.d.ts.map +0 -1
  127. package/dist/utils/consultingHelpers.js +0 -569
  128. package/dist/utils/consultingHelpers.js.map +0 -1
  129. package/templates/dynamics-365-starter/INTEGRATION_TEST_RESULTS.md +0 -302
  130. package/templates/dynamics-365-starter/PHASE_4_COMPLETION_SUMMARY.md +0 -305
  131. package/templates/dynamics-365-starter/deployment/QUICKSTART-MAC.md +0 -507
  132. package/templates/dynamics-365-starter/deployment/QUICKSTART-WINDOWS.md +0 -372
  133. package/templates/dynamics-365-starter/deployment/pipelines/README.md +0 -375
  134. package/templates/dynamics-365-starter/deployment/pipelines/azure-pipelines.yml +0 -330
  135. package/templates/dynamics-365-starter/deployment/pipelines/github-actions.yml +0 -422
  136. package/templates/dynamics-365-starter/deployment/pipelines/jenkins.groovy +0 -636
  137. package/templates/dynamics-365-starter/deployment/scripts/deploy.ps1 +0 -417
  138. package/templates/dynamics-365-starter/deployment/scripts/deploy.sh +0 -582
  139. package/templates/dynamics-365-starter/deployment/scripts/team-onboarding.ps1 +0 -486
  140. package/templates/dynamics-365-starter/deployment/scripts/team-onboarding.sh +0 -567
  141. package/templates/dynamics-365-starter/deployment/scripts/validate-setup.ps1 +0 -703
  142. package/templates/dynamics-365-starter/deployment/scripts/validate-setup.sh +0 -671
  143. package/templates/dynamics-365-starter/docs/team-standards/README.md +0 -273
  144. package/templates/dynamics-365-starter/docs/team-standards/client-onboarding.md +0 -577
  145. package/templates/dynamics-365-starter/docs/team-standards/code-review-checklist.md +0 -359
  146. package/templates/dynamics-365-starter/docs/team-standards/coding-standards.md +0 -700
  147. package/templates/dynamics-365-starter/docs/team-standards/cross-platform-team-guide.md +0 -736
  148. package/templates/dynamics-365-starter/docs/team-standards/development-workflows.md +0 -727
  149. package/templates/dynamics-365-starter/docs/troubleshooting/common-errors.md +0 -758
  150. package/templates/dynamics-365-starter/docs/troubleshooting/platform-specific-issues.md +0 -878
  151. package/templates/dynamics-365-starter/src/client-project-template/README.md +0 -234
  152. package/templates/dynamics-365-starter/src/client-project-template/config/client.template.json +0 -114
  153. package/templates/dynamics-365-starter/src/client-project-template/config/environments/template.json +0 -186
  154. package/templates/dynamics-365-starter/src/client-project-template/scripts/client-setup.js +0 -667
  155. package/templates/dynamics-365-starter/src/examples/README.md +0 -52
  156. package/templates/dynamics-365-starter/src/examples/component-examples/opportunity-management.tsx +0 -625
  157. package/templates/dynamics-365-starter/src/examples/entity-examples/opportunity-model.ts +0 -545
  158. package/templates/dynamics-365-starter/src/examples/integration-examples/custom-pcf-wrapper.tsx +0 -722
  159. package/templates/dynamics-365-starter/src/examples/workflow-examples/sales-workflow.ts +0 -662
  160. package/templates/dynamics-365-starter/src/page-templates/EntityDashboard.tsx +0 -519
  161. package/templates/dynamics-365-starter/src/page-templates/EntityDetailPage.tsx +0 -456
  162. package/templates/dynamics-365-starter/src/page-templates/EntityListPage.tsx +0 -406
  163. package/templates/dynamics-365-starter/src/page-templates/RelatedEntitiesPage.tsx +0 -578
  164. package/templates/dynamics-365-starter/src/page-templates/SearchPage.tsx +0 -629
  165. package/templates/dynamics-365-starter/tools/entity-generator/index.js +0 -168
  166. package/templates/dynamics-365-starter/tools/entity-generator/templates/constants.template.ts +0 -124
  167. package/templates/dynamics-365-starter/tools/entity-generator/templates/form.template.css +0 -283
  168. package/templates/dynamics-365-starter/tools/entity-generator/templates/form.template.tsx +0 -275
  169. package/templates/dynamics-365-starter/tools/entity-generator/templates/management.template.css +0 -204
  170. package/templates/dynamics-365-starter/tools/entity-generator/templates/management.template.tsx +0 -413
  171. package/templates/dynamics-365-starter/tools/entity-generator/templates/model.template.ts +0 -250
  172. package/templates/dynamics-365-starter/tools/metadata-sync/d365-client.js +0 -410
  173. package/templates/dynamics-365-starter/tools/metadata-sync/index.js +0 -512
  174. package/templates/dynamics-365-starter/tools/metadata-sync/type-generator.js +0 -675
  175. /package/templates/{dynamics-365-starter → react-custom-page}/README.md +0 -0
  176. /package/templates/{dynamics-365-starter → react-custom-page}/deployment/README.md +0 -0
  177. /package/templates/{dynamics-365-starter → react-custom-page}/docs/ARCHITECTURE_OVERVIEW.md +0 -0
  178. /package/templates/{dynamics-365-starter → react-custom-page}/docs/BEST_PRACTICES.md +0 -0
  179. /package/templates/{dynamics-365-starter → react-custom-page}/docs/MIGRATION_GUIDE.md +0 -0
  180. /package/templates/{dynamics-365-starter → react-custom-page}/public/index.html +0 -0
  181. /package/templates/{dynamics-365-starter → react-custom-page}/scripts/custom-build.js +0 -0
  182. /package/templates/{dynamics-365-starter → react-custom-page}/src/components/AccountForm.css +0 -0
  183. /package/templates/{dynamics-365-starter → react-custom-page}/src/components/AccountForm.tsx +0 -0
  184. /package/templates/{dynamics-365-starter → react-custom-page}/src/components/AccountManagement.css +0 -0
  185. /package/templates/{dynamics-365-starter → react-custom-page}/src/components/AccountManagement.tsx +0 -0
  186. /package/templates/{dynamics-365-starter → react-custom-page}/src/components/ContactForm.css +0 -0
  187. /package/templates/{dynamics-365-starter → react-custom-page}/src/components/ContactForm.tsx +0 -0
  188. /package/templates/{dynamics-365-starter → react-custom-page}/src/components/ContactManagement.css +0 -0
  189. /package/templates/{dynamics-365-starter → react-custom-page}/src/components/ContactManagement.tsx +0 -0
  190. /package/templates/{dynamics-365-starter → react-custom-page}/src/components/Logging/LogDialog.tsx +0 -0
  191. /package/templates/{dynamics-365-starter → react-custom-page}/src/components/Logging/LoggingContext.tsx +0 -0
  192. /package/templates/{dynamics-365-starter → react-custom-page}/src/components/Logging/LoggingDebugPanel.css +0 -0
  193. /package/templates/{dynamics-365-starter → react-custom-page}/src/components/Logging/LoggingDebugPanel.tsx +0 -0
  194. /package/templates/{dynamics-365-starter → react-custom-page}/src/components/Logging/LoggingProvider.tsx +0 -0
  195. /package/templates/{dynamics-365-starter → react-custom-page}/src/components/Logging/logger.ts +0 -0
  196. /package/templates/{dynamics-365-starter → react-custom-page}/src/constants/account.ts +0 -0
  197. /package/templates/{dynamics-365-starter → react-custom-page}/src/constants/contact.ts +0 -0
  198. /package/templates/{dynamics-365-starter → react-custom-page}/src/index.tsx +0 -0
  199. /package/templates/{dynamics-365-starter → react-custom-page}/src/models/Account.ts +0 -0
  200. /package/templates/{dynamics-365-starter → react-custom-page}/src/models/BaseEntity.ts +0 -0
  201. /package/templates/{dynamics-365-starter → react-custom-page}/src/models/Contact.ts +0 -0
  202. /package/templates/{dynamics-365-starter → react-custom-page}/src/pcf/ContactControlWrapper.tsx +0 -0
  203. /package/templates/{dynamics-365-starter → react-custom-page}/src/pcf/MultiEntityControlWrapper.tsx +0 -0
  204. /package/templates/{dynamics-365-starter → react-custom-page}/src/providers/DynamicsProvider.tsx +0 -0
  205. /package/templates/{dynamics-365-starter → react-custom-page}/src/services/MockApiService.ts +0 -0
  206. /package/templates/{dynamics-365-starter → react-custom-page}/src/services/ServiceFactory.ts +0 -0
  207. /package/templates/{dynamics-365-starter → react-custom-page}/src/services/XrmApiService.ts +0 -0
  208. /package/templates/{dynamics-365-starter → react-custom-page}/src/styles/index.css +0 -0
  209. /package/templates/{dynamics-365-starter → react-custom-page}/tsconfig.json +0 -0
  210. /package/templates/{dynamics-365-starter → react-custom-page}/webpack.config.js +0 -0
@@ -1,636 +0,0 @@
1
- // Jenkins Pipeline - Dual Platform Support
2
- // Supports both Windows and Linux agents for mixed development teams
3
-
4
- pipeline {
5
- agent none
6
-
7
- options {
8
- buildDiscarder(logRotator(numToKeepStr: '10'))
9
- timeout(time: 1, unit: 'HOURS')
10
- retry(2)
11
- skipStagesAfterUnstable()
12
- }
13
-
14
- environment {
15
- NODE_VERSION = '18'
16
- NPM_CONFIG_CACHE = "${WORKSPACE}/.npm"
17
-
18
- // Platform detection
19
- IS_WINDOWS = "${env.NODE_NAME?.toLowerCase()?.contains('windows') ?: false}"
20
- IS_LINUX = "${env.NODE_NAME?.toLowerCase()?.contains('linux') ?: false}"
21
-
22
- // Credential IDs (configure in Jenkins)
23
- D365_DEV_CREDS = credentials('d365-dev-credentials')
24
- D365_TEST_CREDS = credentials('d365-test-credentials')
25
- D365_PROD_CREDS = credentials('d365-prod-credentials')
26
- }
27
-
28
- triggers {
29
- // Poll SCM every 5 minutes during business hours
30
- pollSCM('H/5 9-17 * * 1-5')
31
-
32
- // Build on branch push
33
- githubPush()
34
- }
35
-
36
- stages {
37
- // Build Stage - Prefer Linux for speed
38
- stage('Build') {
39
- agent {
40
- label 'linux && nodejs'
41
- }
42
- steps {
43
- script {
44
- echo "🔨 BUILDING ON LINUX FOR OPTIMAL PERFORMANCE"
45
- echo "Agent: ${env.NODE_NAME}"
46
- echo "Platform: Linux (preferred for builds)"
47
- echo "Compatible with: Mac developer workflow"
48
- }
49
-
50
- // Clean workspace
51
- cleanWs()
52
-
53
- // Checkout code
54
- checkout scm
55
-
56
- // Setup Node.js
57
- nodejs(nodeJSInstallationName: "NodeJS-${NODE_VERSION}") {
58
- // Cache dependencies
59
- sh '''
60
- echo "Setting up npm cache..."
61
- npm config set cache ${NPM_CONFIG_CACHE}
62
- npm config list
63
- '''
64
-
65
- // Install dependencies
66
- sh 'npm ci'
67
-
68
- // Run quality checks
69
- sh 'npm run lint || echo "Linting completed with warnings"'
70
- sh 'npm run typecheck'
71
- sh 'npm run test'
72
-
73
- // Build production bundle
74
- sh 'npm run build:prod'
75
- }
76
-
77
- // Archive build artifacts
78
- archiveArtifacts artifacts: 'dist/**/*', fingerprint: true
79
- archiveArtifacts artifacts: 'deployment/**/*', fingerprint: true
80
-
81
- // Publish test results
82
- publishTestResults testResultsPattern: 'test-results.xml'
83
-
84
- // Publish coverage
85
- publishCoverage adapters: [
86
- coberturaAdapter('coverage/cobertura-coverage.xml')
87
- ], sourceFileResolver: sourceFiles('STORE_LAST_BUILD')
88
- }
89
- post {
90
- always {
91
- script {
92
- echo "Build stage completed on Linux agent"
93
- echo "Artifacts available for cross-platform deployment"
94
- }
95
- }
96
- }
97
- }
98
-
99
- // Platform Detection and Strategy Selection
100
- stage('Platform Strategy') {
101
- parallel {
102
- stage('Linux Strategy Info') {
103
- agent {
104
- label 'linux'
105
- }
106
- steps {
107
- script {
108
- echo """
109
- 🍎 LINUX DEPLOYMENT STRATEGY
110
- ================================
111
- Agent Type: Linux
112
- Script Type: Bash (.sh files)
113
- Compatible With: Mac developers, Linux CI/CD
114
- Performance: Optimized for speed and consistency
115
- Use Cases: Development, staging, production (default)
116
-
117
- Commands Available:
118
- - ./deployment/scripts/deploy.sh
119
- - ./deployment/scripts/health-check.sh
120
- - ./deployment/scripts/rollback.sh
121
- """
122
- }
123
- }
124
- }
125
-
126
- stage('Windows Strategy Info') {
127
- agent {
128
- label 'windows'
129
- }
130
- when {
131
- expression { findFiles(glob: 'deployment/scripts/*.ps1').length > 0 }
132
- }
133
- steps {
134
- script {
135
- echo """
136
- 🖥️ WINDOWS DEPLOYMENT STRATEGY
137
- ================================
138
- Agent Type: Windows
139
- Script Type: PowerShell (.ps1 files)
140
- Compatible With: Windows developers, Azure DevOps
141
- Performance: Optimized for enterprise PowerShell workflows
142
- Use Cases: Testing, enterprise production environments
143
-
144
- Commands Available:
145
- - .\\deployment\\scripts\\deploy.ps1
146
- - .\\deployment\\scripts\\health-check.ps1
147
- - .\\deployment\\scripts\\rollback.ps1
148
- """
149
- }
150
- }
151
- }
152
- }
153
- }
154
-
155
- // Development Deployment - Linux with Bash
156
- stage('Deploy to Development') {
157
- when {
158
- anyOf {
159
- branch 'develop'
160
- changeRequest target: 'develop'
161
- }
162
- }
163
- agent {
164
- label 'linux && docker'
165
- }
166
- environment {
167
- D365_ENVIRONMENT = 'dev'
168
- D365_CLIENT_ID = "${D365_DEV_CREDS_USR}"
169
- D365_CLIENT_SECRET = "${D365_DEV_CREDS_PSW}"
170
- }
171
- steps {
172
- script {
173
- echo "🍎 DEVELOPMENT DEPLOYMENT - LINUX/BASH STRATEGY"
174
- echo "Agent: ${env.NODE_NAME}"
175
- echo "Platform: Linux (optimized for Mac developer workflow)"
176
- echo "Target: Development environment"
177
- }
178
-
179
- // Copy build artifacts
180
- copyArtifacts(
181
- projectName: env.JOB_NAME,
182
- buildNumber: env.BUILD_NUMBER,
183
- filter: 'dist/**,deployment/**'
184
- )
185
-
186
- // Make scripts executable
187
- sh 'chmod +x deployment/scripts/*.sh'
188
-
189
- // Validate setup
190
- sh '''
191
- echo "Validating development environment setup..."
192
- ./deployment/scripts/validate-setup.sh || echo "Validation completed with warnings"
193
- '''
194
-
195
- // Deploy using Bash script
196
- sh '''
197
- echo "Deploying to development using Bash scripts..."
198
- ./deployment/scripts/deploy.sh dev --verbose
199
- '''
200
-
201
- // Health check
202
- sh '''
203
- echo "Running post-deployment health check..."
204
- ./deployment/scripts/health-check.sh dev || echo "Health check completed with warnings"
205
- '''
206
- }
207
- post {
208
- always {
209
- // Archive deployment logs
210
- archiveArtifacts artifacts: 'deployment/logs/**/*', allowEmptyArchive: true
211
- }
212
- success {
213
- // Notify team about successful deployment
214
- script {
215
- echo "✅ Development deployment successful using Linux/Bash strategy"
216
- echo "Compatible with Mac developer local workflow"
217
- }
218
- }
219
- }
220
- }
221
-
222
- // Test Deployment - Windows with PowerShell
223
- stage('Deploy to Test') {
224
- when {
225
- anyOf {
226
- branch 'main'
227
- branch 'master'
228
- }
229
- }
230
- agent {
231
- label 'windows && powershell'
232
- }
233
- environment {
234
- D365_ENVIRONMENT = 'test'
235
- D365_CLIENT_ID = "${D365_TEST_CREDS_USR}"
236
- D365_CLIENT_SECRET = "${D365_TEST_CREDS_PSW}"
237
- }
238
- steps {
239
- script {
240
- echo "🖥️ TEST DEPLOYMENT - WINDOWS/POWERSHELL STRATEGY"
241
- echo "Agent: ${env.NODE_NAME}"
242
- echo "Platform: Windows (enterprise PowerShell validation)"
243
- echo "Target: Test environment"
244
- }
245
-
246
- // Copy build artifacts
247
- copyArtifacts(
248
- projectName: env.JOB_NAME,
249
- buildNumber: env.BUILD_NUMBER,
250
- filter: 'dist/**,deployment/**'
251
- )
252
-
253
- // Install PowerShell modules
254
- powershell '''
255
- Write-Host "Installing required PowerShell modules..." -ForegroundColor Blue
256
- Install-Module -Name Microsoft.PowerApps.Administration.PowerShell -Force -AllowClobber -Scope CurrentUser
257
- Install-Module -Name Microsoft.PowerApps.PowerShell -Force -AllowClobber -Scope CurrentUser
258
-
259
- Write-Host "Verifying module installation..." -ForegroundColor Blue
260
- Get-Module -Name Microsoft.PowerApps* -ListAvailable
261
- '''
262
-
263
- // Validate setup
264
- powershell '''
265
- Write-Host "Validating test environment setup..." -ForegroundColor Blue
266
- try {
267
- .\\deployment\\scripts\\validate-setup.ps1
268
- } catch {
269
- Write-Warning "Validation completed with warnings: $_"
270
- }
271
- '''
272
-
273
- // Deploy using PowerShell script
274
- powershell '''
275
- Write-Host "Deploying to test using PowerShell scripts..." -ForegroundColor Green
276
- .\\deployment\\scripts\\deploy.ps1 -Environment test -Verbose
277
- '''
278
-
279
- // Health check
280
- powershell '''
281
- Write-Host "Running post-deployment health check..." -ForegroundColor Blue
282
- try {
283
- .\\deployment\\scripts\\health-check.ps1 -Environment test
284
- } catch {
285
- Write-Warning "Health check completed with warnings: $_"
286
- }
287
- '''
288
- }
289
- post {
290
- always {
291
- // Archive deployment logs
292
- archiveArtifacts artifacts: 'deployment/logs/**/*', allowEmptyArchive: true
293
- }
294
- success {
295
- script {
296
- echo "✅ Test deployment successful using Windows/PowerShell strategy"
297
- echo "Compatible with Windows developer local workflow"
298
- }
299
- }
300
- }
301
- }
302
-
303
- // Production Deployment - Flexible platform with approval
304
- stage('Deploy to Production') {
305
- when {
306
- anyOf {
307
- branch 'main'
308
- branch 'master'
309
- }
310
- }
311
- steps {
312
- script {
313
- // Manual approval for production
314
- def deploymentApproval = input(
315
- message: 'Deploy to Production?',
316
- ok: 'Deploy',
317
- submitterParameter: 'APPROVER',
318
- parameters: [
319
- choice(
320
- name: 'PLATFORM_CHOICE',
321
- choices: ['linux-bash', 'windows-powershell'],
322
- description: 'Choose deployment platform strategy'
323
- ),
324
- booleanParam(
325
- name: 'SKIP_BACKUP',
326
- defaultValue: false,
327
- description: 'Skip backup creation (not recommended for production)'
328
- )
329
- ]
330
- )
331
-
332
- env.PLATFORM_CHOICE = deploymentApproval.PLATFORM_CHOICE
333
- env.SKIP_BACKUP = deploymentApproval.SKIP_BACKUP
334
- env.APPROVER = deploymentApproval.APPROVER
335
-
336
- echo "Production deployment approved by: ${env.APPROVER}"
337
- echo "Platform strategy: ${env.PLATFORM_CHOICE}"
338
- echo "Skip backup: ${env.SKIP_BACKUP}"
339
- }
340
- }
341
- }
342
-
343
- // Production Deployment - Linux Strategy
344
- stage('Production Deploy (Linux/Bash)') {
345
- when {
346
- allOf {
347
- anyOf {
348
- branch 'main'
349
- branch 'master'
350
- }
351
- environment name: 'PLATFORM_CHOICE', value: 'linux-bash'
352
- }
353
- }
354
- agent {
355
- label 'linux && docker'
356
- }
357
- environment {
358
- D365_ENVIRONMENT = 'prod'
359
- D365_CLIENT_ID = "${D365_PROD_CREDS_USR}"
360
- D365_CLIENT_SECRET = "${D365_PROD_CREDS_PSW}"
361
- }
362
- steps {
363
- script {
364
- echo "🍎 PRODUCTION DEPLOYMENT - LINUX/BASH STRATEGY"
365
- echo "Agent: ${env.NODE_NAME}"
366
- echo "Approved by: ${env.APPROVER}"
367
- echo "Strategy: Stability and consistency focused"
368
- echo "Compatible with: Mac developer workflow"
369
- }
370
-
371
- // Copy build artifacts
372
- copyArtifacts(
373
- projectName: env.JOB_NAME,
374
- buildNumber: env.BUILD_NUMBER,
375
- filter: 'dist/**,deployment/**'
376
- )
377
-
378
- // Make scripts executable
379
- sh 'chmod +x deployment/scripts/*.sh'
380
-
381
- // Create backup (unless skipped)
382
- script {
383
- if (env.SKIP_BACKUP != 'true') {
384
- sh '''
385
- echo "Creating production backup..."
386
- ./deployment/scripts/backup.sh prod
387
- '''
388
- } else {
389
- echo "⚠️ Production backup skipped by approval"
390
- }
391
- }
392
-
393
- // Deploy to production
394
- sh '''
395
- echo "Deploying to production using Bash scripts..."
396
- ./deployment/scripts/deploy.sh prod --verbose
397
- '''
398
-
399
- // Comprehensive health check
400
- sh '''
401
- echo "Running comprehensive production health check..."
402
- ./deployment/scripts/health-check.sh prod
403
- '''
404
-
405
- // Production monitoring setup
406
- sh '''
407
- echo "Setting up production monitoring..."
408
- ./deployment/scripts/setup-monitoring.sh prod || echo "Monitoring setup completed with warnings"
409
- '''
410
- }
411
- post {
412
- always {
413
- archiveArtifacts artifacts: 'deployment/logs/**/*', allowEmptyArchive: true
414
- archiveArtifacts artifacts: 'deployment/backups/**/*', allowEmptyArchive: true
415
- }
416
- success {
417
- script {
418
- echo "🎉 Production deployment successful using Linux/Bash strategy!"
419
- echo "Platform: Linux (${env.NODE_NAME})"
420
- echo "Approved by: ${env.APPROVER}"
421
- echo "Backup created: ${env.SKIP_BACKUP != 'true' ? 'Yes' : 'No'}"
422
- }
423
- }
424
- }
425
- }
426
-
427
- // Production Deployment - Windows Strategy
428
- stage('Production Deploy (Windows/PowerShell)') {
429
- when {
430
- allOf {
431
- anyOf {
432
- branch 'main'
433
- branch 'master'
434
- }
435
- environment name: 'PLATFORM_CHOICE', value: 'windows-powershell'
436
- }
437
- }
438
- agent {
439
- label 'windows && powershell'
440
- }
441
- environment {
442
- D365_ENVIRONMENT = 'prod'
443
- D365_CLIENT_ID = "${D365_PROD_CREDS_USR}"
444
- D365_CLIENT_SECRET = "${D365_PROD_CREDS_PSW}"
445
- }
446
- steps {
447
- script {
448
- echo "🖥️ PRODUCTION DEPLOYMENT - WINDOWS/POWERSHELL STRATEGY"
449
- echo "Agent: ${env.NODE_NAME}"
450
- echo "Approved by: ${env.APPROVER}"
451
- echo "Strategy: Enterprise PowerShell workflow"
452
- echo "Compatible with: Windows developer workflow"
453
- }
454
-
455
- // Copy build artifacts
456
- copyArtifacts(
457
- projectName: env.JOB_NAME,
458
- buildNumber: env.BUILD_NUMBER,
459
- filter: 'dist/**,deployment/**'
460
- )
461
-
462
- // Install PowerShell modules
463
- powershell '''
464
- Write-Host "Installing required PowerShell modules..." -ForegroundColor Blue
465
- Install-Module -Name Microsoft.PowerApps.Administration.PowerShell -Force -AllowClobber -Scope CurrentUser
466
- Install-Module -Name Microsoft.PowerApps.PowerShell -Force -AllowClobber -Scope CurrentUser
467
- '''
468
-
469
- // Create backup (unless skipped)
470
- script {
471
- if (env.SKIP_BACKUP != 'true') {
472
- powershell '''
473
- Write-Host "Creating production backup..." -ForegroundColor Blue
474
- .\\deployment\\scripts\\backup.ps1 -Environment prod
475
- '''
476
- } else {
477
- echo "⚠️ Production backup skipped by approval"
478
- }
479
- }
480
-
481
- // Deploy to production
482
- powershell '''
483
- Write-Host "Deploying to production using PowerShell scripts..." -ForegroundColor Green
484
- .\\deployment\\scripts\\deploy.ps1 -Environment prod -Verbose
485
- '''
486
-
487
- // Comprehensive health check
488
- powershell '''
489
- Write-Host "Running comprehensive production health check..." -ForegroundColor Blue
490
- .\\deployment\\scripts\\health-check.ps1 -Environment prod
491
- '''
492
-
493
- // Production monitoring setup
494
- powershell '''
495
- Write-Host "Setting up production monitoring..." -ForegroundColor Blue
496
- try {
497
- .\\deployment\\scripts\\setup-monitoring.ps1 -Environment prod
498
- } catch {
499
- Write-Warning "Monitoring setup completed with warnings: $_"
500
- }
501
- '''
502
- }
503
- post {
504
- always {
505
- archiveArtifacts artifacts: 'deployment\\logs\\**\\*', allowEmptyArchive: true
506
- archiveArtifacts artifacts: 'deployment\\backups\\**\\*', allowEmptyArchive: true
507
- }
508
- success {
509
- script {
510
- echo "🎉 Production deployment successful using Windows/PowerShell strategy!"
511
- echo "Platform: Windows (${env.NODE_NAME})"
512
- echo "Approved by: ${env.APPROVER}"
513
- echo "Backup created: ${env.SKIP_BACKUP != 'true' ? 'Yes' : 'No'}"
514
- }
515
- }
516
- }
517
- }
518
-
519
- // Cross-Platform Validation (for pull requests)
520
- stage('Cross-Platform Validation') {
521
- when {
522
- changeRequest()
523
- }
524
- parallel {
525
- stage('Validate on Linux') {
526
- agent {
527
- label 'linux'
528
- }
529
- steps {
530
- script {
531
- echo "🍎 CROSS-PLATFORM VALIDATION - LINUX"
532
- echo "Validating Mac/Linux developer workflow compatibility"
533
- }
534
-
535
- copyArtifacts(
536
- projectName: env.JOB_NAME,
537
- buildNumber: env.BUILD_NUMBER,
538
- filter: 'deployment/**'
539
- )
540
-
541
- sh 'chmod +x deployment/scripts/*.sh'
542
- sh './deployment/scripts/validate-setup.sh || echo "Validation completed"'
543
-
544
- script {
545
- echo "✅ Linux validation successful"
546
- echo "🤝 Compatible with Mac developer local workflow"
547
- }
548
- }
549
- }
550
-
551
- stage('Validate on Windows') {
552
- agent {
553
- label 'windows'
554
- }
555
- steps {
556
- script {
557
- echo "🖥️ CROSS-PLATFORM VALIDATION - WINDOWS"
558
- echo "Validating Windows developer workflow compatibility"
559
- }
560
-
561
- copyArtifacts(
562
- projectName: env.JOB_NAME,
563
- buildNumber: env.BUILD_NUMBER,
564
- filter: 'deployment/**'
565
- )
566
-
567
- powershell '''
568
- Install-Module -Name Microsoft.PowerApps.Administration.PowerShell -Force -AllowClobber -Scope CurrentUser
569
- Install-Module -Name Microsoft.PowerApps.PowerShell -Force -AllowClobber -Scope CurrentUser
570
- '''
571
-
572
- powershell '''
573
- try {
574
- .\\deployment\\scripts\\validate-setup.ps1
575
- } catch {
576
- Write-Host "Validation completed: $_"
577
- }
578
- '''
579
-
580
- script {
581
- echo "✅ Windows validation successful"
582
- echo "🤝 Compatible with Windows developer local workflow"
583
- }
584
- }
585
- }
586
- }
587
- }
588
- }
589
-
590
- post {
591
- always {
592
- script {
593
- echo """
594
- ╔══════════════════════════════════════════════════════════════╗
595
- ║ CROSS-PLATFORM JENKINS PIPELINE ║
596
- ║ DEPLOYMENT SUMMARY ║
597
- ╚══════════════════════════════════════════════════════════════╝
598
-
599
- 🎯 DEPLOYMENT RESULTS:
600
- ├── Build: Linux (optimized for speed)
601
- ├── Dev Deploy: Linux + Bash (Mac developer experience)
602
- ├── Test Deploy: Windows + PowerShell (enterprise validation)
603
- └── Prod Deploy: User choice (Linux or Windows strategy)
604
-
605
- 👥 TEAM COMPATIBILITY:
606
- ├── 🖥️ Windows developers: Use local PowerShell scripts
607
- ├── 🍎 Mac developers: Use local Bash scripts
608
- └── 🤝 Same Jenkins pipeline works for entire team
609
-
610
- ✅ PLATFORM GUARANTEES:
611
- ├── Identical deployment results across platforms
612
- ├── Shared configuration and build artifacts
613
- ├── Compatible logging and monitoring
614
- └── Cross-platform validation for pull requests
615
-
616
- 📚 TEAM RESOURCES:
617
- ├── Windows Guide: deployment/QUICKSTART-WINDOWS.md
618
- ├── Mac Guide: deployment/QUICKSTART-MAC.md
619
- ├── Team Setup: deployment/scripts/team-onboarding.*
620
- └── Pipeline Docs: deployment/pipelines/README.md
621
- """
622
- }
623
- }
624
- success {
625
- script {
626
- echo "🎉 Pipeline completed successfully with cross-platform support!"
627
- }
628
- }
629
- failure {
630
- script {
631
- echo "❌ Pipeline failed - check logs for platform-specific issues"
632
- echo "💡 Remember: Windows uses .ps1 scripts, Linux/Mac use .sh scripts"
633
- }
634
- }
635
- }
636
- }