From 25db638f3769c0e0887cd1ae992299baf330653b Mon Sep 17 00:00:00 2001 From: Azlam <43767972+azlam-abdulsalam@users.noreply.github.com> Date: Wed, 19 May 2021 17:12:36 +1000 Subject: [PATCH] Demo Mode for sfpowerscripts (#520) * Mock release command * Refactor dinto a demo player class * Allow DemoReelPlayer errors to break execution Remove try/catch block * Revert changes to ChangelogImpl * Resolve path Co-authored-by: Alan Ly --- demoreel/quickbuild/buildprocess1 | 3 + demoreel/quickbuild/buildprocess2 | 10 + demoreel/quickbuild/buildprocess3 | 4 + demoreel/quickbuild/buildprocess4 | 10 + demoreel/quickbuild/buildprocesscomplete | 10 + demoreel/quickbuild/commandBanner | 17 ++ demoreel/quickbuild/demo.json | 32 ++ demoreel/quickbuild/packageschedule.md | 6 + demoreel/release/baseCodeBanner | 6 + demoreel/release/baseStylesBanner | 6 + demoreel/release/changelog.md | 37 +++ demoreel/release/commandBanner | 19 ++ demoreel/release/demo.json | 70 +++++ demoreel/release/deploymentPlan.md | 16 + demoreel/release/fetchArtifacts.md | 8 + demoreel/release/footer | 13 + demoreel/release/generatingChangelog.md | 1 + demoreel/release/inprogress | 1 + demoreel/release/installBaseCode.md | 29 ++ demoreel/release/installBaseStyles.md | 18 ++ demoreel/release/mcBanner | 4 + demoreel/release/release.md | 282 ++++++++++++++++++ demoreel/release/successBaseCode | 3 + demoreel/release/successBaseStyles | 3 + demoreel/release/successMC | 1 + packages/core/src/utils/Delay.ts | 3 +- .../src/SfpowerscriptsCommand.ts | 24 ++ .../src/utils/demoReelPlayer.ts | 62 ++++ 28 files changed, 696 insertions(+), 2 deletions(-) create mode 100644 demoreel/quickbuild/buildprocess1 create mode 100644 demoreel/quickbuild/buildprocess2 create mode 100644 demoreel/quickbuild/buildprocess3 create mode 100644 demoreel/quickbuild/buildprocess4 create mode 100644 demoreel/quickbuild/buildprocesscomplete create mode 100644 demoreel/quickbuild/commandBanner create mode 100644 demoreel/quickbuild/demo.json create mode 100644 demoreel/quickbuild/packageschedule.md create mode 100644 demoreel/release/baseCodeBanner create mode 100644 demoreel/release/baseStylesBanner create mode 100644 demoreel/release/changelog.md create mode 100644 demoreel/release/commandBanner create mode 100644 demoreel/release/demo.json create mode 100644 demoreel/release/deploymentPlan.md create mode 100644 demoreel/release/fetchArtifacts.md create mode 100644 demoreel/release/footer create mode 100644 demoreel/release/generatingChangelog.md create mode 100644 demoreel/release/inprogress create mode 100644 demoreel/release/installBaseCode.md create mode 100644 demoreel/release/installBaseStyles.md create mode 100644 demoreel/release/mcBanner create mode 100644 demoreel/release/release.md create mode 100644 demoreel/release/successBaseCode create mode 100644 demoreel/release/successBaseStyles create mode 100644 demoreel/release/successMC create mode 100644 packages/sfpowerscripts-cli/src/utils/demoReelPlayer.ts diff --git a/demoreel/quickbuild/buildprocess1 b/demoreel/quickbuild/buildprocess1 new file mode 100644 index 000000000..44e41d3a1 --- /dev/null +++ b/demoreel/quickbuild/buildprocess1 @@ -0,0 +1,3 @@ +Packages currently processed:{1} ESObjects +Awaiting Dependencies to be resolved:{1} ESSpaceMgmtLWC +Package creation initiated for ESObjects \ No newline at end of file diff --git a/demoreel/quickbuild/buildprocess2 b/demoreel/quickbuild/buildprocess2 new file mode 100644 index 000000000..3d75bca25 --- /dev/null +++ b/demoreel/quickbuild/buildprocess2 @@ -0,0 +1,10 @@ + +ESObjects package created in 00:00:39 +-- Package Details:-- +-- Package Version Number: 50.1.5.6 +-- Package Version Id: 04t2s000000cC2QAAU +-- Package Test Coverage: 0 +-- Package Coverage Check Passed: false +-- Apex In Package: No +-- Profiles In Package: No +-- Metadata Count: 45 \ No newline at end of file diff --git a/demoreel/quickbuild/buildprocess3 b/demoreel/quickbuild/buildprocess3 new file mode 100644 index 000000000..b8258741e --- /dev/null +++ b/demoreel/quickbuild/buildprocess3 @@ -0,0 +1,4 @@ + +Packages currently processed:{1} ESSpaceMgmtLWC +Awaiting Dependencies to be resolved:{0} +Package creation initiated for ESSpaceMgmtLWC \ No newline at end of file diff --git a/demoreel/quickbuild/buildprocess4 b/demoreel/quickbuild/buildprocess4 new file mode 100644 index 000000000..1a918126d --- /dev/null +++ b/demoreel/quickbuild/buildprocess4 @@ -0,0 +1,10 @@ + +ESSpaceMgmtLWC package created in 00:00:28 +-- Package Details:-- +-- Package Version Number: 50.0.4.23 +-- Package Version Id: 04t2s000000cC2pAAE +-- Package Test Coverage: 0 +-- Package Coverage Check Passed: false +-- Apex In Package: Yes +-- Profiles In Package: No +-- Metadata Count: 32 \ No newline at end of file diff --git a/demoreel/quickbuild/buildprocesscomplete b/demoreel/quickbuild/buildprocesscomplete new file mode 100644 index 000000000..6d57eac89 --- /dev/null +++ b/demoreel/quickbuild/buildprocesscomplete @@ -0,0 +1,10 @@ + +Packages currently processed:{0} +Awaiting Dependencies to be resolved:{0} + + + +Generating Artifacts and Tags.... +---------------------------------------------------------------------------------------------------- +2 packages created in 00:01:05 minutes with {0} errors +---------------------------------------------------------------------------------------------------- diff --git a/demoreel/quickbuild/commandBanner b/demoreel/quickbuild/commandBanner new file mode 100644 index 000000000..bf2e1ac07 --- /dev/null +++ b/demoreel/quickbuild/commandBanner @@ -0,0 +1,17 @@ + ██████████ █████ █████ █████████ █████████ ████ +░░███░░░░███ ░░███ ░░███ ███░░░░░░ ███░░░░░███ ░░███ + ░███ ░░███ ░░███ ███ ░███ ██████ ░███ ░░░ ██████ ██████ ░███ ██████ + ░███ ░███ ░░█████ ░███░███░███░░█████████ ███░░███ ░░░░░███ ░███ ███░░███ + ░███ ░███ ███░███ ░███░███░███ ░░░░░░░░███░███ ░░░ ███████ ░███ ░███████ + ░███ ███ ███ ░░███ ░███░░░ ░███ ███ ░███░███ ███ ███░░███ ░███ ░███░░░ + ██████████ █████ █████░░█████████ ░░█████████ ░░██████ ░░████████ █████░░██████ +░░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░░░░░ ░░░░░░░░░ ░░░░░░ ░░░░░░░░ ░░░░░ ░░░░░░ + + + +-----------sfpowerscripts orchestrator ------------------ +command: quickbuild +Build Packages Only Changed: true +Config File Path: config/project-scratch-def.json +Artifact Directory: artifacts +--------------------------------------------------------- \ No newline at end of file diff --git a/demoreel/quickbuild/demo.json b/demoreel/quickbuild/demo.json new file mode 100644 index 000000000..10817dbb2 --- /dev/null +++ b/demoreel/quickbuild/demo.json @@ -0,0 +1,32 @@ +{ + "sequence": [ + { + "filepath": "commandBanner", + "postDelay": 3000 + }, + { + "filepath": "packageschedule.md", + "postDelay": 10000 + }, + { + "filepath": "buildprocess1", + "postDelay": 20000 + }, + { + "filepath": "buildprocess2", + "postDelay": 10000 + }, + { + "filepath": "buildprocess3", + "postDelay": 20000 + }, + { + "filepath": "buildprocess4", + "postDelay": 10000 + }, + { + "filepath": "buildprocesscomplete", + "postDelay": 10000 + } + ] +} diff --git a/demoreel/quickbuild/packageschedule.md b/demoreel/quickbuild/packageschedule.md new file mode 100644 index 000000000..32c19de65 --- /dev/null +++ b/demoreel/quickbuild/packageschedule.md @@ -0,0 +1,6 @@ +# Packages scheduled for build + +| Package | Reason to be built | Last Known Tag | +|-------------------------|-----------------------------------|------------------------------| +| ESObjects | Change in Code/Config | ESObjects_v50.0.5.4 | +| ESSpaceMgmtLWC | Change in Code/Config | EESSpaceMgmtLWC_50.0.5.17 | diff --git a/demoreel/release/baseCodeBanner b/demoreel/release/baseCodeBanner new file mode 100644 index 000000000..01e6a4694 --- /dev/null +++ b/demoreel/release/baseCodeBanner @@ -0,0 +1,6 @@ +-------------------------Installing Package------------------------------------ +Name: ESBaseCodeLWC +Type: unlocked +Version Number: 50.0.6.16 +Metadata Count: 23 +------------------------------------------------------------------------------- diff --git a/demoreel/release/baseStylesBanner b/demoreel/release/baseStylesBanner new file mode 100644 index 000000000..667bcafe4 --- /dev/null +++ b/demoreel/release/baseStylesBanner @@ -0,0 +1,6 @@ +-------------------------Installing Package------------------------------------ +Name: ESBaseStylesLWC +Type: unlocked +Version Number: 50.0.6.16 +Metadata Count: 12 +------------------------------------------------------------------------------- diff --git a/demoreel/release/changelog.md b/demoreel/release/changelog.md new file mode 100644 index 000000000..ee2d979b3 --- /dev/null +++ b/demoreel/release/changelog.md @@ -0,0 +1,37 @@ +Updating sit org with release-1.0-1(0)... + +[![sit-Release-1.0-1(0)-green](https://img.shields.io/static/v1?label=sit&message=Release-1.0-1(0)&color=green)](#7df66f58e93be435fcb22019c2efe0827f2862ad) + +# Release-1.0-1 +### Artifacts :package: +- **ESBaseCodeLWC** v50.0.6.16 (2bc11f53) + +- **ESBaseStylesLWC** v50.0.6.16 (2bc11f53) + +### Work Items :gem: +- SAM-6 +- SAM-158 +- SAM-162 +- SAM-178 + +### Commits :book: + +#### ESBaseCodeLWC +| Date | Time | Commit ID | Commit Message | +| ---------- | -------- | --------- | ---------------------------------------------------------------------------- | +| 25/01/2021 | 11:01:55 | c8dbab13 | Add persist credential to PR (#6) | +| 19/10/2020 | 17:30:31 | d7124579 | feat: winter '21 release updates (#178) | +| 28/09/2020 | 17:52:59 | e4fd5b2c | Setup sa11y and implement accessibility tests (#162) | +| 05/09/2020 | 02:10:49 | 9ca5cf96 | feat:object agnostic design for apex code for Customer List component (#158) | + + + +#### ESBaseStylesLWC +| Date | Time | Commit ID | Commit Message | +| ---------- | -------- | --------- | ------------------------------------------------------------------- | +| 19/10/2020 | 17:30:31 | d7124579 | feat: winter '21 release updates (#178) | + + + +Pushing changelog files to sfp_changelog_develop +Successfully generated changelog \ No newline at end of file diff --git a/demoreel/release/commandBanner b/demoreel/release/commandBanner new file mode 100644 index 000000000..d546ac6c6 --- /dev/null +++ b/demoreel/release/commandBanner @@ -0,0 +1,19 @@ + ██████████ █████ █████ █████████ █████████ ████ +░░███░░░░███ ░░███ ░░███ ███░░░░░░ ███░░░░░███ ░░███ + ░███ ░░███ ░░███ ███ ░███ ██████ ░███ ░░░ ██████ ██████ ░███ ██████ + ░███ ░███ ░░█████ ░███░███░███░░█████████ ███░░███ ░░░░░███ ░███ ███░░███ + ░███ ░███ ███░███ ░███░███░███ ░░░░░░░░███░███ ░░░ ███████ ░███ ░███████ + ░███ ███ ███ ░░███ ░███░░░ ░███ ███ ░███░███ ███ ███░░███ ░███ ░███░░░ + ██████████ █████ █████░░█████████ ░░█████████ ░░██████ ░░████████ █████░░██████ +░░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░░░░░ ░░░░░░░░░ ░░░░░░ ░░░░░░░░ ░░░░░ ░░░░░░ + + + +-----------sfpowerscripts orchestrator ------------------ +command: release +Target Org: SIT +Release Definition: releasedef.yml +Artifact Directory: /Users/root/Workspaces/devops/easy-spaces-lwc/artifacts +Skip Packages If Already Installed: false +Dry-run: false +--------------------------------------------------------- diff --git a/demoreel/release/demo.json b/demoreel/release/demo.json new file mode 100644 index 000000000..9831aa7b4 --- /dev/null +++ b/demoreel/release/demo.json @@ -0,0 +1,70 @@ +{ + "sequence": [ + { + "filepath": "commandBanner", + "postDelay": 3000 + }, + { + "filepath": "fetchArtifacts.md", + "postDelay": 20000 + }, + { + "filepath": "deploymentPlan.md", + "postDelay": 2000 + }, + { + "filepath": "generatingChangelog.md" + }, + { + "preDelay": 20000, + "filepath": "changelog.md" + }, + { + "filepath": "mcBanner", + "postDelay": 2000 + }, + { + "filepath": "inprogress", + "repeat": 10, + "preDelay": 3000 + }, + { + "filepath": "successMC" + }, + { + "filepath": "baseStylesBanner", + "postDelay": 2000 + }, + { + "filepath": "installBaseStyles.md", + "postDelay": 2000 + }, + { + "filepath": "inprogress", + "repeat": 5, + "preDelay": 3000 + }, + { + "filepath": "successBaseStyles" + }, + { + "filepath": "baseCodeBanner", + "postDelay": 2000 + }, + { + "filepath": "installBaseCode.md", + "postDelay": 2000 + }, + { + "filepath": "inprogress", + "repeat": 8, + "postDelay": 3000 + }, + { + "filepath": "successBaseCode" + }, + { + "filepath": "footer" + } + ] +} diff --git a/demoreel/release/deploymentPlan.md b/demoreel/release/deploymentPlan.md new file mode 100644 index 000000000..9dca02a0b --- /dev/null +++ b/demoreel/release/deploymentPlan.md @@ -0,0 +1,16 @@ +# Deployment Plan + +| Package | Incoming Version | Version in org | To be installed? | +|-------------------------|------------------|----------------|------------------| +| ESObjects | 50.0.6.16 | 50.0.6.16 | No | +| ESBaseStylesLWC | 50.0.6.16 | 50.0.6.16 | No | +| ESBaseCodeLWC | 50.0.6.16 | 50.0.5.1 | Yes | +| ESSpaceMgmtLWC | 50.0.5.17 | 50.0.5.16 | Yes | + + +Dependencies + +| Package | Incoming Version | Version in org | To be installed? | Parent | +|-----------------|------------------|----------------|------------------|---------------| +| Marketing Cloud | 231.0.0.1 | 230.0.0.0 | Yes | ESBaseCodeLWC | +| Salesforce CPQ | 230.6.0.1 | 230.6.0.1 | No | ESBaseCodeLWC | \ No newline at end of file diff --git a/demoreel/release/fetchArtifacts.md b/demoreel/release/fetchArtifacts.md new file mode 100644 index 000000000..c2146f082 --- /dev/null +++ b/demoreel/release/fetchArtifacts.md @@ -0,0 +1,8 @@ +Fetching Artifacts... + +| Artifacts | Version | +|-----------------|-----------| +| esbasestyleslwc | 50.0.6.16 | +| esspacemgmtlwc | 50.0.5.17 | +| esbasecodelwc | 50.0.6.16 | +| esobjects | 50.0.6.16 | \ No newline at end of file diff --git a/demoreel/release/footer b/demoreel/release/footer new file mode 100644 index 000000000..687fa65b1 --- /dev/null +++ b/demoreel/release/footer @@ -0,0 +1,13 @@ +---------------------------------------------------------------------------------------------------- + +Package Dependencies + 1 succeeded + 1 skipped + 0 failed + +Deployment + 2 succeeded + 0 failed + +Elapsed Time: 00:05:09 +---------------------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/demoreel/release/generatingChangelog.md b/demoreel/release/generatingChangelog.md new file mode 100644 index 000000000..3c3ba0ee6 --- /dev/null +++ b/demoreel/release/generatingChangelog.md @@ -0,0 +1 @@ +# Generating changelog... diff --git a/demoreel/release/inprogress b/demoreel/release/inprogress new file mode 100644 index 000000000..403edaba1 --- /dev/null +++ b/demoreel/release/inprogress @@ -0,0 +1 @@ +Waiting for the package install request to complete. Status = IN_PROGRESS diff --git a/demoreel/release/installBaseCode.md b/demoreel/release/installBaseCode.md new file mode 100644 index 000000000..940150c04 --- /dev/null +++ b/demoreel/release/installBaseCode.md @@ -0,0 +1,29 @@ +The following metadata will be deployed: + +| Metadata Type | API Name | +|--------------------------|-----------------------------------------------------------| +| AuraDefinitionBundle | openRecordAction | +| AuraDefinitionBundle | selectObject | +| ApexClass | CustomerServices | +| ApexClass | CustomerServicesTest | +| ApexClass | MarketServices | +| ApexClass | MarketServicesTest | +| ApexClass | TestDataFactory | +| CustomMetadata | Customer_Fields.Contact_Customer_Fields | +| CustomMetadata | Customer_Fields.Lead_Customer_Fields | +| Layout | Customer_Fields__mdt-Customer Fields Layout | +| LightningComponentBundle | errorPanel | +| LightningComponentBundle | ldsUtils | +| LightningMessageChannel | Flow_Status_Change | +| LightningMessageChannel | Tile_Selection | +| CustomObject | Customer_Fields__mdt | +| CustomField | Customer_Fields__mdt.Customer_City__c | +| CustomField | Customer_Fields__mdt.Customer_Draft_Status_Values__c | +| CustomField | Customer_Fields__mdt.Customer_Email__c | +| CustomField | Customer_Fields__mdt.Customer_Name__c | +| CustomField | Customer_Fields__mdt.Customer_Reservation_Status_Value__c | +| CustomField | Customer_Fields__mdt.Customer_State__c | +| CustomField | Customer_Fields__mdt.Customer_Status__c | +| CustomField | Customer_Fields__mdt.Sobject_Type__c | + +Generated Command sfdx force:package:install --package 04t2s000000cC1cAAE -u SIT --noprompt --publishwait=10 --wait=120 --securitytype=AdminsOnly --upgradetype=Mixed --apexcompile=package \ No newline at end of file diff --git a/demoreel/release/installBaseStyles.md b/demoreel/release/installBaseStyles.md new file mode 100644 index 000000000..8893344b3 --- /dev/null +++ b/demoreel/release/installBaseStyles.md @@ -0,0 +1,18 @@ +The following metadata will be deployed: + +| Metadata Type | API Name | +|--------------------------|------------------------| +| AuraDefinitionBundle | AppPage_3_9 | +| AuraDefinitionBundle | AppPage_4_8 | +| BrandingSet | LEXTHEMINGEasy_Spaces | +| ContentAsset | EasySpacesTile01 | +| ContentAsset | EasySpaces_Logo1 | +| ContentAsset | EasySpaces_Page_Dark1 | +| ContentAsset | easy_spaces_tile_small | +| LightningExperienceTheme | Easy_Spaces | +| LightningComponentBundle | imageGallery | +| LightningComponentBundle | imageTile | +| LightningComponentBundle | pill | +| LightningComponentBundle | pillList | + +Generated Command sfdx force:package:install --package 04t2s000000cC1NAAU -u SIT --noprompt --publishwait=10 --wait=120 --securitytype=AdminsOnly --upgradetype=Mixed --apexcompile=package \ No newline at end of file diff --git a/demoreel/release/mcBanner b/demoreel/release/mcBanner new file mode 100644 index 000000000..3d880b96c --- /dev/null +++ b/demoreel/release/mcBanner @@ -0,0 +1,4 @@ +-------------------------Installing Dependency------------------------------------ +Name: Marketing Cloud +Version Number: 231.0.0.1 +------------------------------------------------------------------------------- diff --git a/demoreel/release/release.md b/demoreel/release/release.md new file mode 100644 index 000000000..cc301795d --- /dev/null +++ b/demoreel/release/release.md @@ -0,0 +1,282 @@ +-----------sfpowerscripts orchestrator ------------------ +command: release +Target Org: SIT +Release Definition: releasedef.yml +Artifact Directory: /Users/alan.ly/Workspaces/devops/easy-spaces-lwc/artifacts +Skip Packages If Already Installed: false +Dry-run: false +--------------------------------------------------------- +Fetching artifact for esbasestyleslwc version develop_github +Fetching artifact for esspacemgmtlwc version develop_github +Fetching artifact for esbasecodelwc version develop_github +Fetching artifact for esobjects version develop_github +Checking Whether Package with ID 04t1P000000ka0fQAA is installed in SIT +Package dependency sfpowerscripts-artifact: 04t1P000000ka0fQAA is already installed in target org +Checking Whether Package with ID 04t0H000000xVrwQAE is installed in SIT +Installing package dependency Marketing Cloud: 04t0H000000xVrwQAE + +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGERESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Waiting for the package install request to complete. Status = IN_PROGRESS +Successfully installed package [04t0H000000xVrwQAE] +Querying Org Details +{ + attributes: { + type: 'Organization', + url: '/services/data/v51.0/sobjects/Organization/00D1y0000000agAEAQ' + }, + Id: '00D1y0000000agAEAQ', + InstanceName: 'CS114', + IsSandbox: true, + Name: 'Easy Spaces', + OrganizationType: 'Developer Edition' +} + +Found latest package manifest in ESSpaceMgmtLWC artifact +┌─────────────────┬─────────────────────────┐ +│ Package │ Version to be installed │ +├─────────────────┼─────────────────────────┤ +│ ESObjects │ 50.0.6.16 │ +├─────────────────┼─────────────────────────┤ +│ ESBaseStylesLWC │ 50.0.6.16 │ +├─────────────────┼─────────────────────────┤ +│ ESBaseCodeLWC │ 50.0.6.16 │ +├─────────────────┼─────────────────────────┤ +│ ESSpaceMgmtLWC │ 50.0.5.17 │ +└─────────────────┴─────────────────────────┘ + +-------------------------Installing Package------------------------------------ +Name: ESBaseStylesLWC +Type: unlocked +Version Number: 50.0.6.16 +Metadata Count: 12 +------------------------------------------------------------------------------- + +The following metadata will be deployed: +┌──────────────────────────┬────────────────────────┐ +│ Metadata Type │ API Name │ +├──────────────────────────┼────────────────────────┤ +│ AuraDefinitionBundle │ AppPage_3_9 │ +├──────────────────────────┼────────────────────────┤ +│ AuraDefinitionBundle │ AppPage_4_8 │ +├──────────────────────────┼────────────────────────┤ +│ BrandingSet │ LEXTHEMINGEasy_Spaces │ +├──────────────────────────┼────────────────────────┤ +│ ContentAsset │ EasySpacesTile01 │ +├──────────────────────────┼────────────────────────┤ +│ ContentAsset │ EasySpaces_Logo1 │ +├──────────────────────────┼────────────────────────┤ +│ ContentAsset │ EasySpaces_Page_Dark1 │ +├──────────────────────────┼────────────────────────┤ +│ ContentAsset │ easy_spaces_tile_small │ +├──────────────────────────┼────────────────────────┤ +│ LightningExperienceTheme │ Easy_Spaces │ +├──────────────────────────┼────────────────────────┤ +│ LightningComponentBundle │ imageGallery │ +├──────────────────────────┼────────────────────────┤ +│ LightningComponentBundle │ imageTile │ +├──────────────────────────┼────────────────────────┤ +│ LightningComponentBundle │ pill │ +├──────────────────────────┼────────────────────────┤ +│ LightningComponentBundle │ pillList │ +└──────────────────────────┴────────────────────────┘ +Generated Command sfdx force:package:install --package 04t2s000000cC1NAAU -u SIT --noprompt --publishwait=10 --wait=120 --securitytype=AdminsOnly --upgradetype=Mixed --apexcompile=package +Waiting for the package install request to complete. Status = IN_PROGRESS + +Waiting for the package install request to complete. Status = IN_PROGRESS + +Waiting for the package install request to complete. Status = IN_PROGRESS + +Waiting for the package install request to complete. Status = IN_PROGRESS + +Successfully installed package [04t2s000000cC1NAAU] + +Updating Org with new Artifacts ESBaseStylesLWC 50.0.6.16 +-------------------------Installing Package------------------------------------ +Name: ESBaseCodeLWC +Type: unlocked +Version Number: 50.0.6.16 +Metadata Count: 23 +------------------------------------------------------------------------------- + +The following metadata will be deployed: +┌──────────────────────────┬───────────────────────────────────────────────────────────┐ +│ Metadata Type │ API Name │ +├──────────────────────────┼───────────────────────────────────────────────────────────┤ +│ AuraDefinitionBundle │ openRecordAction │ +├──────────────────────────┼───────────────────────────────────────────────────────────┤ +│ AuraDefinitionBundle │ selectObject │ +├──────────────────────────┼───────────────────────────────────────────────────────────┤ +│ ApexClass │ CustomerServices │ +├──────────────────────────┼───────────────────────────────────────────────────────────┤ +│ ApexClass │ CustomerServicesTest │ +├──────────────────────────┼───────────────────────────────────────────────────────────┤ +│ ApexClass │ MarketServices │ +├──────────────────────────┼───────────────────────────────────────────────────────────┤ +│ ApexClass │ MarketServicesTest │ +├──────────────────────────┼───────────────────────────────────────────────────────────┤ +│ ApexClass │ TestDataFactory │ +├──────────────────────────┼───────────────────────────────────────────────────────────┤ +│ CustomMetadata │ Customer_Fields.Contact_Customer_Fields │ +├──────────────────────────┼───────────────────────────────────────────────────────────┤ +│ CustomMetadata │ Customer_Fields.Lead_Customer_Fields │ +├──────────────────────────┼───────────────────────────────────────────────────────────┤ +│ Layout │ Customer_Fields__mdt-Customer Fields Layout │ +├──────────────────────────┼───────────────────────────────────────────────────────────┤ +│ LightningComponentBundle │ errorPanel │ +├──────────────────────────┼───────────────────────────────────────────────────────────┤ +│ LightningComponentBundle │ ldsUtils │ +├──────────────────────────┼───────────────────────────────────────────────────────────┤ +│ LightningMessageChannel │ Flow_Status_Change │ +├──────────────────────────┼───────────────────────────────────────────────────────────┤ +│ LightningMessageChannel │ Tile_Selection │ +├──────────────────────────┼───────────────────────────────────────────────────────────┤ +│ CustomObject │ Customer_Fields__mdt │ +├──────────────────────────┼───────────────────────────────────────────────────────────┤ +│ CustomField │ Customer_Fields__mdt.Customer_City__c │ +├──────────────────────────┼───────────────────────────────────────────────────────────┤ +│ CustomField │ Customer_Fields__mdt.Customer_Draft_Status_Values__c │ +├──────────────────────────┼───────────────────────────────────────────────────────────┤ +│ CustomField │ Customer_Fields__mdt.Customer_Email__c │ +├──────────────────────────┼───────────────────────────────────────────────────────────┤ +│ CustomField │ Customer_Fields__mdt.Customer_Name__c │ +├──────────────────────────┼───────────────────────────────────────────────────────────┤ +│ CustomField │ Customer_Fields__mdt.Customer_Reservation_Status_Value__c │ +├──────────────────────────┼───────────────────────────────────────────────────────────┤ +│ CustomField │ Customer_Fields__mdt.Customer_State__c │ +├──────────────────────────┼───────────────────────────────────────────────────────────┤ +│ CustomField │ Customer_Fields__mdt.Customer_Status__c │ +├──────────────────────────┼───────────────────────────────────────────────────────────┤ +│ CustomField │ Customer_Fields__mdt.Sobject_Type__c │ +└──────────────────────────┴───────────────────────────────────────────────────────────┘ +Generated Command sfdx force:package:install --package 04t2s000000cC1cAAE -u SIT --noprompt --publishwait=10 --wait=120 --securitytype=AdminsOnly --upgradetype=Mixed --apexcompile=package +Waiting for the package install request to complete. Status = IN_PROGRESS + +Waiting for the package install request to complete. Status = IN_PROGRESS + +Waiting for the package install request to complete. Status = IN_PROGRESS + +Waiting for the package install request to complete. Status = IN_PROGRESS + +Successfully installed package [04t2s000000cC1cAAE] + +Updating Org with new Artifacts ESBaseCodeLWC 50.0.6.16 + + +Checking out branch sfp_changelog_develop +Generating changelog... +Updating sit org with release-1.0-1(0) +[![sit-Release-1.0-1(0)-green](https://img.shields.io/static/v1?label=sit&message=Release-1.0-1(0)&color=green)](#7df66f58e93be435fcb22019c2efe0827f2862ad) + +# Release-1.0-1 +### Artifacts :package: +- **ESBaseCodeLWC** v50.0.6.16 (2bc11f53) + +- **ESBaseStylesLWC** v50.0.6.16 (2bc11f53) + +### Work Items :gem: +- SAM-6 +- SAM-158 +- SAM-162 +- SAM-178 + +### Commits :book: + +#### ESBaseCodeLWC +| Date | Time | Commit ID | Commit Message | +| ---------- | -------- | --------- | ---------------------------------------------------------------------------- | +| 25/01/2021 | 11:01:55 | c8dbab13 | Add persist credential to PR (#6) | +| 19/10/2020 | 17:30:31 | d7124579 | feat: winter '21 release updates (#178) | +| 28/09/2020 | 17:52:59 | e4fd5b2c | Setup sa11y and implement accessibility tests (#162) | +| 05/09/2020 | 02:10:49 | 9ca5cf96 | feat:object agnostic design for apex code for Customer List component (#158) | + + + +#### ESBaseStylesLWC +| Date | Time | Commit ID | Commit Message | +| ---------- | -------- | --------- | ------------------------------------------------------------------- | +| 19/10/2020 | 17:30:31 | d7124579 | feat: winter '21 release updates (#178) | + + + +Pushing changelog files to sfp_changelog_develop +Successfully generated changelog +---------------------------------------------------------------------------------------------------- + +Package Dependencies + 1 succeeded + 1 skipped + 0 failed + +Deployment + 2 succeeded + 0 failed + +Elapsed Time: 00:12:09 +---------------------------------------------------------------------------------------------------- diff --git a/demoreel/release/successBaseCode b/demoreel/release/successBaseCode new file mode 100644 index 000000000..377cf0c36 --- /dev/null +++ b/demoreel/release/successBaseCode @@ -0,0 +1,3 @@ +Successfully installed package [04t2s000000cC1cAAE] + +Updating Org with new Artifacts ESBaseCodeLWC 50.0.6.16 diff --git a/demoreel/release/successBaseStyles b/demoreel/release/successBaseStyles new file mode 100644 index 000000000..bfa373e31 --- /dev/null +++ b/demoreel/release/successBaseStyles @@ -0,0 +1,3 @@ +Successfully installed package [04t2s000000cC1NAAU] + +Updating Org with new Artifacts ESBaseStylesLWC 50.0.6.16 diff --git a/demoreel/release/successMC b/demoreel/release/successMC new file mode 100644 index 000000000..116afbae0 --- /dev/null +++ b/demoreel/release/successMC @@ -0,0 +1 @@ +Successfully installed package [04t0H000000ccCGQAY] diff --git a/packages/core/src/utils/Delay.ts b/packages/core/src/utils/Delay.ts index 14e75f272..1e860ec7c 100644 --- a/packages/core/src/utils/Delay.ts +++ b/packages/core/src/utils/Delay.ts @@ -1,5 +1,4 @@ -export async function delay(ms: number) { +export async function delay(ms: number = 0) { return new Promise(resolve => setTimeout(resolve, ms)); } - \ No newline at end of file diff --git a/packages/sfpowerscripts-cli/src/SfpowerscriptsCommand.ts b/packages/sfpowerscripts-cli/src/SfpowerscriptsCommand.ts index d7ff04ae0..407fad2b4 100644 --- a/packages/sfpowerscripts-cli/src/SfpowerscriptsCommand.ts +++ b/packages/sfpowerscripts-cli/src/SfpowerscriptsCommand.ts @@ -3,6 +3,8 @@ import { OutputFlags } from "@oclif/parser"; import SFPStatsSender from "@dxatscale/sfpowerscripts.core/lib/utils/SFPStatsSender" import * as rimraf from "rimraf"; import ProjectValidation from "./ProjectValidation"; +import DemoReelPlayer from "./utils/demoReelPlayer"; +import { fs } from "@salesforce/core"; /** * A base class that provides common funtionality for sfpowerscripts commands @@ -34,6 +36,14 @@ export default abstract class SfpowerscriptsCommand extends SfdxCommand { * Entry point of all commands */ async run(): Promise { + + //If demo mode, display demo reel and return + if(process.env.SFPOWERSCRIPTS_DEMO_MODE) + { + await this.executeDemoMode(); + return; + } + this.loadSfpowerscriptsVariables(this.flags); @@ -101,4 +111,18 @@ export default abstract class SfpowerscriptsCommand extends SfdxCommand { SFPStatsSender.initializeLogBasedMetrics(); } + + private async executeDemoMode() + { + + if(fs.existsSync(process.env.SFPOWERSCRIPTS_DEMOREEL_FOLDER_PATH)) + { + let player:DemoReelPlayer = new DemoReelPlayer(); + await player.execute(process.env.SFPOWERSCRIPTS_DEMOREEL_FOLDER_PATH); + } + else + { + console.log("Demo reel doesnt exist, Please check the path and try again"); + } + } } diff --git a/packages/sfpowerscripts-cli/src/utils/demoReelPlayer.ts b/packages/sfpowerscripts-cli/src/utils/demoReelPlayer.ts new file mode 100644 index 000000000..80ed8b94e --- /dev/null +++ b/packages/sfpowerscripts-cli/src/utils/demoReelPlayer.ts @@ -0,0 +1,62 @@ +import path = require("path"); +import * as fs from "fs-extra"; +var marked = require("marked"); +var TerminalRenderer = require("marked-terminal"); +import { delay } from "@dxatscale/sfpowerscripts.core/lib/utils/Delay"; + +export default class DemoReelPlayer { + public async execute(demoReelFolderPath: string) { + + //Define renderer + marked.setOptions({ + // Define custom renderer + renderer: new TerminalRenderer(), + }); + + let demoReel: demoReel = fs.readJSONSync(path.join(demoReelFolderPath,"demo.json"), { + encoding: "UTF-8", + }); + for (let response of demoReel.sequence) { + let ext = path.extname(path.resolve(demoReelFolderPath,response.filepath)); + let data = fs.readFileSync(path.resolve(demoReelFolderPath,response.filepath), "utf8"); + + if (response.data) { + Object.entries(response.data).forEach((entry) => { + data = data.replace(`\$\{\{${entry[0]}\}\}`, entry[1]); + }); + } + + if (response.repeat) { + let count = 0; + while (count <= response.repeat) { + await delay(response.preDelay); + if (ext === ".md") { + console.log(marked(data)); + } else { + console.log(data); + } + count++; + await delay(response.postDelay); + } + } else { + await delay(response.preDelay); + if (ext === ".md") { + console.log(marked(data)); + } else { + console.log(data); + } + await delay(response.postDelay); + } + } + } +} + +interface demoReel { + sequence: { + filepath: string; + preDelay: number; + postDelay: number; + repeat: number; + data: { [p: string]: string }; + }[]; +}