@simplysf/simply-cicd 0.15.2 → 0.16.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.
- package/README.md +111 -34
- package/lib/commands/simply/cicd/notify/build.d.ts +28 -0
- package/lib/commands/simply/cicd/notify/build.js +136 -0
- package/lib/commands/simply/cicd/notify/build.js.map +1 -0
- package/lib/common/notify/buildNotification.d.ts +53 -0
- package/lib/common/notify/buildNotification.js +176 -0
- package/lib/common/notify/buildNotification.js.map +1 -0
- package/lib/common/notify/templates.d.ts +2 -0
- package/lib/common/notify/templates.js +21 -0
- package/lib/common/notify/templates.js.map +1 -1
- package/messages/simply.cicd.notify.build.md +83 -0
- package/messages/simply.cicd.notify.teams.md +1 -1
- package/oclif.manifest.json +187 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -49,6 +49,7 @@ This package is part of the [`@simplysf/simply`](https://github.com/SimplySF/sim
|
|
|
49
49
|
- [`sf simply cicd deploy project run-apex-tests`](#sf-simply-cicd-deploy-project-run-apex-tests)
|
|
50
50
|
- [`sf simply cicd deploy project validate`](#sf-simply-cicd-deploy-project-validate)
|
|
51
51
|
- [`sf simply cicd deploy validate`](#sf-simply-cicd-deploy-validate)
|
|
52
|
+
- [`sf simply cicd notify build`](#sf-simply-cicd-notify-build)
|
|
52
53
|
- [`sf simply cicd notify happy-soup`](#sf-simply-cicd-notify-happy-soup)
|
|
53
54
|
- [`sf simply cicd notify project`](#sf-simply-cicd-notify-project)
|
|
54
55
|
- [`sf simply cicd notify teams`](#sf-simply-cicd-notify-teams)
|
|
@@ -83,7 +84,7 @@ EXAMPLES
|
|
|
83
84
|
$ sf simply cicd build cleanup-scratch-orgs --dev-hub my-devhub
|
|
84
85
|
```
|
|
85
86
|
|
|
86
|
-
_See code: [lib/commands/simply/cicd/build/cleanup-scratch-orgs.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
87
|
+
_See code: [lib/commands/simply/cicd/build/cleanup-scratch-orgs.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/build/cleanup-scratch-orgs.js)_
|
|
87
88
|
|
|
88
89
|
## `sf simply cicd build create-fallback-tag`
|
|
89
90
|
|
|
@@ -140,7 +141,7 @@ EXAMPLES
|
|
|
140
141
|
$ sf simply cicd build create-fallback-tag --ci-commit-ref-name main --ci-project-path group/project --project-access-token glpat-... --ci-pipeline-id 123
|
|
141
142
|
```
|
|
142
143
|
|
|
143
|
-
_See code: [lib/commands/simply/cicd/build/create-fallback-tag.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
144
|
+
_See code: [lib/commands/simply/cicd/build/create-fallback-tag.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/build/create-fallback-tag.js)_
|
|
144
145
|
|
|
145
146
|
## `sf simply cicd build create-package-version`
|
|
146
147
|
|
|
@@ -213,7 +214,7 @@ EXAMPLES
|
|
|
213
214
|
$ sf simply cicd build create-package-version --ci-commit-ref-name main --ci-commit-sha a1b2c3d --ci-pipeline-id 123 --ci-pipeline-url https://gitlab.example.com/pipelines/123 --ci-project-path group/project --project-access-token glpat-... --packaging-devhub my-packaging-devhub
|
|
214
215
|
```
|
|
215
216
|
|
|
216
|
-
_See code: [lib/commands/simply/cicd/build/create-package-version.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
217
|
+
_See code: [lib/commands/simply/cicd/build/create-package-version.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/build/create-package-version.js)_
|
|
217
218
|
|
|
218
219
|
## `sf simply cicd build create-scratch`
|
|
219
220
|
|
|
@@ -254,7 +255,7 @@ EXAMPLES
|
|
|
254
255
|
$ sf simply cicd build create-scratch --dev-hub my-devhub
|
|
255
256
|
```
|
|
256
257
|
|
|
257
|
-
_See code: [lib/commands/simply/cicd/build/create-scratch.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
258
|
+
_See code: [lib/commands/simply/cicd/build/create-scratch.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/build/create-scratch.js)_
|
|
258
259
|
|
|
259
260
|
## `sf simply cicd build delete-scratch`
|
|
260
261
|
|
|
@@ -293,7 +294,7 @@ EXAMPLES
|
|
|
293
294
|
$ sf simply cicd build delete-scratch --dev-hub my-devhub
|
|
294
295
|
```
|
|
295
296
|
|
|
296
|
-
_See code: [lib/commands/simply/cicd/build/delete-scratch.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
297
|
+
_See code: [lib/commands/simply/cicd/build/delete-scratch.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/build/delete-scratch.js)_
|
|
297
298
|
|
|
298
299
|
## `sf simply cicd build determine-package-changes`
|
|
299
300
|
|
|
@@ -326,7 +327,7 @@ EXAMPLES
|
|
|
326
327
|
$ sf simply cicd build determine-package-changes --out changes.env
|
|
327
328
|
```
|
|
328
329
|
|
|
329
|
-
_See code: [lib/commands/simply/cicd/build/determine-package-changes.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
330
|
+
_See code: [lib/commands/simply/cicd/build/determine-package-changes.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/build/determine-package-changes.js)_
|
|
330
331
|
|
|
331
332
|
## `sf simply cicd build generate-flexipage-diff`
|
|
332
333
|
|
|
@@ -384,7 +385,7 @@ EXAMPLES
|
|
|
384
385
|
$ sf simply cicd build generate-flexipage-diff --vcs-provider github --ci-repository my-org/my-repo --ci-pull-request-number 45 --ci-run-id 987 --from abc123 --to def456 --project-access-token ghp-...
|
|
385
386
|
```
|
|
386
387
|
|
|
387
|
-
_See code: [lib/commands/simply/cicd/build/generate-flexipage-diff.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
388
|
+
_See code: [lib/commands/simply/cicd/build/generate-flexipage-diff.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/build/generate-flexipage-diff.js)_
|
|
388
389
|
|
|
389
390
|
## `sf simply cicd build generate-flow-diff`
|
|
390
391
|
|
|
@@ -442,7 +443,7 @@ EXAMPLES
|
|
|
442
443
|
$ sf simply cicd build generate-flow-diff --vcs-provider github --ci-repository my-org/my-repo --ci-pull-request-number 45 --ci-run-id 987 --from abc123 --to def456 --project-access-token ghp-...
|
|
443
444
|
```
|
|
444
445
|
|
|
445
|
-
_See code: [lib/commands/simply/cicd/build/generate-flow-diff.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
446
|
+
_See code: [lib/commands/simply/cicd/build/generate-flow-diff.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/build/generate-flow-diff.js)_
|
|
446
447
|
|
|
447
448
|
## `sf simply cicd build install-dependencies`
|
|
448
449
|
|
|
@@ -493,7 +494,7 @@ FLAG DESCRIPTIONS
|
|
|
493
494
|
prompt in a pipeline, it is auto-approved.
|
|
494
495
|
```
|
|
495
496
|
|
|
496
|
-
_See code: [lib/commands/simply/cicd/build/install-dependencies.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
497
|
+
_See code: [lib/commands/simply/cicd/build/install-dependencies.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/build/install-dependencies.js)_
|
|
497
498
|
|
|
498
499
|
## `sf simply cicd build lwc-jest`
|
|
499
500
|
|
|
@@ -521,7 +522,7 @@ EXAMPLES
|
|
|
521
522
|
$ sf simply cicd build lwc-jest
|
|
522
523
|
```
|
|
523
524
|
|
|
524
|
-
_See code: [lib/commands/simply/cicd/build/lwc-jest.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
525
|
+
_See code: [lib/commands/simply/cicd/build/lwc-jest.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/build/lwc-jest.js)_
|
|
525
526
|
|
|
526
527
|
## `sf simply cicd build publish-utam-page-objects`
|
|
527
528
|
|
|
@@ -624,7 +625,7 @@ EXAMPLES
|
|
|
624
625
|
--subscriber-package-version-id 04tXXXXXXXXXXXXXXX --dry-run
|
|
625
626
|
```
|
|
626
627
|
|
|
627
|
-
_See code: [lib/commands/simply/cicd/build/publish-utam-page-objects.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
628
|
+
_See code: [lib/commands/simply/cicd/build/publish-utam-page-objects.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/build/publish-utam-page-objects.js)_
|
|
628
629
|
|
|
629
630
|
## `sf simply cicd build push-scratch`
|
|
630
631
|
|
|
@@ -665,7 +666,7 @@ EXAMPLES
|
|
|
665
666
|
$ sf simply cicd build push-scratch --jwt-key-file ./server.key
|
|
666
667
|
```
|
|
667
668
|
|
|
668
|
-
_See code: [lib/commands/simply/cicd/build/push-scratch.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
669
|
+
_See code: [lib/commands/simply/cicd/build/push-scratch.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/build/push-scratch.js)_
|
|
669
670
|
|
|
670
671
|
## `sf simply cicd build test-scratch`
|
|
671
672
|
|
|
@@ -701,7 +702,7 @@ EXAMPLES
|
|
|
701
702
|
$ sf simply cicd build test-scratch --jwt-key-file ./server.key
|
|
702
703
|
```
|
|
703
704
|
|
|
704
|
-
_See code: [lib/commands/simply/cicd/build/test-scratch.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
705
|
+
_See code: [lib/commands/simply/cicd/build/test-scratch.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/build/test-scratch.js)_
|
|
705
706
|
|
|
706
707
|
## `sf simply cicd deploy happy-soup deploy-unpackaged`
|
|
707
708
|
|
|
@@ -752,7 +753,7 @@ EXAMPLES
|
|
|
752
753
|
$ sf simply cicd deploy happy-soup deploy-unpackaged --ci-job-token $CI_JOB_TOKEN --alias my-org --source-branch-name release/uat
|
|
753
754
|
```
|
|
754
755
|
|
|
755
|
-
_See code: [lib/commands/simply/cicd/deploy/happy-soup/deploy-unpackaged.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
756
|
+
_See code: [lib/commands/simply/cicd/deploy/happy-soup/deploy-unpackaged.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/happy-soup/deploy-unpackaged.js)_
|
|
756
757
|
|
|
757
758
|
## `sf simply cicd deploy happy-soup deployment-close-out`
|
|
758
759
|
|
|
@@ -806,7 +807,7 @@ EXAMPLES
|
|
|
806
807
|
$ sf simply cicd deploy happy-soup deployment-close-out --ci-commit-ref-name main --ci-pipeline-id 123 --ci-project-path group/project --project-access-token $PROJECT_ACCESS_TOKEN --deploy-release-date 2026-01-15
|
|
807
808
|
```
|
|
808
809
|
|
|
809
|
-
_See code: [lib/commands/simply/cicd/deploy/happy-soup/deployment-close-out.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
810
|
+
_See code: [lib/commands/simply/cicd/deploy/happy-soup/deployment-close-out.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/happy-soup/deployment-close-out.js)_
|
|
810
811
|
|
|
811
812
|
## `sf simply cicd deploy happy-soup install-packaged`
|
|
812
813
|
|
|
@@ -866,7 +867,7 @@ FLAG DESCRIPTIONS
|
|
|
866
867
|
prompt in a pipeline, it is auto-approved.
|
|
867
868
|
```
|
|
868
869
|
|
|
869
|
-
_See code: [lib/commands/simply/cicd/deploy/happy-soup/install-packaged.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
870
|
+
_See code: [lib/commands/simply/cicd/deploy/happy-soup/install-packaged.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/happy-soup/install-packaged.js)_
|
|
870
871
|
|
|
871
872
|
## `sf simply cicd deploy happy-soup post-deploy`
|
|
872
873
|
|
|
@@ -917,7 +918,7 @@ EXAMPLES
|
|
|
917
918
|
$ sf simply cicd deploy happy-soup post-deploy --ci-job-token $CI_JOB_TOKEN --alias my-org --source-branch-name release/uat
|
|
918
919
|
```
|
|
919
920
|
|
|
920
|
-
_See code: [lib/commands/simply/cicd/deploy/happy-soup/post-deploy.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
921
|
+
_See code: [lib/commands/simply/cicd/deploy/happy-soup/post-deploy.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/happy-soup/post-deploy.js)_
|
|
921
922
|
|
|
922
923
|
## `sf simply cicd deploy happy-soup post-destructive`
|
|
923
924
|
|
|
@@ -968,7 +969,7 @@ EXAMPLES
|
|
|
968
969
|
$ sf simply cicd deploy happy-soup post-destructive --ci-job-token $CI_JOB_TOKEN --alias my-org --source-branch-name release/uat
|
|
969
970
|
```
|
|
970
971
|
|
|
971
|
-
_See code: [lib/commands/simply/cicd/deploy/happy-soup/post-destructive.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
972
|
+
_See code: [lib/commands/simply/cicd/deploy/happy-soup/post-destructive.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/happy-soup/post-destructive.js)_
|
|
972
973
|
|
|
973
974
|
## `sf simply cicd deploy happy-soup pre-destructive`
|
|
974
975
|
|
|
@@ -1019,7 +1020,7 @@ EXAMPLES
|
|
|
1019
1020
|
$ sf simply cicd deploy happy-soup pre-destructive --ci-job-token $CI_JOB_TOKEN --alias my-org --source-branch-name release/uat
|
|
1020
1021
|
```
|
|
1021
1022
|
|
|
1022
|
-
_See code: [lib/commands/simply/cicd/deploy/happy-soup/pre-destructive.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1023
|
+
_See code: [lib/commands/simply/cicd/deploy/happy-soup/pre-destructive.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/happy-soup/pre-destructive.js)_
|
|
1023
1024
|
|
|
1024
1025
|
## `sf simply cicd deploy happy-soup tag-deployment`
|
|
1025
1026
|
|
|
@@ -1071,7 +1072,7 @@ EXAMPLES
|
|
|
1071
1072
|
$ sf simply cicd deploy happy-soup tag-deployment --alias my-org --ci-pipeline-id 123 --ci-pipeline-url https://gitlab.example.com/group/project/-/pipelines/123 --ci-project-path group/project --ci-merge-request-iid 45 --ci-merge-request-project-url https://gitlab.example.com/group/project --project-access-token $PROJECT_ACCESS_TOKEN
|
|
1072
1073
|
```
|
|
1073
1074
|
|
|
1074
|
-
_See code: [lib/commands/simply/cicd/deploy/happy-soup/tag-deployment.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1075
|
+
_See code: [lib/commands/simply/cicd/deploy/happy-soup/tag-deployment.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/happy-soup/tag-deployment.js)_
|
|
1075
1076
|
|
|
1076
1077
|
## `sf simply cicd deploy happy-soup validate`
|
|
1077
1078
|
|
|
@@ -1109,7 +1110,7 @@ EXAMPLES
|
|
|
1109
1110
|
$ sf simply cicd deploy happy-soup validate --deploy-config-file deployment-configs/uat.json --deploy-rules-file config/deploy-rules.json
|
|
1110
1111
|
```
|
|
1111
1112
|
|
|
1112
|
-
_See code: [lib/commands/simply/cicd/deploy/happy-soup/validate.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1113
|
+
_See code: [lib/commands/simply/cicd/deploy/happy-soup/validate.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/happy-soup/validate.js)_
|
|
1113
1114
|
|
|
1114
1115
|
## `sf simply cicd deploy project deploy-unpackaged`
|
|
1115
1116
|
|
|
@@ -1157,7 +1158,7 @@ EXAMPLES
|
|
|
1157
1158
|
$ sf simply cicd deploy project deploy-unpackaged --ci-job-token $CI_JOB_TOKEN --alias my-org
|
|
1158
1159
|
```
|
|
1159
1160
|
|
|
1160
|
-
_See code: [lib/commands/simply/cicd/deploy/project/deploy-unpackaged.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1161
|
+
_See code: [lib/commands/simply/cicd/deploy/project/deploy-unpackaged.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/project/deploy-unpackaged.js)_
|
|
1161
1162
|
|
|
1162
1163
|
## `sf simply cicd deploy project install-packaged`
|
|
1163
1164
|
|
|
@@ -1221,7 +1222,7 @@ FLAG DESCRIPTIONS
|
|
|
1221
1222
|
prompt in a pipeline, it is auto-approved.
|
|
1222
1223
|
```
|
|
1223
1224
|
|
|
1224
|
-
_See code: [lib/commands/simply/cicd/deploy/project/install-packaged.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1225
|
+
_See code: [lib/commands/simply/cicd/deploy/project/install-packaged.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/project/install-packaged.js)_
|
|
1225
1226
|
|
|
1226
1227
|
## `sf simply cicd deploy project post-deploy`
|
|
1227
1228
|
|
|
@@ -1269,7 +1270,7 @@ EXAMPLES
|
|
|
1269
1270
|
$ sf simply cicd deploy project post-deploy --ci-job-token $CI_JOB_TOKEN --alias my-org
|
|
1270
1271
|
```
|
|
1271
1272
|
|
|
1272
|
-
_See code: [lib/commands/simply/cicd/deploy/project/post-deploy.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1273
|
+
_See code: [lib/commands/simply/cicd/deploy/project/post-deploy.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/project/post-deploy.js)_
|
|
1273
1274
|
|
|
1274
1275
|
## `sf simply cicd deploy project post-destructive`
|
|
1275
1276
|
|
|
@@ -1317,7 +1318,7 @@ EXAMPLES
|
|
|
1317
1318
|
$ sf simply cicd deploy project post-destructive --ci-job-token $CI_JOB_TOKEN --alias my-org
|
|
1318
1319
|
```
|
|
1319
1320
|
|
|
1320
|
-
_See code: [lib/commands/simply/cicd/deploy/project/post-destructive.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1321
|
+
_See code: [lib/commands/simply/cicd/deploy/project/post-destructive.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/project/post-destructive.js)_
|
|
1321
1322
|
|
|
1322
1323
|
## `sf simply cicd deploy project pre-destructive`
|
|
1323
1324
|
|
|
@@ -1365,7 +1366,7 @@ EXAMPLES
|
|
|
1365
1366
|
$ sf simply cicd deploy project pre-destructive --ci-job-token $CI_JOB_TOKEN --alias my-org
|
|
1366
1367
|
```
|
|
1367
1368
|
|
|
1368
|
-
_See code: [lib/commands/simply/cicd/deploy/project/pre-destructive.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1369
|
+
_See code: [lib/commands/simply/cicd/deploy/project/pre-destructive.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/project/pre-destructive.js)_
|
|
1369
1370
|
|
|
1370
1371
|
## `sf simply cicd deploy project run-apex-tests`
|
|
1371
1372
|
|
|
@@ -1412,7 +1413,7 @@ EXAMPLES
|
|
|
1412
1413
|
$ sf simply cicd deploy project run-apex-tests --ci-job-token $CI_JOB_TOKEN --alias my-org
|
|
1413
1414
|
```
|
|
1414
1415
|
|
|
1415
|
-
_See code: [lib/commands/simply/cicd/deploy/project/run-apex-tests.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1416
|
+
_See code: [lib/commands/simply/cicd/deploy/project/run-apex-tests.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/project/run-apex-tests.js)_
|
|
1416
1417
|
|
|
1417
1418
|
## `sf simply cicd deploy project validate`
|
|
1418
1419
|
|
|
@@ -1447,7 +1448,7 @@ EXAMPLES
|
|
|
1447
1448
|
$ sf simply cicd deploy project validate --deploy-config-file config/deploy.json --deploy-rules-file config/deploy-rules.json
|
|
1448
1449
|
```
|
|
1449
1450
|
|
|
1450
|
-
_See code: [lib/commands/simply/cicd/deploy/project/validate.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1451
|
+
_See code: [lib/commands/simply/cicd/deploy/project/validate.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/project/validate.js)_
|
|
1451
1452
|
|
|
1452
1453
|
## `sf simply cicd deploy validate`
|
|
1453
1454
|
|
|
@@ -1481,7 +1482,83 @@ EXAMPLES
|
|
|
1481
1482
|
$ sf simply cicd deploy validate --deploy-config-file config/deploy.json --deploy-rules-file config/deploy-rules.json
|
|
1482
1483
|
```
|
|
1483
1484
|
|
|
1484
|
-
_See code: [lib/commands/simply/cicd/deploy/validate.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1485
|
+
_See code: [lib/commands/simply/cicd/deploy/validate.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/validate.js)_
|
|
1486
|
+
|
|
1487
|
+
## `sf simply cicd notify build`
|
|
1488
|
+
|
|
1489
|
+
Send a build job's failure, or the package version it created, to Microsoft Teams, with issue-tracker integration.
|
|
1490
|
+
|
|
1491
|
+
```
|
|
1492
|
+
USAGE
|
|
1493
|
+
$ sf simply cicd notify build [--json] [--flags-dir <value>] [--ci-commit-ref-name <value>] [--ci-job-name <value>]
|
|
1494
|
+
[--ci-job-stage <value>] [--ci-job-status <value>] [--ci-pipeline-id <value>] [--ci-pipeline-url <value>]
|
|
1495
|
+
[--ci-project-title <value>] [--subscriber-package-version-id <value>] [--enabled] [--alm-base-url <value>]
|
|
1496
|
+
[--alm-project-key <value>] [--alm-provider gitlab-issues|jira] [--teams-webhook-url <value>...] [--debug]
|
|
1497
|
+
|
|
1498
|
+
FLAGS
|
|
1499
|
+
--alm-base-url=<value> [env: SIMPLY_CICD_ALM_BASE_URL] Base URL that an issue reference is appended
|
|
1500
|
+
to, e.g. https://jira.example.com/browse for Jira or
|
|
1501
|
+
https://gitlab.com/group/project/-/issues for GitLab Issues. References are
|
|
1502
|
+
shown without links if not provided.
|
|
1503
|
+
--alm-project-key=<value> [env: SIMPLY_CICD_ALM_PROJECT_KEY] Fallback project key(s) used to search
|
|
1504
|
+
commit messages for issue references, if none are configured in
|
|
1505
|
+
.sfdevrc.json. Only used by prefix-keyed trackers such as Jira.
|
|
1506
|
+
--alm-provider=<option> [default: jira, env: SIMPLY_CICD_ALM_PROVIDER] The issue tracker whose
|
|
1507
|
+
reference format to look for in commit messages.
|
|
1508
|
+
<options: gitlab-issues|jira>
|
|
1509
|
+
--ci-commit-ref-name=<value> [env: SIMPLY_CICD_CI_COMMIT_REF_NAME] The git branch or tag ref for this
|
|
1510
|
+
pipeline run.
|
|
1511
|
+
--ci-job-name=<value> [env: SIMPLY_CICD_CI_JOB_NAME] The name of the current CI job.
|
|
1512
|
+
--ci-job-stage=<value> [env: SIMPLY_CICD_CI_JOB_STAGE] The stage of the current CI job.
|
|
1513
|
+
--ci-job-status=<value> [env: SIMPLY_CICD_CI_JOB_STATUS] The status of the current CI job (e.g.
|
|
1514
|
+
success, failed, canceled).
|
|
1515
|
+
--ci-pipeline-id=<value> [env: SIMPLY_CICD_CI_PIPELINE_ID] The ID of the current CI pipeline.
|
|
1516
|
+
--ci-pipeline-url=<value> [env: SIMPLY_CICD_CI_PIPELINE_URL] The URL of the current CI pipeline.
|
|
1517
|
+
--ci-project-title=<value> [env: SIMPLY_CICD_CI_PROJECT_TITLE] The project title shown in the
|
|
1518
|
+
notification card's heading.
|
|
1519
|
+
--debug [env: SIMPLY_CICD_DEBUG] Enable verbose debug logging.
|
|
1520
|
+
--enabled [env: SIMPLY_CICD_ENABLED] Whether the notification is actually sent.
|
|
1521
|
+
Defaults to false so pipelines can gate this behind their own condition.
|
|
1522
|
+
--subscriber-package-version-id=<value> [env: SIMPLY_CICD_SUBSCRIBER_PACKAGE_VERSION_ID] The subscriber package
|
|
1523
|
+
version ID (04t...) created by this job. Defaults to the one in
|
|
1524
|
+
subscriberPackageVersionId.env, written by build create-package-version.
|
|
1525
|
+
--teams-webhook-url=<value>... One or more Teams webhook URLs to send the notification to.
|
|
1526
|
+
|
|
1527
|
+
GLOBAL FLAGS
|
|
1528
|
+
--flags-dir=<value> Import flag values from a directory.
|
|
1529
|
+
--json Format output as json.
|
|
1530
|
+
|
|
1531
|
+
DESCRIPTION
|
|
1532
|
+
Send a build job's failure, or the package version it created, to Microsoft Teams, with issue-tracker integration.
|
|
1533
|
+
|
|
1534
|
+
Run in every build job's `after_script`. Which card it posts depends on `--ci-job-status`:
|
|
1535
|
+
|
|
1536
|
+
- `failed`: a failure card with the job, stage, branch, and pipeline, whichever build job failed.
|
|
1537
|
+
- `success`: a package version card, but only when the job created a package version. The card shows the new version
|
|
1538
|
+
tag, its `04t` ID, and the issue references in the commits since the previous version tag. Every other successful job
|
|
1539
|
+
sends nothing.
|
|
1540
|
+
- Anything else (e.g. `canceled`): nothing.
|
|
1541
|
+
|
|
1542
|
+
The `04t` ID comes from `--subscriber-package-version-id`, or else from the `subscriberPackageVersionId.env` file that
|
|
1543
|
+
`build create-package-version` writes to the working directory. The new version's tag is the tag at `HEAD` annotated
|
|
1544
|
+
with that ID. The previous version's tag is the nearest earlier tag in the project's version tag format
|
|
1545
|
+
(`plugins.simply.versionTagFormat` or `SIMPLY_CICD_VERSION_TAG_FORMAT`). The command fetches tags, and the full
|
|
1546
|
+
history when the clone is shallow. If a tag or the history can't be found, the card shows `N/A` instead of failing the
|
|
1547
|
+
job.
|
|
1548
|
+
|
|
1549
|
+
EXAMPLES
|
|
1550
|
+
Post a card from a build job's after_script; it only sends one when the job failed or created a package version:
|
|
1551
|
+
|
|
1552
|
+
$ sf simply cicd notify build --ci-job-name push-scratch --ci-job-status "$CI_JOB_STATUS" --teams-webhook-url \
|
|
1553
|
+
https://outlook.office.com/webhook/... --enabled
|
|
1554
|
+
|
|
1555
|
+
Announce a package version with linked Jira stories:
|
|
1556
|
+
|
|
1557
|
+
$ sf simply cicd notify build --ci-job-status success --alm-base-url https://jira.example.com/browse \
|
|
1558
|
+
--teams-webhook-url https://outlook.office.com/webhook/... --enabled
|
|
1559
|
+
```
|
|
1560
|
+
|
|
1561
|
+
_See code: [lib/commands/simply/cicd/notify/build.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/notify/build.js)_
|
|
1485
1562
|
|
|
1486
1563
|
## `sf simply cicd notify happy-soup`
|
|
1487
1564
|
|
|
@@ -1554,7 +1631,7 @@ EXAMPLES
|
|
|
1554
1631
|
$ sf simply cicd notify happy-soup --after-script --is-final-job --notify-on-completion --ci-job-status success --teams-webhook-url https://outlook.office.com/webhook/... --enabled
|
|
1555
1632
|
```
|
|
1556
1633
|
|
|
1557
|
-
_See code: [lib/commands/simply/cicd/notify/happy-soup.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1634
|
+
_See code: [lib/commands/simply/cicd/notify/happy-soup.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/notify/happy-soup.js)_
|
|
1558
1635
|
|
|
1559
1636
|
## `sf simply cicd notify project`
|
|
1560
1637
|
|
|
@@ -1628,7 +1705,7 @@ EXAMPLES
|
|
|
1628
1705
|
$ sf simply cicd notify project --after-script --ci-job-stage post-destructive --ci-job-status success --teams-webhook-url https://outlook.office.com/webhook/... --enabled
|
|
1629
1706
|
```
|
|
1630
1707
|
|
|
1631
|
-
_See code: [lib/commands/simply/cicd/notify/project.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1708
|
+
_See code: [lib/commands/simply/cicd/notify/project.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/notify/project.js)_
|
|
1632
1709
|
|
|
1633
1710
|
## `sf simply cicd notify teams`
|
|
1634
1711
|
|
|
@@ -1654,13 +1731,13 @@ DESCRIPTION
|
|
|
1654
1731
|
Send a serialized JSON payload to a Microsoft Teams webhook.
|
|
1655
1732
|
|
|
1656
1733
|
Posts a payload as-is to one or more Microsoft Teams incoming webhook URLs. Use this for custom notifications that
|
|
1657
|
-
don't fit the built-in `notify project
|
|
1734
|
+
don't fit the built-in `notify project`, `notify happy-soup`, or `notify build` card templates.
|
|
1658
1735
|
|
|
1659
1736
|
EXAMPLES
|
|
1660
1737
|
$ sf simply cicd notify teams --payload '{"text":"Deployment complete"}' --webhook-url https://outlook.office.com/webhook/... --enabled
|
|
1661
1738
|
```
|
|
1662
1739
|
|
|
1663
|
-
_See code: [lib/commands/simply/cicd/notify/teams.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1740
|
+
_See code: [lib/commands/simply/cicd/notify/teams.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/notify/teams.js)_
|
|
1664
1741
|
|
|
1665
1742
|
## `sf simply cicd sfdx-dependabot`
|
|
1666
1743
|
|
|
@@ -1736,7 +1813,7 @@ FLAG DESCRIPTIONS
|
|
|
1736
1813
|
Defaults to the selected provider's public instance if not provided.
|
|
1737
1814
|
```
|
|
1738
1815
|
|
|
1739
|
-
_See code: [lib/commands/simply/cicd/sfdx-dependabot.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1816
|
+
_See code: [lib/commands/simply/cicd/sfdx-dependabot.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.16.0/packages/simply-cicd/lib/commands/simply/cicd/sfdx-dependabot.js)_
|
|
1740
1817
|
<!-- commandsstop -->
|
|
1741
1818
|
|
|
1742
1819
|
## License
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { type AlmProviderKind } from '@simplysf/simply-cicd-core';
|
|
3
|
+
import { type NotifyBuildResult } from '../../../../common/notify/buildNotification.js';
|
|
4
|
+
export type { NotifyBuildResult } from '../../../../common/notify/buildNotification.js';
|
|
5
|
+
/** Sends a build job's failure, or its new package version and stories, to Microsoft Teams. */
|
|
6
|
+
export default class NotifyBuild extends SfCommand<NotifyBuildResult> {
|
|
7
|
+
static readonly summary: string;
|
|
8
|
+
static readonly description: string;
|
|
9
|
+
static readonly examples: string[];
|
|
10
|
+
static readonly flags: {
|
|
11
|
+
'ci-commit-ref-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
'ci-job-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
'ci-job-stage': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
'ci-job-status': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
'ci-pipeline-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
'ci-pipeline-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
'ci-project-title': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
'subscriber-package-version-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
|
+
enabled: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
20
|
+
'alm-base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
|
+
'alm-project-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
22
|
+
'alm-provider': import("@oclif/core/interfaces").OptionFlag<AlmProviderKind, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
|
+
'teams-webhook-url': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
24
|
+
debug: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
25
|
+
'flags-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
26
|
+
};
|
|
27
|
+
run(): Promise<NotifyBuildResult>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, SimplySF.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { Messages } from '@salesforce/core';
|
|
17
|
+
import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
|
|
18
|
+
import { listAlmProviderKinds } from '@simplysf/simply-cicd-core';
|
|
19
|
+
import { logger } from '../../../../common/logger.js';
|
|
20
|
+
import { sendBuildNotification, } from '../../../../common/notify/buildNotification.js';
|
|
21
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
22
|
+
const messages = Messages.loadMessages('@simplysf/simply-cicd', 'simply.cicd.notify.build');
|
|
23
|
+
/** Sends a build job's failure, or its new package version and stories, to Microsoft Teams. */
|
|
24
|
+
export default class NotifyBuild extends SfCommand {
|
|
25
|
+
static summary = messages.getMessage('summary');
|
|
26
|
+
static description = messages.getMessage('description');
|
|
27
|
+
static examples = messages.getMessages('examples');
|
|
28
|
+
static flags = {
|
|
29
|
+
...SfCommand.baseFlags,
|
|
30
|
+
'ci-commit-ref-name': Flags.string({
|
|
31
|
+
summary: messages.getMessage('flags.ci-commit-ref-name.summary'),
|
|
32
|
+
env: 'SIMPLY_CICD_CI_COMMIT_REF_NAME',
|
|
33
|
+
}),
|
|
34
|
+
'ci-job-name': Flags.string({
|
|
35
|
+
summary: messages.getMessage('flags.ci-job-name.summary'),
|
|
36
|
+
env: 'SIMPLY_CICD_CI_JOB_NAME',
|
|
37
|
+
}),
|
|
38
|
+
'ci-job-stage': Flags.string({
|
|
39
|
+
summary: messages.getMessage('flags.ci-job-stage.summary'),
|
|
40
|
+
env: 'SIMPLY_CICD_CI_JOB_STAGE',
|
|
41
|
+
}),
|
|
42
|
+
'ci-job-status': Flags.string({
|
|
43
|
+
summary: messages.getMessage('flags.ci-job-status.summary'),
|
|
44
|
+
env: 'SIMPLY_CICD_CI_JOB_STATUS',
|
|
45
|
+
}),
|
|
46
|
+
'ci-pipeline-id': Flags.string({
|
|
47
|
+
summary: messages.getMessage('flags.ci-pipeline-id.summary'),
|
|
48
|
+
env: 'SIMPLY_CICD_CI_PIPELINE_ID',
|
|
49
|
+
}),
|
|
50
|
+
'ci-pipeline-url': Flags.string({
|
|
51
|
+
summary: messages.getMessage('flags.ci-pipeline-url.summary'),
|
|
52
|
+
env: 'SIMPLY_CICD_CI_PIPELINE_URL',
|
|
53
|
+
}),
|
|
54
|
+
'ci-project-title': Flags.string({
|
|
55
|
+
summary: messages.getMessage('flags.ci-project-title.summary'),
|
|
56
|
+
env: 'SIMPLY_CICD_CI_PROJECT_TITLE',
|
|
57
|
+
}),
|
|
58
|
+
'subscriber-package-version-id': Flags.string({
|
|
59
|
+
summary: messages.getMessage('flags.subscriber-package-version-id.summary'),
|
|
60
|
+
env: 'SIMPLY_CICD_SUBSCRIBER_PACKAGE_VERSION_ID',
|
|
61
|
+
}),
|
|
62
|
+
enabled: Flags.boolean({
|
|
63
|
+
summary: messages.getMessage('flags.enabled.summary'),
|
|
64
|
+
default: false,
|
|
65
|
+
env: 'SIMPLY_CICD_ENABLED',
|
|
66
|
+
}),
|
|
67
|
+
'alm-base-url': Flags.string({
|
|
68
|
+
summary: messages.getMessage('flags.alm-base-url.summary'),
|
|
69
|
+
env: 'SIMPLY_CICD_ALM_BASE_URL',
|
|
70
|
+
}),
|
|
71
|
+
'alm-project-key': Flags.string({
|
|
72
|
+
summary: messages.getMessage('flags.alm-project-key.summary'),
|
|
73
|
+
env: 'SIMPLY_CICD_ALM_PROJECT_KEY',
|
|
74
|
+
}),
|
|
75
|
+
'alm-provider': Flags.custom({ options: listAlmProviderKinds() })({
|
|
76
|
+
summary: messages.getMessage('flags.alm-provider.summary'),
|
|
77
|
+
default: 'jira',
|
|
78
|
+
env: 'SIMPLY_CICD_ALM_PROVIDER',
|
|
79
|
+
}),
|
|
80
|
+
'teams-webhook-url': Flags.string({
|
|
81
|
+
summary: messages.getMessage('flags.teams-webhook-url.summary'),
|
|
82
|
+
multiple: true,
|
|
83
|
+
}),
|
|
84
|
+
debug: Flags.boolean({
|
|
85
|
+
summary: messages.getMessage('flags.debug.summary'),
|
|
86
|
+
default: false,
|
|
87
|
+
env: 'SIMPLY_CICD_DEBUG',
|
|
88
|
+
}),
|
|
89
|
+
};
|
|
90
|
+
async run() {
|
|
91
|
+
const { flags } = await this.parse(NotifyBuild);
|
|
92
|
+
logger.raw('\n' + '='.repeat(80));
|
|
93
|
+
logger.info('>>> Sending Teams Notification <<<');
|
|
94
|
+
logger.raw('='.repeat(80) + '\n');
|
|
95
|
+
if (flags.debug) {
|
|
96
|
+
logger.debug('Incoming Parameters:', flags);
|
|
97
|
+
}
|
|
98
|
+
if (!flags.enabled) {
|
|
99
|
+
logger.info('Teams notification is disabled. Skipping.');
|
|
100
|
+
return { sent: false };
|
|
101
|
+
}
|
|
102
|
+
if (!flags['teams-webhook-url'] || flags['teams-webhook-url'].length === 0) {
|
|
103
|
+
throw messages.createError('error.missingTeamsWebhookUrl');
|
|
104
|
+
}
|
|
105
|
+
const options = {
|
|
106
|
+
ciCommitRefName: flags['ci-commit-ref-name'],
|
|
107
|
+
ciJobName: flags['ci-job-name'],
|
|
108
|
+
ciJobStage: flags['ci-job-stage'],
|
|
109
|
+
ciJobStatus: flags['ci-job-status'],
|
|
110
|
+
ciPipelineId: flags['ci-pipeline-id'],
|
|
111
|
+
ciPipelineUrl: flags['ci-pipeline-url'],
|
|
112
|
+
ciProjectTitle: flags['ci-project-title'],
|
|
113
|
+
subscriberPackageVersionId: flags['subscriber-package-version-id'],
|
|
114
|
+
almBaseUrl: flags['alm-base-url'],
|
|
115
|
+
almProjectKey: flags['alm-project-key'],
|
|
116
|
+
almProvider: flags['alm-provider'],
|
|
117
|
+
teamsWebhookUrl: flags['teams-webhook-url'],
|
|
118
|
+
debug: flags.debug,
|
|
119
|
+
};
|
|
120
|
+
try {
|
|
121
|
+
const result = await sendBuildNotification(options);
|
|
122
|
+
logger.raw('\n' + '='.repeat(80));
|
|
123
|
+
logger.success(result.sent ? 'Successfully sent notification' : 'No notification needed');
|
|
124
|
+
logger.raw('='.repeat(80) + '\n');
|
|
125
|
+
return result;
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
logger.raw('\n' + '='.repeat(80));
|
|
129
|
+
logger.error('Error sending notification');
|
|
130
|
+
logger.raw(error.message);
|
|
131
|
+
logger.raw('='.repeat(80) + '\n');
|
|
132
|
+
throw error;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=build.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../../../../src/commands/simply/cicd/notify/build.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAwB,MAAM,4BAA4B,CAAC;AACxF,OAAO,EAAE,MAAM,EAA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-cicd-core';
|
|
2
|
+
import { type CommitStories } from './getCommitStories.js';
|
|
3
|
+
/** The file `build create-package-version` writes the new version's `04t` ID to. */
|
|
4
|
+
export declare const SUBSCRIBER_PACKAGE_VERSION_ID_FILE = "subscriberPackageVersionId.env";
|
|
5
|
+
export type NotifyBuildResult = {
|
|
6
|
+
sent: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type NotifyBuildOptions = {
|
|
9
|
+
ciCommitRefName?: string;
|
|
10
|
+
ciJobName?: string;
|
|
11
|
+
ciJobStage?: string;
|
|
12
|
+
ciJobStatus?: string;
|
|
13
|
+
ciPipelineId?: string;
|
|
14
|
+
ciPipelineUrl?: string;
|
|
15
|
+
ciProjectTitle?: string;
|
|
16
|
+
subscriberPackageVersionId?: string;
|
|
17
|
+
almBaseUrl?: string;
|
|
18
|
+
almProjectKey?: string;
|
|
19
|
+
almProvider?: AlmProviderKind;
|
|
20
|
+
teamsWebhookUrl?: string[];
|
|
21
|
+
debug: boolean;
|
|
22
|
+
};
|
|
23
|
+
/** The new package version's git tag and the issue references since the previous one. */
|
|
24
|
+
export type PackageVersionHistory = CommitStories & {
|
|
25
|
+
versionTag: string;
|
|
26
|
+
previousVersionTag: string;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* The `04t` ID of a package version created in this job: the explicit value if given, otherwise the
|
|
30
|
+
* one `build create-package-version` wrote to {@link SUBSCRIBER_PACKAGE_VERSION_ID_FILE}. `undefined`
|
|
31
|
+
* when the job created none.
|
|
32
|
+
*/
|
|
33
|
+
export declare function resolveSubscriberPackageVersionId(explicit?: string): Promise<string | undefined>;
|
|
34
|
+
/** Fetches the tags, and the full history when the CI clone is shallow, so tags can be described and diffed. */
|
|
35
|
+
export declare function fetchVersionHistory(): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* The tag at `HEAD` that `build create-package-version` annotated with `subscriberPackageVersionId`.
|
|
38
|
+
* Matching on the annotation rather than the name works for any version tag format or suffix.
|
|
39
|
+
*/
|
|
40
|
+
export declare function findPackageVersionTag(subscriberPackageVersionId: string): Promise<string | undefined>;
|
|
41
|
+
/** The nearest version tag, in the project's format, before `versionTag`. `undefined` for a package's first version. */
|
|
42
|
+
export declare function findPreviousVersionTag(versionTag: string): Promise<string | undefined>;
|
|
43
|
+
/**
|
|
44
|
+
* Resolves the new version's tag, the previous version's tag, and the issue references in between.
|
|
45
|
+
* Never throws: anything it can't resolve comes back as `N/A`, because a notification shouldn't be
|
|
46
|
+
* what fails a build.
|
|
47
|
+
*/
|
|
48
|
+
export declare function getPackageVersionHistory(subscriberPackageVersionId: string, options: Pick<NotifyBuildOptions, 'almBaseUrl' | 'almProjectKey' | 'almProvider' | 'debug'>): Promise<PackageVersionHistory>;
|
|
49
|
+
/**
|
|
50
|
+
* Posts a failure card for a failed build job, or a package version card for a successful job that
|
|
51
|
+
* created a package version. Any other job result sends nothing.
|
|
52
|
+
*/
|
|
53
|
+
export declare function sendBuildNotification(options: NotifyBuildOptions): Promise<NotifyBuildResult>;
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, SimplySF.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { promises as fs } from 'node:fs';
|
|
17
|
+
import { execa } from 'execa';
|
|
18
|
+
import { isSubscriberPackageVersionId, readSfdxProject } from '@simplysf/simply-core';
|
|
19
|
+
import { createAlmProvider } from '@simplysf/simply-cicd-core';
|
|
20
|
+
import { VersionTagFormat } from '../build/versionTagFormat.js';
|
|
21
|
+
import { logger } from '../logger.js';
|
|
22
|
+
import { NOT_AVAILABLE, renderIssuesFromCommitLog } from './getCommitStories.js';
|
|
23
|
+
import { renderNotifyTemplate } from './renderTemplate.js';
|
|
24
|
+
import { sendNotification } from './sendNotification.js';
|
|
25
|
+
/** The file `build create-package-version` writes the new version's `04t` ID to. */
|
|
26
|
+
export const SUBSCRIBER_PACKAGE_VERSION_ID_FILE = 'subscriberPackageVersionId.env';
|
|
27
|
+
/**
|
|
28
|
+
* The `04t` ID of a package version created in this job: the explicit value if given, otherwise the
|
|
29
|
+
* one `build create-package-version` wrote to {@link SUBSCRIBER_PACKAGE_VERSION_ID_FILE}. `undefined`
|
|
30
|
+
* when the job created none.
|
|
31
|
+
*/
|
|
32
|
+
export async function resolveSubscriberPackageVersionId(explicit) {
|
|
33
|
+
if (explicit) {
|
|
34
|
+
return explicit;
|
|
35
|
+
}
|
|
36
|
+
let content;
|
|
37
|
+
try {
|
|
38
|
+
content = await fs.readFile(SUBSCRIBER_PACKAGE_VERSION_ID_FILE, 'utf8');
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
const value = /^SUBSCRIBER_PACKAGE_VERSION_ID=(?<id>\S+)\s*$/m.exec(content)?.groups?.id;
|
|
44
|
+
return value && isSubscriberPackageVersionId(value) ? value : undefined;
|
|
45
|
+
}
|
|
46
|
+
/** Fetches the tags, and the full history when the CI clone is shallow, so tags can be described and diffed. */
|
|
47
|
+
export async function fetchVersionHistory() {
|
|
48
|
+
const { stdout } = await execa('git', ['rev-parse', '--is-shallow-repository']);
|
|
49
|
+
const unshallow = stdout.trim() === 'true' ? ['--unshallow'] : [];
|
|
50
|
+
await execa('git', ['fetch', ...unshallow, '--tags', '--quiet']);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The tag at `HEAD` that `build create-package-version` annotated with `subscriberPackageVersionId`.
|
|
54
|
+
* Matching on the annotation rather than the name works for any version tag format or suffix.
|
|
55
|
+
*/
|
|
56
|
+
export async function findPackageVersionTag(subscriberPackageVersionId) {
|
|
57
|
+
const { stdout } = await execa('git', [
|
|
58
|
+
'tag',
|
|
59
|
+
'--points-at',
|
|
60
|
+
'HEAD',
|
|
61
|
+
'--format=%(refname:short)%09%(contents:subject)',
|
|
62
|
+
]);
|
|
63
|
+
return stdout
|
|
64
|
+
.split(/\r?\n/)
|
|
65
|
+
.map((line) => line.split('\t'))
|
|
66
|
+
.find(([, subject]) => subject?.trim() === subscriberPackageVersionId)?.[0];
|
|
67
|
+
}
|
|
68
|
+
/** The nearest version tag, in the project's format, before `versionTag`. `undefined` for a package's first version. */
|
|
69
|
+
export async function findPreviousVersionTag(versionTag) {
|
|
70
|
+
const project = await readSfdxProject().catch(() => undefined);
|
|
71
|
+
const glob = VersionTagFormat.fromProject(project).matchPattern();
|
|
72
|
+
try {
|
|
73
|
+
const { stdout } = await execa('git', ['describe', '--tags', '--abbrev=0', '--match', glob, `${versionTag}^`]);
|
|
74
|
+
return stdout.trim() || undefined;
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Resolves the new version's tag, the previous version's tag, and the issue references in between.
|
|
82
|
+
* Never throws: anything it can't resolve comes back as `N/A`, because a notification shouldn't be
|
|
83
|
+
* what fails a build.
|
|
84
|
+
*/
|
|
85
|
+
export async function getPackageVersionHistory(subscriberPackageVersionId, options) {
|
|
86
|
+
const history = { ...NOT_AVAILABLE, versionTag: 'N/A', previousVersionTag: 'N/A' };
|
|
87
|
+
try {
|
|
88
|
+
await fetchVersionHistory();
|
|
89
|
+
const versionTag = await findPackageVersionTag(subscriberPackageVersionId);
|
|
90
|
+
if (!versionTag) {
|
|
91
|
+
logger.warn(`No tag at HEAD is annotated with ${subscriberPackageVersionId}.`);
|
|
92
|
+
return history;
|
|
93
|
+
}
|
|
94
|
+
history.versionTag = versionTag;
|
|
95
|
+
const previousVersionTag = await findPreviousVersionTag(versionTag);
|
|
96
|
+
if (!previousVersionTag) {
|
|
97
|
+
logger.info(`No version tag before ${versionTag}. Skipping stories.`);
|
|
98
|
+
return history;
|
|
99
|
+
}
|
|
100
|
+
history.previousVersionTag = previousVersionTag;
|
|
101
|
+
const { stdout: commits } = await execa('git', ['log', '--pretty=oneline', `${previousVersionTag}..${versionTag}`]);
|
|
102
|
+
if (commits) {
|
|
103
|
+
Object.assign(history, renderIssuesFromCommitLog(commits, options.almProjectKey, {
|
|
104
|
+
almBaseUrl: options.almBaseUrl,
|
|
105
|
+
almProvider: createAlmProvider(options.almProvider ?? 'jira'),
|
|
106
|
+
}));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
logger.warn(`Could not resolve package version history: ${error.message}`);
|
|
111
|
+
if (options.debug) {
|
|
112
|
+
logger.error(String(error));
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return history;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Posts a failure card for a failed build job, or a package version card for a successful job that
|
|
119
|
+
* created a package version. Any other job result sends nothing.
|
|
120
|
+
*/
|
|
121
|
+
export async function sendBuildNotification(options) {
|
|
122
|
+
const { ciJobStatus } = options;
|
|
123
|
+
const templateData = {
|
|
124
|
+
refName: options.ciCommitRefName,
|
|
125
|
+
pipelineUrl: options.ciPipelineUrl,
|
|
126
|
+
pipelineId: options.ciPipelineId,
|
|
127
|
+
projectTitle: options.ciProjectTitle,
|
|
128
|
+
jobName: options.ciJobName,
|
|
129
|
+
stage: options.ciJobStage,
|
|
130
|
+
stories: 'N/A',
|
|
131
|
+
storiesLinked: 'N/A',
|
|
132
|
+
};
|
|
133
|
+
let templateName;
|
|
134
|
+
if (ciJobStatus === 'failed') {
|
|
135
|
+
templateName = 'build-failure-notification';
|
|
136
|
+
}
|
|
137
|
+
else if (ciJobStatus === 'success') {
|
|
138
|
+
const subscriberPackageVersionId = await resolveSubscriberPackageVersionId(options.subscriberPackageVersionId);
|
|
139
|
+
if (!subscriberPackageVersionId) {
|
|
140
|
+
logger.info('No package version was created in this job. Skipping notification.');
|
|
141
|
+
return { sent: false };
|
|
142
|
+
}
|
|
143
|
+
templateName = 'build-package-version-notification';
|
|
144
|
+
logger.info(`Gathering stories for package version ${subscriberPackageVersionId}...`);
|
|
145
|
+
const history = await getPackageVersionHistory(subscriberPackageVersionId, options);
|
|
146
|
+
Object.assign(templateData, {
|
|
147
|
+
subscriberPackageVersionId,
|
|
148
|
+
packageVersion: history.versionTag,
|
|
149
|
+
packageVersionPrevious: history.previousVersionTag,
|
|
150
|
+
stories: history.stories,
|
|
151
|
+
storiesLinked: history.storiesWithUrl,
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
logger.info(`No notification logic for job status: ${ciJobStatus ?? 'unknown'}`);
|
|
156
|
+
return { sent: false };
|
|
157
|
+
}
|
|
158
|
+
const payload = {
|
|
159
|
+
content: renderNotifyTemplate(templateName, templateData),
|
|
160
|
+
refName: options.ciCommitRefName,
|
|
161
|
+
pipelineId: options.ciPipelineId,
|
|
162
|
+
pipelineUrl: options.ciPipelineUrl,
|
|
163
|
+
projectTitle: options.ciProjectTitle,
|
|
164
|
+
jobName: options.ciJobName,
|
|
165
|
+
jobStage: options.ciJobStage,
|
|
166
|
+
jobStatus: ciJobStatus,
|
|
167
|
+
stories: templateData.stories,
|
|
168
|
+
storiesLinked: templateData.storiesLinked,
|
|
169
|
+
packageVersionPrevious: templateData.packageVersionPrevious,
|
|
170
|
+
packageVersion: templateData.packageVersion,
|
|
171
|
+
subscriberPackageVersionId: templateData.subscriberPackageVersionId,
|
|
172
|
+
};
|
|
173
|
+
await sendNotification(options.teamsWebhookUrl, payload);
|
|
174
|
+
return { sent: true };
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=buildNotification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildNotification.js","sourceRoot":"","sources":["../../../src/common/notify/buildNotification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,4BAA4B,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAwB,MAAM,4BAA4B,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,yBAAyB,EAAsB,MAAM,uBAAuB,CAAC;AACrG,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGzD,oFAAoF;AACpF,MAAM,CAAC,MAAM,kCAAkC,GAAG,gCAAgC,CAAC;AAuBnF;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,iCAAiC,CAAC,QAAiB;IACvE,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,IAAI,OAAe,CAAC;IACpB,IAAI,CAAC;QACH,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAkC,EAAE,MAAM,CAAC,CAAC;IAC1E,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,KAAK,GAAG,gDAAgD,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;IACzF,OAAO,KAAK,IAAI,4BAA4B,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,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AI,EAAE,IAAI,EAAE,CAAC;AACxB,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/** Teams notification card templates, keyed the same as the original `.hbs` file names. */
|
|
2
2
|
export declare const NOTIFY_TEMPLATES: {
|
|
3
|
+
readonly 'build-failure-notification': "<table>\n <tr><th colspan=\"3\" style=\"color: white; background-color: darkred;\">{{projectTitle}}: Failed Build</th></tr>\n <tr><th colspan=\"3\" style=\"color: white; background-color: grey;\">Job: {{jobName}} (Stage:\n {{stage}})</th></tr>\n <tr><td>Branch</td><td colspan=\"2\">Pipeline</td></tr>\n <tr><td>{{refName}}</td><td colspan=\"2\"><a\n href=\"{{pipelineUrl}}\"\n >{{pipelineId}}</a></td></tr>\n</table>\n";
|
|
4
|
+
readonly 'build-package-version-notification': "<table>\n <tr><th colspan=\"3\" style=\"color: white; background-color: darkgreen;\">{{projectTitle}}: Package Version\n Created</th></tr>\n <tr><td>Version</td><td>Branch</td><td>Pipeline</td></tr>\n <tr><td>{{packageVersion}}<br />{{subscriberPackageVersionId}}</td><td>{{refName}}</td><td><a\n href=\"{{pipelineUrl}}\"\n >{{pipelineId}}</a></td></tr>\n <tr><td colspan=\"3\">Stories since {{packageVersionPrevious}}</td></tr>\n <tr><td colspan=\"3\">{{{storiesLinked}}}</td></tr>\n</table>\n";
|
|
3
5
|
readonly 'happy-soup-failure-notification': "<table>\n <tr><th colspan=\"3\" style=\"color: white; background-color: darkred;\">Failed Stage:\n {{stage}}</th></tr>\n <tr><td>Environment</td><td>Branch</td><td>Pipeline</td></tr>\n <tr><td>{{environmentName}}</td><td>{{refName}}</td><td><a\n href=\"{{pipelineUrl}}\"\n >{{pipelineId}}</a></td></tr>\n</table>\n";
|
|
4
6
|
readonly 'happy-soup-final-failure-notification': "<table>\n <tr><th colspan=\"3\" style=\"color: white; background-color: darkred;\">Happy Soup Deployment Failed</th></tr>\n <tr><td>Environment</td><td>Branch</td><td>Pipeline</td></tr>\n <tr><td>{{environmentName}}</td><td>{{refName}}</td><td><a\n href=\"{{pipelineUrl}}\"\n >{{pipelineId}}</a></td></tr>\n</table>\n";
|
|
5
7
|
readonly 'happy-soup-final-success-notification': "<table>\n <tr><th colspan=\"3\" style=\"color: white; background-color: darkgreen;\">Happy Soup Deployment\n Completed</th></tr>\n <tr><td>Environment</td><td>Branch</td><td>Pipeline</td></tr>\n <tr><td>{{environmentName}}</td><td>{{refName}}</td><td><a\n href=\"{{pipelineUrl}}\"\n >{{pipelineId}}</a></td></tr>\n{{#if upgradedPackages.length}}\n <tr><td colspan=\"3\">Upgraded Packages</td></tr>\n{{#each upgradedPackages}}\n <tr><td colspan=\"1\">{{packageName}}</td><td colspan=\"2\">{{{storiesLinked}}}</td></tr>\n{{/each}}\n{{/if}}\n</table>\n";
|
|
@@ -15,6 +15,27 @@
|
|
|
15
15
|
*/
|
|
16
16
|
/** Teams notification card templates, keyed the same as the original `.hbs` file names. */
|
|
17
17
|
export const NOTIFY_TEMPLATES = {
|
|
18
|
+
'build-failure-notification': `<table>
|
|
19
|
+
<tr><th colspan="3" style="color: white; background-color: darkred;">{{projectTitle}}: Failed Build</th></tr>
|
|
20
|
+
<tr><th colspan="3" style="color: white; background-color: grey;">Job: {{jobName}} (Stage:
|
|
21
|
+
{{stage}})</th></tr>
|
|
22
|
+
<tr><td>Branch</td><td colspan="2">Pipeline</td></tr>
|
|
23
|
+
<tr><td>{{refName}}</td><td colspan="2"><a
|
|
24
|
+
href="{{pipelineUrl}}"
|
|
25
|
+
>{{pipelineId}}</a></td></tr>
|
|
26
|
+
</table>
|
|
27
|
+
`,
|
|
28
|
+
'build-package-version-notification': `<table>
|
|
29
|
+
<tr><th colspan="3" style="color: white; background-color: darkgreen;">{{projectTitle}}: Package Version
|
|
30
|
+
Created</th></tr>
|
|
31
|
+
<tr><td>Version</td><td>Branch</td><td>Pipeline</td></tr>
|
|
32
|
+
<tr><td>{{packageVersion}}<br />{{subscriberPackageVersionId}}</td><td>{{refName}}</td><td><a
|
|
33
|
+
href="{{pipelineUrl}}"
|
|
34
|
+
>{{pipelineId}}</a></td></tr>
|
|
35
|
+
<tr><td colspan="3">Stories since {{packageVersionPrevious}}</td></tr>
|
|
36
|
+
<tr><td colspan="3">{{{storiesLinked}}}</td></tr>
|
|
37
|
+
</table>
|
|
38
|
+
`,
|
|
18
39
|
'happy-soup-failure-notification': `<table>
|
|
19
40
|
<tr><th colspan="3" style="color: white; background-color: darkred;">Failed Stage:
|
|
20
41
|
{{stage}}</th></tr>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../../src/common/notify/templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,2FAA2F;AAC3F,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,iCAAiC,EAAE;;;;;;;;CAQpC;IACC,uCAAuC,EAAE;;;;;;;CAO1C;IACC,uCAAuC,EAAE;;;;;;;;;;;;;;CAc1C;IACC,wCAAwC,EAAE;;;;;;;;CAQ3C;IACC,iCAAiC,EAAE;;;;;;;;;;;;;;CAcpC;IACC,8BAA8B,EAAE;;;;;;;;;;CAUjC;IACC,8BAA8B,EAAE;;;;;;;;;;CAUjC;CACS,CAAC"}
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../../src/common/notify/templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,2FAA2F;AAC3F,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,4BAA4B,EAAE;;;;;;;;;CAS/B;IACC,oCAAoC,EAAE;;;;;;;;;;CAUvC;IACC,iCAAiC,EAAE;;;;;;;;CAQpC;IACC,uCAAuC,EAAE;;;;;;;CAO1C;IACC,uCAAuC,EAAE;;;;;;;;;;;;;;CAc1C;IACC,wCAAwC,EAAE;;;;;;;;CAQ3C;IACC,iCAAiC,EAAE;;;;;;;;;;;;;;CAcpC;IACC,8BAA8B,EAAE;;;;;;;;;;CAUjC;IACC,8BAA8B,EAAE;;;;;;;;;;CAUjC;CACS,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Send a build job's failure, or the package version it created, to Microsoft Teams, with issue-tracker integration.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Run in every build job's `after_script`. Which card it posts depends on `--ci-job-status`:
|
|
8
|
+
|
|
9
|
+
- `failed`: a failure card with the job, stage, branch, and pipeline, whichever build job failed.
|
|
10
|
+
- `success`: a package version card, but only when the job created a package version. The card shows the new version tag, its `04t` ID, and the issue references in the commits since the previous version tag. Every other successful job sends nothing.
|
|
11
|
+
- Anything else (e.g. `canceled`): nothing.
|
|
12
|
+
|
|
13
|
+
The `04t` ID comes from `--subscriber-package-version-id`, or else from the `subscriberPackageVersionId.env` file that `build create-package-version` writes to the working directory. The new version's tag is the tag at `HEAD` annotated with that ID. The previous version's tag is the nearest earlier tag in the project's version tag format (`plugins.simply.versionTagFormat` or `SIMPLY_CICD_VERSION_TAG_FORMAT`). The command fetches tags, and the full history when the clone is shallow. If a tag or the history can't be found, the card shows `N/A` instead of failing the job.
|
|
14
|
+
|
|
15
|
+
# flags.ci-commit-ref-name.summary
|
|
16
|
+
|
|
17
|
+
The git branch or tag ref for this pipeline run.
|
|
18
|
+
|
|
19
|
+
# flags.ci-job-name.summary
|
|
20
|
+
|
|
21
|
+
The name of the current CI job.
|
|
22
|
+
|
|
23
|
+
# flags.ci-job-stage.summary
|
|
24
|
+
|
|
25
|
+
The stage of the current CI job.
|
|
26
|
+
|
|
27
|
+
# flags.ci-job-status.summary
|
|
28
|
+
|
|
29
|
+
The status of the current CI job (e.g. success, failed, canceled).
|
|
30
|
+
|
|
31
|
+
# flags.ci-pipeline-id.summary
|
|
32
|
+
|
|
33
|
+
The ID of the current CI pipeline.
|
|
34
|
+
|
|
35
|
+
# flags.ci-pipeline-url.summary
|
|
36
|
+
|
|
37
|
+
The URL of the current CI pipeline.
|
|
38
|
+
|
|
39
|
+
# flags.ci-project-title.summary
|
|
40
|
+
|
|
41
|
+
The project title shown in the notification card's heading.
|
|
42
|
+
|
|
43
|
+
# flags.subscriber-package-version-id.summary
|
|
44
|
+
|
|
45
|
+
The subscriber package version ID (04t...) created by this job. Defaults to the one in subscriberPackageVersionId.env, written by build create-package-version.
|
|
46
|
+
|
|
47
|
+
# flags.enabled.summary
|
|
48
|
+
|
|
49
|
+
Whether the notification is actually sent. Defaults to false so pipelines can gate this behind their own condition.
|
|
50
|
+
|
|
51
|
+
# flags.alm-base-url.summary
|
|
52
|
+
|
|
53
|
+
Base URL that an issue reference is appended to, e.g. https://jira.example.com/browse for Jira or https://gitlab.com/group/project/-/issues for GitLab Issues. References are shown without links if not provided.
|
|
54
|
+
|
|
55
|
+
# flags.alm-project-key.summary
|
|
56
|
+
|
|
57
|
+
Fallback project key(s) used to search commit messages for issue references, if none are configured in .sfdevrc.json. Only used by prefix-keyed trackers such as Jira.
|
|
58
|
+
|
|
59
|
+
# flags.alm-provider.summary
|
|
60
|
+
|
|
61
|
+
The issue tracker whose reference format to look for in commit messages.
|
|
62
|
+
|
|
63
|
+
# flags.teams-webhook-url.summary
|
|
64
|
+
|
|
65
|
+
One or more Teams webhook URLs to send the notification to.
|
|
66
|
+
|
|
67
|
+
# flags.debug.summary
|
|
68
|
+
|
|
69
|
+
Enable verbose debug logging.
|
|
70
|
+
|
|
71
|
+
# examples
|
|
72
|
+
|
|
73
|
+
- Post a card from a build job's after_script; it only sends one when the job failed or created a package version:
|
|
74
|
+
|
|
75
|
+
<%= config.bin %> <%= command.id %> --ci-job-name push-scratch --ci-job-status "$CI_JOB_STATUS" --teams-webhook-url https://outlook.office.com/webhook/... --enabled
|
|
76
|
+
|
|
77
|
+
- Announce a package version with linked Jira stories:
|
|
78
|
+
|
|
79
|
+
<%= config.bin %> <%= command.id %> --ci-job-status success --alm-base-url https://jira.example.com/browse --teams-webhook-url https://outlook.office.com/webhook/... --enabled
|
|
80
|
+
|
|
81
|
+
# error.missingTeamsWebhookUrl
|
|
82
|
+
|
|
83
|
+
--teams-webhook-url must be specified.
|
|
@@ -4,7 +4,7 @@ Send a serialized JSON payload to a Microsoft Teams webhook.
|
|
|
4
4
|
|
|
5
5
|
# description
|
|
6
6
|
|
|
7
|
-
Posts a payload as-is to one or more Microsoft Teams incoming webhook URLs. Use this for custom notifications that don't fit the built-in `notify project
|
|
7
|
+
Posts a payload as-is to one or more Microsoft Teams incoming webhook URLs. Use this for custom notifications that don't fit the built-in `notify project`, `notify happy-soup`, or `notify build` card templates.
|
|
8
8
|
|
|
9
9
|
# flags.payload.summary
|
|
10
10
|
|
package/oclif.manifest.json
CHANGED
|
@@ -277,6 +277,191 @@
|
|
|
277
277
|
"validate:deploy:cicd:simply"
|
|
278
278
|
]
|
|
279
279
|
},
|
|
280
|
+
"simply:cicd:notify:build": {
|
|
281
|
+
"aliases": [],
|
|
282
|
+
"args": {},
|
|
283
|
+
"description": "Run in every build job's `after_script`. Which card it posts depends on `--ci-job-status`:\n\n- `failed`: a failure card with the job, stage, branch, and pipeline, whichever build job failed.\n- `success`: a package version card, but only when the job created a package version. The card shows the new version tag, its `04t` ID, and the issue references in the commits since the previous version tag. Every other successful job sends nothing.\n- Anything else (e.g. `canceled`): nothing.\n\nThe `04t` ID comes from `--subscriber-package-version-id`, or else from the `subscriberPackageVersionId.env` file that `build create-package-version` writes to the working directory. The new version's tag is the tag at `HEAD` annotated with that ID. The previous version's tag is the nearest earlier tag in the project's version tag format (`plugins.simply.versionTagFormat` or `SIMPLY_CICD_VERSION_TAG_FORMAT`). The command fetches tags, and the full history when the clone is shallow. If a tag or the history can't be found, the card shows `N/A` instead of failing the job.",
|
|
284
|
+
"examples": [
|
|
285
|
+
"Post a card from a build job's after_script; it only sends one when the job failed or created a package version:\n<%= config.bin %> <%= command.id %> --ci-job-name push-scratch --ci-job-status \"$CI_JOB_STATUS\" --teams-webhook-url https://outlook.office.com/webhook/... --enabled",
|
|
286
|
+
"Announce a package version with linked Jira stories:\n<%= config.bin %> <%= command.id %> --ci-job-status success --alm-base-url https://jira.example.com/browse --teams-webhook-url https://outlook.office.com/webhook/... --enabled"
|
|
287
|
+
],
|
|
288
|
+
"flags": {
|
|
289
|
+
"json": {
|
|
290
|
+
"description": "Format output as json.",
|
|
291
|
+
"helpGroup": "GLOBAL",
|
|
292
|
+
"name": "json",
|
|
293
|
+
"allowNo": false,
|
|
294
|
+
"type": "boolean"
|
|
295
|
+
},
|
|
296
|
+
"flags-dir": {
|
|
297
|
+
"helpGroup": "GLOBAL",
|
|
298
|
+
"name": "flags-dir",
|
|
299
|
+
"summary": "Import flag values from a directory.",
|
|
300
|
+
"hasDynamicHelp": false,
|
|
301
|
+
"multiple": false,
|
|
302
|
+
"type": "option"
|
|
303
|
+
},
|
|
304
|
+
"ci-commit-ref-name": {
|
|
305
|
+
"env": "SIMPLY_CICD_CI_COMMIT_REF_NAME",
|
|
306
|
+
"name": "ci-commit-ref-name",
|
|
307
|
+
"summary": "The git branch or tag ref for this pipeline run.",
|
|
308
|
+
"hasDynamicHelp": false,
|
|
309
|
+
"multiple": false,
|
|
310
|
+
"type": "option"
|
|
311
|
+
},
|
|
312
|
+
"ci-job-name": {
|
|
313
|
+
"env": "SIMPLY_CICD_CI_JOB_NAME",
|
|
314
|
+
"name": "ci-job-name",
|
|
315
|
+
"summary": "The name of the current CI job.",
|
|
316
|
+
"hasDynamicHelp": false,
|
|
317
|
+
"multiple": false,
|
|
318
|
+
"type": "option"
|
|
319
|
+
},
|
|
320
|
+
"ci-job-stage": {
|
|
321
|
+
"env": "SIMPLY_CICD_CI_JOB_STAGE",
|
|
322
|
+
"name": "ci-job-stage",
|
|
323
|
+
"summary": "The stage of the current CI job.",
|
|
324
|
+
"hasDynamicHelp": false,
|
|
325
|
+
"multiple": false,
|
|
326
|
+
"type": "option"
|
|
327
|
+
},
|
|
328
|
+
"ci-job-status": {
|
|
329
|
+
"env": "SIMPLY_CICD_CI_JOB_STATUS",
|
|
330
|
+
"name": "ci-job-status",
|
|
331
|
+
"summary": "The status of the current CI job (e.g. success, failed, canceled).",
|
|
332
|
+
"hasDynamicHelp": false,
|
|
333
|
+
"multiple": false,
|
|
334
|
+
"type": "option"
|
|
335
|
+
},
|
|
336
|
+
"ci-pipeline-id": {
|
|
337
|
+
"env": "SIMPLY_CICD_CI_PIPELINE_ID",
|
|
338
|
+
"name": "ci-pipeline-id",
|
|
339
|
+
"summary": "The ID of the current CI pipeline.",
|
|
340
|
+
"hasDynamicHelp": false,
|
|
341
|
+
"multiple": false,
|
|
342
|
+
"type": "option"
|
|
343
|
+
},
|
|
344
|
+
"ci-pipeline-url": {
|
|
345
|
+
"env": "SIMPLY_CICD_CI_PIPELINE_URL",
|
|
346
|
+
"name": "ci-pipeline-url",
|
|
347
|
+
"summary": "The URL of the current CI pipeline.",
|
|
348
|
+
"hasDynamicHelp": false,
|
|
349
|
+
"multiple": false,
|
|
350
|
+
"type": "option"
|
|
351
|
+
},
|
|
352
|
+
"ci-project-title": {
|
|
353
|
+
"env": "SIMPLY_CICD_CI_PROJECT_TITLE",
|
|
354
|
+
"name": "ci-project-title",
|
|
355
|
+
"summary": "The project title shown in the notification card's heading.",
|
|
356
|
+
"hasDynamicHelp": false,
|
|
357
|
+
"multiple": false,
|
|
358
|
+
"type": "option"
|
|
359
|
+
},
|
|
360
|
+
"subscriber-package-version-id": {
|
|
361
|
+
"env": "SIMPLY_CICD_SUBSCRIBER_PACKAGE_VERSION_ID",
|
|
362
|
+
"name": "subscriber-package-version-id",
|
|
363
|
+
"summary": "The subscriber package version ID (04t...) created by this job. Defaults to the one in subscriberPackageVersionId.env, written by build create-package-version.",
|
|
364
|
+
"hasDynamicHelp": false,
|
|
365
|
+
"multiple": false,
|
|
366
|
+
"type": "option"
|
|
367
|
+
},
|
|
368
|
+
"enabled": {
|
|
369
|
+
"env": "SIMPLY_CICD_ENABLED",
|
|
370
|
+
"name": "enabled",
|
|
371
|
+
"summary": "Whether the notification is actually sent. Defaults to false so pipelines can gate this behind their own condition.",
|
|
372
|
+
"allowNo": false,
|
|
373
|
+
"type": "boolean"
|
|
374
|
+
},
|
|
375
|
+
"alm-base-url": {
|
|
376
|
+
"env": "SIMPLY_CICD_ALM_BASE_URL",
|
|
377
|
+
"name": "alm-base-url",
|
|
378
|
+
"summary": "Base URL that an issue reference is appended to, e.g. https://jira.example.com/browse for Jira or https://gitlab.com/group/project/-/issues for GitLab Issues. References are shown without links if not provided.",
|
|
379
|
+
"hasDynamicHelp": false,
|
|
380
|
+
"multiple": false,
|
|
381
|
+
"type": "option"
|
|
382
|
+
},
|
|
383
|
+
"alm-project-key": {
|
|
384
|
+
"env": "SIMPLY_CICD_ALM_PROJECT_KEY",
|
|
385
|
+
"name": "alm-project-key",
|
|
386
|
+
"summary": "Fallback project key(s) used to search commit messages for issue references, if none are configured in .sfdevrc.json. Only used by prefix-keyed trackers such as Jira.",
|
|
387
|
+
"hasDynamicHelp": false,
|
|
388
|
+
"multiple": false,
|
|
389
|
+
"type": "option"
|
|
390
|
+
},
|
|
391
|
+
"alm-provider": {
|
|
392
|
+
"env": "SIMPLY_CICD_ALM_PROVIDER",
|
|
393
|
+
"name": "alm-provider",
|
|
394
|
+
"summary": "The issue tracker whose reference format to look for in commit messages.",
|
|
395
|
+
"default": "jira",
|
|
396
|
+
"hasDynamicHelp": false,
|
|
397
|
+
"multiple": false,
|
|
398
|
+
"options": [
|
|
399
|
+
"gitlab-issues",
|
|
400
|
+
"jira"
|
|
401
|
+
],
|
|
402
|
+
"type": "option"
|
|
403
|
+
},
|
|
404
|
+
"teams-webhook-url": {
|
|
405
|
+
"name": "teams-webhook-url",
|
|
406
|
+
"summary": "One or more Teams webhook URLs to send the notification to.",
|
|
407
|
+
"hasDynamicHelp": false,
|
|
408
|
+
"multiple": true,
|
|
409
|
+
"type": "option"
|
|
410
|
+
},
|
|
411
|
+
"debug": {
|
|
412
|
+
"env": "SIMPLY_CICD_DEBUG",
|
|
413
|
+
"name": "debug",
|
|
414
|
+
"summary": "Enable verbose debug logging.",
|
|
415
|
+
"allowNo": false,
|
|
416
|
+
"type": "boolean"
|
|
417
|
+
}
|
|
418
|
+
},
|
|
419
|
+
"hasDynamicHelp": false,
|
|
420
|
+
"hiddenAliases": [],
|
|
421
|
+
"id": "simply:cicd:notify:build",
|
|
422
|
+
"pluginAlias": "@simplysf/simply-cicd",
|
|
423
|
+
"pluginName": "@simplysf/simply-cicd",
|
|
424
|
+
"pluginType": "core",
|
|
425
|
+
"strict": true,
|
|
426
|
+
"summary": "Send a build job's failure, or the package version it created, to Microsoft Teams, with issue-tracker integration.",
|
|
427
|
+
"enableJsonFlag": true,
|
|
428
|
+
"isESM": true,
|
|
429
|
+
"relativePath": [
|
|
430
|
+
"lib",
|
|
431
|
+
"commands",
|
|
432
|
+
"simply",
|
|
433
|
+
"cicd",
|
|
434
|
+
"notify",
|
|
435
|
+
"build.js"
|
|
436
|
+
],
|
|
437
|
+
"aliasPermutations": [],
|
|
438
|
+
"permutations": [
|
|
439
|
+
"simply:cicd:notify:build",
|
|
440
|
+
"cicd:simply:notify:build",
|
|
441
|
+
"cicd:notify:simply:build",
|
|
442
|
+
"cicd:notify:build:simply",
|
|
443
|
+
"simply:notify:cicd:build",
|
|
444
|
+
"notify:simply:cicd:build",
|
|
445
|
+
"notify:cicd:simply:build",
|
|
446
|
+
"notify:cicd:build:simply",
|
|
447
|
+
"simply:notify:build:cicd",
|
|
448
|
+
"notify:simply:build:cicd",
|
|
449
|
+
"notify:build:simply:cicd",
|
|
450
|
+
"notify:build:cicd:simply",
|
|
451
|
+
"simply:cicd:build:notify",
|
|
452
|
+
"cicd:simply:build:notify",
|
|
453
|
+
"cicd:build:simply:notify",
|
|
454
|
+
"cicd:build:notify:simply",
|
|
455
|
+
"simply:build:cicd:notify",
|
|
456
|
+
"build:simply:cicd:notify",
|
|
457
|
+
"build:cicd:simply:notify",
|
|
458
|
+
"build:cicd:notify:simply",
|
|
459
|
+
"simply:build:notify:cicd",
|
|
460
|
+
"build:simply:notify:cicd",
|
|
461
|
+
"build:notify:simply:cicd",
|
|
462
|
+
"build:notify:cicd:simply"
|
|
463
|
+
]
|
|
464
|
+
},
|
|
280
465
|
"simply:cicd:notify:happy-soup": {
|
|
281
466
|
"aliases": [],
|
|
282
467
|
"args": {},
|
|
@@ -740,7 +925,7 @@
|
|
|
740
925
|
"simply:cicd:notify:teams": {
|
|
741
926
|
"aliases": [],
|
|
742
927
|
"args": {},
|
|
743
|
-
"description": "Posts a payload as-is to one or more Microsoft Teams incoming webhook URLs. Use this for custom notifications that don't fit the built-in `notify project
|
|
928
|
+
"description": "Posts a payload as-is to one or more Microsoft Teams incoming webhook URLs. Use this for custom notifications that don't fit the built-in `notify project`, `notify happy-soup`, or `notify build` card templates.",
|
|
744
929
|
"examples": [
|
|
745
930
|
"<%= config.bin %> <%= command.id %> --payload '{\"text\":\"Deployment complete\"}' --webhook-url https://outlook.office.com/webhook/... --enabled"
|
|
746
931
|
],
|
|
@@ -6519,5 +6704,5 @@
|
|
|
6519
6704
|
]
|
|
6520
6705
|
}
|
|
6521
6706
|
},
|
|
6522
|
-
"version": "0.
|
|
6707
|
+
"version": "0.16.0"
|
|
6523
6708
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simplysf/simply-cicd",
|
|
3
3
|
"description": "Commands for Salesforce CI/CD pipelines",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.16.0",
|
|
5
5
|
"author": "@ClayChipps",
|
|
6
6
|
"homepage": "https://github.com/SimplySF/simply-plugins",
|
|
7
7
|
"bugs": "https://github.com/SimplySF/simply-plugins/issues",
|
|
@@ -206,5 +206,5 @@
|
|
|
206
206
|
"output": []
|
|
207
207
|
}
|
|
208
208
|
},
|
|
209
|
-
"gitHead": "
|
|
209
|
+
"gitHead": "f671b533ba8a90312444038abc15e52be1a4482e"
|
|
210
210
|
}
|