diff --git a/packages/sfp-cli/messages/build.json b/packages/sfp-cli/messages/build.json index 4eaa714ee..abada6472 100644 --- a/packages/sfp-cli/messages/build.json +++ b/packages/sfp-cli/messages/build.json @@ -1,5 +1,5 @@ { - "commandDescription": "Build artifacts of your packages in the current project", + "commandDescription": "Build artifact(s) of your packages in the current project", "devhubAliasFlagDescription": "Provide the alias of the devhub previously authenticated, default value is HubOrg if using the Authenticate Devhub task", "diffCheckFlagDescription": "Only build the packages which have changed by analyzing previous tags", "repoUrlFlagDescription": "Custom source repository URL to use in artifact metadata, overrides origin URL defined in git config", diff --git a/packages/sfp-cli/messages/deploy.json b/packages/sfp-cli/messages/install.json similarity index 93% rename from packages/sfp-cli/messages/deploy.json rename to packages/sfp-cli/messages/install.json index f7522fe41..7fec5b8cc 100644 --- a/packages/sfp-cli/messages/deploy.json +++ b/packages/sfp-cli/messages/install.json @@ -1,5 +1,5 @@ { - "commandDescription": "Deploy artifacts from a given directory to a target org", + "commandDescription": "Installs artifact(s) from a given directory to a target org", "targetOrgFlagDescription": "Alias/User Name of the target environment", "artifactDirectoryFlagDescription": "The directory containing artifacts to be deployed", "waitTimeFlagDescription": "Wait time for command to finish in minutes", diff --git a/packages/sfp-cli/messages/install_data_package.json b/packages/sfp-cli/messages/install_data_package.json deleted file mode 100644 index 5b883e245..000000000 --- a/packages/sfp-cli/messages/install_data_package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "commandDescription": "(DEPRECATED) Installs a SFDMU-based data package consisting of csvfiles and export.json to a target org", - "packageFlagDescription": "Name of the package to be installed", - "targetOrgFlagDescription": "Alias/User Name of the target environment", - "artifactDirectoryFlagDescription": "The directory where the artifact is located", - "skipOnMissingArtifactFlagDescription": "Skip package installation if the build artifact is missing. Enable this if artifacts are only being created for modified packages", - "skipIfAlreadyInstalled": "Skip the package installation if the package is already installed in the org" -} diff --git a/packages/sfp-cli/messages/install_package.json b/packages/sfp-cli/messages/install_package.json deleted file mode 100644 index 2dfc9c318..000000000 --- a/packages/sfp-cli/messages/install_package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commandDescription": "Installs a sfp artifact to an org", - "packageFlagDescription": "Name of the package to be installed", - "targetOrgFlagDescription": "Alias/User Name of the target environment", - "apexCompileOnlyPackageFlagDescription": "(unlocked) package installation triggers a compilation of apex, flag to trigger compilation of package only", - "artifactDirectoryFlagDescription": "The directory where the artifact is located", - "securityTypeFlagDescription": "(unlocked) Select the security access for the package installation", - "optimizedeployment": "(source) Optimize deployment by triggering test classes that are in the package, rather than using the whole tests in the org", - "skiptesting": "(source) Skips running test when deploying to a sandbox", - "upgradeTypeFlagDescription": "(unlocked)the upgrade type for the package installation", - "waitTimeFlagDescription": "wait time for command to finish in minutes", - "publishWaitTimeFlagDescription": "(unlocked) number of minutes to wait for subscriber package version ID to become available in the target org", - "skipIfAlreadyInstalled": "Skip the installation if the package is already installed in the org" -} diff --git a/packages/sfp-cli/messages/install_package_command.json b/packages/sfp-cli/messages/install_package_command.json deleted file mode 100644 index b0b22e4de..000000000 --- a/packages/sfp-cli/messages/install_package_command.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "packageFlagDescription": "Name of the package to be installed", - "targetOrgFlagDescription": "Alias/User Name of the target environment", - "artifactDirectoryFlagDescription": "The directory where the artifact is located", - "skipOnMissingArtifactFlagDescription": "Skip package installation if the build artifact is missing. Enable this if artifacts are only being created for modified packages" -} diff --git a/packages/sfp-cli/messages/install_source_package.json b/packages/sfp-cli/messages/install_source_package.json deleted file mode 100644 index 0d5be458a..000000000 --- a/packages/sfp-cli/messages/install_source_package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "commandDescription": "(DEPRECATED) Installs a sfp source package to the target org", - "packageFlagDescription": "Name of the package to be installed", - "targetOrgFlagDescription": "Alias/User Name of the target environment", - "artifactDirectoryFlagDescription": "The directory where the artifact is located", - "skipOnMissingArtifactFlagDescription": "Skip package installation if the build artifact is missing. Enable this if artifacts are only being created for modified packages", - "waitTimeFlagDescription": "wait time for command to finish in minutes", - "optimizedeployment": "Optimize deployment by triggering test classes that are in the package, rather than using the whole tests in the org", - "skiptesting": "Skips running test when deploying to a sandbox", - "skipIfAlreadyInstalled": "Skip the package installation if the package is already installed in the org", - "refNameFlagDescription": "Reference name to be prefixed to output variables" -} diff --git a/packages/sfp-cli/messages/install_unlocked_package.json b/packages/sfp-cli/messages/install_unlocked_package.json deleted file mode 100644 index ac93c9e9d..000000000 --- a/packages/sfp-cli/messages/install_unlocked_package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "commandDescription": "(DEPRECATED) Installs an unlocked package using sfp metadata", - "packageFlagDescription": "Name of the package to be installed", - "targetOrgFlagDescription": "Alias/User Name of the target environment", - "packageInstalledFromFlagDescription": "automatically retrieve the version ID of the package to be installed, from the build artifact", - "packageVersionIdFlagDescription": "manually input package version Id of the package to be installed", - "installationKeyFlagDescription": "installation key for key-protected package", - "apexCompileOnlyPackageFlagDescription": "Each package installation triggers a compilation of apex, flag to trigger compilation of package only", - "artifactDirectoryFlagDescription": "The directory where the artifact is located", - "securityTypeFlagDescription": "Select the security access for the package installation", - "skipOnMissingArtifactFlagDescription": "Skip package installation if the build artifact is missing. Enable this if artifacts are only being created for modified packages", - "upgradeTypeFlagDescription": "the upgrade type for the package installation", - "waitTimeFlagDescription": "wait time for command to finish in minutes", - "publishWaitTimeFlagDescription": "number of minutes to wait for subscriber package version ID to become available in the target org", - "skipIfAlreadyInstalled": "Skip the package installation if the package is already installed in the org" -} diff --git a/packages/sfp-cli/messages/quickbuild.json b/packages/sfp-cli/messages/quickbuild.json index 3746e5f88..ead5af791 100644 --- a/packages/sfp-cli/messages/quickbuild.json +++ b/packages/sfp-cli/messages/quickbuild.json @@ -1,5 +1,5 @@ { - "commandDescription": "Build artifacts of your packages in the current project without dependency validation for unlocked packages", + "commandDescription": "Build artifact(s) of your packages in the current project without dependency validation for unlocked packages", "devhubAliasFlagDescription": "Provide the alias of the devhub previously authenticated, default value is HubOrg if using the Authenticate Devhub task", "diffCheckFlagDescription": "Only build the packages which have changed by analyzing previous tags", "gitTagFlagDescription": "Tag the current commit ID with an annotated tag containing the package name and version - does not push tag", diff --git a/packages/sfp-cli/messages/release.json b/packages/sfp-cli/messages/release.json index ab9c2e852..33d541461 100644 --- a/packages/sfp-cli/messages/release.json +++ b/packages/sfp-cli/messages/release.json @@ -1,5 +1,5 @@ { - "commandDescription": "Deploy a release definition to a target org", + "commandDescription": "Release a set of artifact(s) as defined by a release definition into a target org", "releaseDefinitionFlagDescription": "Path to release definiton yaml, Multiple paths can be seperated by commas", "targetOrgFlagDescription": "Alias/User Name of the target environment", "scriptPathFlagDescription": "(Optional: no-NPM) Path to script that authenticates and downloads artifacts from the registry", diff --git a/packages/sfp-cli/package.json b/packages/sfp-cli/package.json index 39c8f9d15..8c1420c51 100644 --- a/packages/sfp-cli/package.json +++ b/packages/sfp-cli/package.json @@ -1,6 +1,6 @@ { "name": "@flxblio/sfp", - "description": "Flxbl Toolkit", + "description": "sfp is a CLI tool to help you manage your Salesforce projects in an artifact centric model", "version": "36.0.7", "license": "MIT", "author": "flxblio", @@ -106,33 +106,40 @@ "topicSeparator": " ", "topics": { "releasedefinition": { - "description": "Commands around release definition" + "description": "Commands around managing release defintion" }, "pool": { - "description": "Manage the pooled orgs created by the sfp orchestrator in prepare stage" + "description": "Build and manage scratch org or sandbox pools" }, "changelog": { "description": "Track your artifacts & user stories as they progress through different environments, with release changelogs" }, - "impact": { - "description": "Figures out the impact of a change to various components of your project", + "artifacts": { + "description": "Manage artifacts for a project", "external": true }, - "analyze": { - "description": "Analyze your projects using static analysis tools such as PMD", + "impact": { + "description": "Utilities to help you understand the impact of various components in sfp", "external": true }, + "metrics": { + "description": "Report metrics to sfp supported metric providers", + "external": false + }, "apextests": { - "description": "Trigger Apex Tests and validate apex tests in a package" + "description": "Manage apex tests in a package or a org" }, "repo": { - "description": "Commands to help with maintaing repository" + "description": "Manage your project repository" }, "flow": { - "description": "Commands to help with management of flows" + "description": "Manage flows in your org" + }, + "profile": { + "description": "Commands to manage profiles in your project or org" }, "dependency": { - "description": "Commands to help with dependency management of a project", + "description": "Manage the dependencies of a project", "subtopics": { "expand": { "description": "Expand the dependency list in sfdx-project.json file for each package, fix the gap of dependencies from its dependent packages" diff --git a/packages/sfp-cli/resources/schemas/sfdx-project.schema.json b/packages/sfp-cli/resources/schemas/sfdx-project.schema.json index 04932d084..a58058645 100644 --- a/packages/sfp-cli/resources/schemas/sfdx-project.schema.json +++ b/packages/sfp-cli/resources/schemas/sfdx-project.schema.json @@ -178,6 +178,9 @@ "skipDeployOnOrgs": { "$ref": "#/definitions/packageDirectory.skipDeployOnOrgs" }, + "skipInstallOnOrgs": { + "$ref": "#/definitions/packageDirectory.skipInstallOnOrgs" + }, "skipTesting": { "$ref": "#/definitions/packageDirectory.skipTesting" }, @@ -530,6 +533,14 @@ "type": "string" } }, + "packageDirectory.skipInstallOnOrgs": { + "type": "array", + "title": "Skip installation of an artifact", + "description": "Skip installation of an artifact on a particular org or org(s). Take an array of aliases as the input", + "items": { + "type": "string" + } + }, "packageDirectory.skipTesting": { "type": "boolean", "title": "Skip Unit testing", diff --git a/packages/sfp-cli/src/BuildBase.ts b/packages/sfp-cli/src/BuildBase.ts index 22e1dc8f5..a6388bd01 100644 --- a/packages/sfp-cli/src/BuildBase.ts +++ b/packages/sfp-cli/src/BuildBase.ts @@ -190,7 +190,7 @@ export default abstract class BuildBase extends SfpCommand { SFPLogger.printHeaderLine('', COLOR_HEADER, LoggerLevel.INFO); SFPLogger.log( COLOR_SUCCESS( - `${buildExecResult.generatedPackages.length} packages created in ${COLOR_TIME( + `${buildExecResult.generatedPackages.length} artifacts created in ${COLOR_TIME( getFormattedTime(totalElapsedTime) )} minutes with ${COLOR_ERROR(buildExecResult.failedPackages.length)} errors` ) @@ -271,7 +271,7 @@ export default abstract class BuildBase extends SfpCommand { return buildProps; function printIncludeOnlyPackages(includeOnlyPackages: string[]) { SFPLogger.log( - COLOR_KEY_MESSAGE(`Build will include the below packages release configs (domain(s))(domain)`), + COLOR_KEY_MESSAGE(`Build will include the below packages as per the given release configs domain(s)`), LoggerLevel.INFO ); SFPLogger.log(COLOR_KEY_VALUE(`${includeOnlyPackages.toString()}`), LoggerLevel.INFO); @@ -296,7 +296,7 @@ export default abstract class BuildBase extends SfpCommand { function printIncludeOnlyPackages(includeOnlyPackages: string[]) { SFPLogger.log( - COLOR_KEY_MESSAGE(`Build will include the below packages release configs (domain(s))(domain)`), + COLOR_KEY_MESSAGE(`Build will include the below packages as per the given release configs(domain(s))`), LoggerLevel.INFO ); SFPLogger.log(COLOR_KEY_VALUE(`${includeOnlyPackages.toString()}`), LoggerLevel.INFO); diff --git a/packages/sfp-cli/src/commands/promote.ts b/packages/sfp-cli/src/commands/artifacts/promote.ts similarity index 89% rename from packages/sfp-cli/src/commands/promote.ts rename to packages/sfp-cli/src/commands/artifacts/promote.ts index f22fa78bf..1753b1d5c 100644 --- a/packages/sfp-cli/src/commands/promote.ts +++ b/packages/sfp-cli/src/commands/artifacts/promote.ts @@ -1,12 +1,12 @@ -import SfpCommand from '../SfpCommand'; +import SfpCommand from '../../SfpCommand'; import { Messages } from '@salesforce/core'; -import PromoteUnlockedPackageImpl from '../core/package/promote/PromoteUnlockedPackageImpl' -import ArtifactFetcher from '../core/artifacts/ArtifactFetcher'; +import PromoteUnlockedPackageImpl from '../../core/package/promote/PromoteUnlockedPackageImpl' +import ArtifactFetcher from '../../core/artifacts/ArtifactFetcher'; import { ConsoleLogger } from '@flxblio/sfp-logger'; -import SfpPackageBuilder from '../core/package/SfpPackageBuilder'; -import { PackageType } from '../core/package/SfpPackage'; +import SfpPackageBuilder from '../../core/package/SfpPackageBuilder'; +import { PackageType } from '../../core/package/SfpPackage'; import { Flags, ux } from '@oclif/core'; -import { loglevel, targetdevhubusername } from '../flags/sfdxflags'; +import { loglevel, targetdevhubusername } from '../../flags/sfdxflags'; import { LoggerLevel } from '@flxblio/sfp-logger'; import { COLOR_HEADER } from '@flxblio/sfp-logger'; import SFPLogger from '@flxblio/sfp-logger'; @@ -16,6 +16,8 @@ const messages = Messages.loadMessages('@flxblio/sfp', 'promote'); export default class Promote extends SfpCommand { public static description = messages.getMessage('commandDescription'); + static aliases = ['orchestrator:promote'] + public static examples = [`$ sfp promote -d path/to/artifacts -v `]; diff --git a/packages/sfp-cli/src/commands/build.ts b/packages/sfp-cli/src/commands/build.ts index 38b5e0457..33ca797df 100644 --- a/packages/sfp-cli/src/commands/build.ts +++ b/packages/sfp-cli/src/commands/build.ts @@ -12,6 +12,7 @@ const messages = Messages.loadMessages('@flxblio/sfp', 'build'); export default class Build extends BuildBase { public static description = messages.getMessage('commandDescription'); + static aliases = ['orchestrator:build'] getStage() { return Stage.BUILD; diff --git a/packages/sfp-cli/src/commands/deploy.ts b/packages/sfp-cli/src/commands/install.ts similarity index 85% rename from packages/sfp-cli/src/commands/deploy.ts rename to packages/sfp-cli/src/commands/install.ts index 2bcd6534b..d9869725f 100644 --- a/packages/sfp-cli/src/commands/deploy.ts +++ b/packages/sfp-cli/src/commands/install.ts @@ -20,12 +20,13 @@ Messages.importMessagesDirectory(__dirname); // Load the specific messages for this file. Messages from @salesforce/command, @salesforce/core, // or any library that is using the messages framework can also be loaded this way. -const messages = Messages.loadMessages('@flxblio/sfp', 'deploy'); +const messages = Messages.loadMessages('@flxblio/sfp', 'install'); -export default class Deploy extends SfpCommand { +export default class Install extends SfpCommand { public static description = messages.getMessage('commandDescription'); + static aliases = ['orchestrator:deploy',] - public static examples = [`$ sfp deploy -u `]; + public static examples = [`$ sfp install -u `]; protected static requiresUsername = false; protected static requiresDevhubUsername = false; @@ -80,8 +81,8 @@ export default class Deploy extends SfpCommand { public async execute() { let executionStartTime = Date.now(); - SFPLogger.log(COLOR_HEADER(`command: ${COLOR_KEY_MESSAGE(`deploy`)}`)); - SFPLogger.log(COLOR_HEADER(`Skip Packages If Already Installed: ${this.flags.skipifalreadyinstalled}`)); + SFPLogger.log(COLOR_HEADER(`command: ${COLOR_KEY_MESSAGE(`install`)}`)); + SFPLogger.log(COLOR_HEADER(`Skip artifacts if already installed: ${this.flags.skipifalreadyinstalled}`)); SFPLogger.log(COLOR_HEADER(`Artifact Directory: ${this.flags.artifactdir}`)); SFPLogger.log(COLOR_HEADER(`Target Environment: ${this.flags.targetorg}`)); if(this.flags.releaseconfig) SFPLogger.log(COLOR_HEADER(`Filter according to: ${this.flags.releaseconfig}`)); @@ -131,7 +132,7 @@ export default class Deploy extends SfpCommand { SFPLogger.printHeaderLine('',COLOR_HEADER,LoggerLevel.INFO); SFPLogger.log( COLOR_SUCCESS( - `${deploymentResult.deployed.length} packages deployed in ${COLOR_TIME( + `${deploymentResult.deployed.length} artifacts installed in ${COLOR_TIME( getFormattedTime(totalElapsedTime) )} with {${deploymentResult.failed.length}} errors` ) @@ -140,7 +141,7 @@ export default class Deploy extends SfpCommand { if (deploymentResult.failed.length > 0) { SFPLogger.log( COLOR_ERROR( - `\nPackages Failed to Deploy`, + `\nArtifacts failed to install:`, deploymentResult.failed.map((packageInfo) => packageInfo.sfpPackage.packageName) ) ); @@ -149,19 +150,28 @@ export default class Deploy extends SfpCommand { SFPStatsSender.logCount('deploy.scheduled', tags); + SFPStatsSender.logCount('install.scheduled', tags); SFPStatsSender.logGauge('deploy.packages.scheduled', deploymentResult.scheduled, tags); + SFPStatsSender.logGauge('install.packages.scheduled', deploymentResult.scheduled, tags); SFPStatsSender.logGauge('deploy.duration', totalElapsedTime, tags); + SFPStatsSender.logGauge('install.duration', totalElapsedTime, tags); SFPStatsSender.logGauge('deploy.succeeded.packages', deploymentResult.deployed.length, tags); + SFPStatsSender.logGauge('install.succeeded.packages', deploymentResult.deployed.length, tags); + SFPStatsSender.logGauge('deploy.failed.packages', deploymentResult.failed.length, tags); + SFPStatsSender.logGauge('install.failed.packages', deploymentResult.failed.length, tags); + if (deploymentResult.failed.length > 0) { SFPStatsSender.logCount('deploy.failed', tags); + SFPStatsSender.logCount('install.failed', tags); } else { SFPStatsSender.logCount('deploy.succeeded', tags); + SFPStatsSender.logCount('install.succeeded', tags); } } } diff --git a/packages/sfp-cli/src/commands/prepare.ts b/packages/sfp-cli/src/commands/pool/prepare.ts similarity index 92% rename from packages/sfp-cli/src/commands/prepare.ts rename to packages/sfp-cli/src/commands/pool/prepare.ts index fdec931b1..ab41df689 100644 --- a/packages/sfp-cli/src/commands/prepare.ts +++ b/packages/sfp-cli/src/commands/pool/prepare.ts @@ -1,13 +1,13 @@ import { Messages } from '@salesforce/core'; -import SfpCommand from '../SfpCommand'; -import PrepareImpl from '../impl/prepare/PrepareImpl'; -import SFPStatsSender from '../core/stats/SFPStatsSender'; -import { Stage } from '../impl/Stage'; +import SfpCommand from '../../SfpCommand'; +import PrepareImpl from '../../impl/prepare/PrepareImpl'; +import SFPStatsSender from '../../core/stats/SFPStatsSender'; +import { Stage } from '../../impl/Stage'; import * as fs from 'fs-extra'; -import ScratchOrgInfoFetcher from '../core/scratchorg/pool/services/fetchers/ScratchOrgInfoFetcher'; +import ScratchOrgInfoFetcher from '../../core/scratchorg/pool/services/fetchers/ScratchOrgInfoFetcher'; import Ajv from 'ajv'; import path = require('path'); -import { PoolErrorCodes } from '../core/scratchorg/pool/PoolError'; +import { PoolErrorCodes } from '../../core/scratchorg/pool/PoolError'; import SFPLogger, { LoggerLevel, COLOR_ERROR, @@ -16,17 +16,20 @@ import SFPLogger, { COLOR_TIME, COLOR_KEY_MESSAGE, } from '@flxblio/sfp-logger'; -import getFormattedTime from '../core/utils/GetFormattedTime'; -import { PoolConfig } from '../core/scratchorg/pool/PoolConfig'; +import getFormattedTime from '../../core/utils/GetFormattedTime'; +import { PoolConfig } from '../../core/scratchorg/pool/PoolConfig'; import { COLOR_WARNING } from '@flxblio/sfp-logger'; -import SFPOrg from '../core/org/SFPOrg'; +import SFPOrg from '../../core/org/SFPOrg'; import { Flags } from '@oclif/core'; -import { loglevel, logsgroupsymbol, targetdevhubusername } from '../flags/sfdxflags'; +import { loglevel, logsgroupsymbol, targetdevhubusername } from '../../flags/sfdxflags'; Messages.importMessagesDirectory(__dirname); const messages = Messages.loadMessages('@flxblio/sfp', 'prepare'); export default class Prepare extends SfpCommand { + + static aliases = ['orchestrator:prepare'] + protected static requiresDevhubUsername = true; protected static requiresProject = true; diff --git a/packages/sfp-cli/src/commands/publish.ts b/packages/sfp-cli/src/commands/publish.ts index c3d53e622..e2b238716 100644 --- a/packages/sfp-cli/src/commands/publish.ts +++ b/packages/sfp-cli/src/commands/publish.ts @@ -29,8 +29,9 @@ import { Flags } from '@oclif/core'; Messages.importMessagesDirectory(__dirname); const messages = Messages.loadMessages('@flxblio/sfp', 'publish'); -export default class Promote extends SfpCommand { +export default class Publish extends SfpCommand { public static description = messages.getMessage('commandDescription'); + static aliases = ['orchestrator:publish'] public static examples = [ `$ sfp publish --npm`, diff --git a/packages/sfp-cli/src/commands/quickbuild.ts b/packages/sfp-cli/src/commands/quickbuild.ts index dedd37ea3..9aacb278b 100644 --- a/packages/sfp-cli/src/commands/quickbuild.ts +++ b/packages/sfp-cli/src/commands/quickbuild.ts @@ -12,6 +12,7 @@ const messages = Messages.loadMessages('@flxblio/sfp', 'quickbuild'); export default class QuickBuild extends BuildBase { public static description = messages.getMessage('commandDescription'); + static aliases = ['orchestrator:quickbuild'] getStage() { return Stage.QUICKBUILD; diff --git a/packages/sfp-cli/src/commands/release.ts b/packages/sfp-cli/src/commands/release.ts index a7f53dbdc..2c07a47bf 100644 --- a/packages/sfp-cli/src/commands/release.ts +++ b/packages/sfp-cli/src/commands/release.ts @@ -29,6 +29,7 @@ const messages = Messages.loadMessages('@flxblio/sfp', 'release'); export default class Release extends SfpCommand { public static description = messages.getMessage('commandDescription'); + static aliases = ['orchestrator:release'] public static examples = [ `sfp release -p path/to/releasedefinition.yml -u myorg --npm --scope myscope --generatechangelog`, diff --git a/packages/sfp-cli/src/commands/validate.ts b/packages/sfp-cli/src/commands/validate.ts index 04d6811aa..f044f59e5 100644 --- a/packages/sfp-cli/src/commands/validate.ts +++ b/packages/sfp-cli/src/commands/validate.ts @@ -14,6 +14,7 @@ Messages.importMessagesDirectory(__dirname); const messages = Messages.loadMessages('@flxblio/sfp', 'validate'); export default class Validate extends SfpCommand { + static aliases = ['orchestrator:validate'] protected static requiresProject = true; public static description = messages.getMessage('commandDescription'); diff --git a/packages/sfp-cli/src/commands/validateAgainstOrg.ts b/packages/sfp-cli/src/commands/validateAgainstOrg.ts index 119a868c2..f957aba01 100644 --- a/packages/sfp-cli/src/commands/validateAgainstOrg.ts +++ b/packages/sfp-cli/src/commands/validateAgainstOrg.ts @@ -14,6 +14,7 @@ Messages.importMessagesDirectory(__dirname); const messages = Messages.loadMessages('@flxblio/sfp', 'validateAgainstOrg'); export default class ValidateAgainstOrg extends SfpCommand { + static aliases = ['orchestrator:validateagainstorg'] public static description = messages.getMessage('commandDescription'); public static examples = [`$ sfp validateAgainstOrg -u `]; diff --git a/packages/sfp-cli/src/impl/deploy/DeployImpl.ts b/packages/sfp-cli/src/impl/deploy/DeployImpl.ts index 6d335d9a6..91e2f4f61 100644 --- a/packages/sfp-cli/src/impl/deploy/DeployImpl.ts +++ b/packages/sfp-cli/src/impl/deploy/DeployImpl.ts @@ -91,7 +91,7 @@ export default class DeployImpl { let artifacts = ArtifactFetcher.fetchArtifacts(this.props.artifactDir, null, this.props.logger); - if (artifacts.length === 0) throw new Error(`No artifacts to deploy found in ${this.props.artifactDir}`); + if (artifacts.length === 0) throw new Error(`No artifacts to install found in ${this.props.artifactDir}`); //Convert artifacts to SfpPackages let sfpPackages = await this.generateSfpPackageFromArtifacts(artifacts); @@ -109,12 +109,12 @@ export default class DeployImpl { sfdxProjectConfig = ProjectConfig.getSFDXProjectConfig(null); } - SFPLogger.log('Packages' + sfpPackages.length, LoggerLevel.TRACE, this.props.logger); + SFPLogger.log('Artifacts' + sfpPackages.length, LoggerLevel.TRACE, this.props.logger); packagesToPackageInfo = await this.getPackagesToPackageInfo(sfpPackages); SFPLogger.log( - 'Packages' + JSON.stringify(packagesToPackageInfo), + 'Artifacts' + JSON.stringify(packagesToPackageInfo), LoggerLevel.TRACE, this.props.logger ); @@ -200,7 +200,7 @@ export default class DeployImpl { await this.promotePackagesBeforeInstallation(packageInfo.sourceDirectory, sfpPackage); } catch (error) { //skip packages already promoted - SFPLogger.log(`Package already promoted .. skipping`,LoggerLevel.WARN); + SFPLogger.log(`Artifact already promoted .. skipping`,LoggerLevel.WARN); } this.displayRetryHeader(isToBeRetried, attemptCount); @@ -235,7 +235,7 @@ export default class DeployImpl { FileOutputHandler.getInstance().writeOutput(`deployment-error.md`,`### 💣 Deployment Failed 💣`); - FileOutputHandler.getInstance().appendOutput(`deployment-error.md`,`Package Installation failed for **${queue[i].packageName}**`); + FileOutputHandler.getInstance().appendOutput(`deployment-error.md`,`Artifact Installation failed for **${queue[i].packageName}**`); FileOutputHandler.getInstance().appendOutput(`deployment-error.md`,`Reasons:`); FileOutputHandler.getInstance().appendOutput(`deployment-error.md`,`${error}`); @@ -356,7 +356,7 @@ export default class DeployImpl { if (this.props.promotePackagesBeforeDeploymentToOrg === this.props.targetUsername) { if (sfpPackage.packageType === PackageType.Unlocked) { console.log( - COLOR_KEY_MESSAGE(`Attempting to promote package ${sfpPackage.packageName} before installation`) + COLOR_KEY_MESSAGE(`Attempting to promote artifact ${sfpPackage.packageName} before installation`) ); if(!this.props.isDryRun) { @@ -388,7 +388,7 @@ export default class DeployImpl { } else alwaysDeployMessage = undefined; //Display header - SFPLogger.printHeaderLine('Installing Package',COLOR_HEADER,LoggerLevel.INFO,this.props.logger); + SFPLogger.printHeaderLine(`Installing artifact:${pkg}`,COLOR_HEADER,LoggerLevel.INFO,this.props.logger); SFPLogger.log(COLOR_HEADER(`Name: ${COLOR_KEY_MESSAGE(pkg)}`), LoggerLevel.INFO, this.props.logger); SFPLogger.log(`Type: ${COLOR_KEY_MESSAGE(sfpPackage.packageType)}`, LoggerLevel.INFO, this.props.logger); SFPLogger.log( @@ -456,10 +456,10 @@ export default class DeployImpl { isBaselinOrgModeActivated: boolean, props:DeployProps ) { - let groupSection = new GroupConsoleLogs(`Full Deployment Breakdown`, this.props.logger).begin(); + let groupSection = new GroupConsoleLogs(`Full Installation Breakdown`, this.props.logger).begin(); let maxTable = new Table({ head: [ - 'Package', + 'Artifact', 'Incoming Version', isBaselinOrgModeActivated ? 'Version in baseline org' : 'Version in org', 'To be installed?', @@ -480,10 +480,10 @@ export default class DeployImpl { groupSection.end(); - groupSection = new GroupConsoleLogs(`Packages to be deployed`, this.props.logger).begin(); + groupSection = new GroupConsoleLogs(`Artifacts to be installed`, this.props.logger).begin(); let minTable = new Table({ head: [ - 'Package', + 'Artifact', 'Incoming Version', isBaselinOrgModeActivated ? 'Version in baseline org' : 'Version in org', ], @@ -509,7 +509,7 @@ export default class DeployImpl { let tableData = { table: { head: [ - 'Package', + 'Artifact', 'Incoming Version', isBaselinOrgModeActivated ? 'Version in baseline org' : 'Version in org', 'To be installed?', @@ -633,7 +633,7 @@ export default class DeployImpl { } const outputHandler:FileOutputHandler = FileOutputHandler.getInstance(); - outputHandler.writeOutput('deployment-breakdown.md',`Please find the packages that will be deployed below`); + outputHandler.writeOutput('deployment-breakdown.md',`Please find the artifacts that will be installed below`); outputHandler.appendOutput('deployment-breakdown.md',`\n\n${getMarkdownTable(tableData)}`) ; } @@ -782,9 +782,12 @@ export default class DeployImpl { */ private isSkipDeployment(packageDescriptor: any, targetUsername: string): boolean { let skipDeployOnOrgs: string[] = packageDescriptor.skipDeployOnOrgs; + if(packageDescriptor.skipInstallOnOrgs) { + skipDeployOnOrgs = packageDescriptor.skipInstallOnOrgs; + } if (skipDeployOnOrgs) { if (!(skipDeployOnOrgs instanceof Array)) - throw new Error(`Property 'skipDeployOnOrgs' must be of type Array`); + throw new Error(`Property 'skipDeployOnOrgs' or 'skipInstallOnOrgs' must be of type Array`); else return skipDeployOnOrgs.includes(targetUsername); } else return false; } diff --git a/packages/sfp-cli/src/impl/release/ReleaseImpl.ts b/packages/sfp-cli/src/impl/release/ReleaseImpl.ts index 0d2f49bd7..14c204c39 100644 --- a/packages/sfp-cli/src/impl/release/ReleaseImpl.ts +++ b/packages/sfp-cli/src/impl/release/ReleaseImpl.ts @@ -78,7 +78,7 @@ export default class ReleaseImpl { ); //Clear up the deployment output - SFPLogger.log(`Clearing deployment output`, LoggerLevel.TRACE, this.logger); + SFPLogger.log(`Clearing installation output`, LoggerLevel.TRACE, this.logger); FileOutputHandler.getInstance().deleteOutputFile(`deployment-breakdown.md`); FileOutputHandler.getInstance().deleteOutputFile(`release-changelog.md`); diff --git a/packages/sfp-cli/tests/ProjectValidation.test.ts b/packages/sfp-cli/tests/ProjectValidation.test.ts index a3a2f6da0..fa06ca5e3 100644 --- a/packages/sfp-cli/tests/ProjectValidation.test.ts +++ b/packages/sfp-cli/tests/ProjectValidation.test.ts @@ -158,7 +158,7 @@ describe('Given a sfdx-project.json, it should be validated against the scehma', versionName: 'bi', versionNumber: '1.0.0.0', aliasfy: true, - skipDeployOnOrgs: ['uat'], + skipInstallOnOrgs: ['uat'], }, ], namespace: '', @@ -235,7 +235,7 @@ describe('Given a sfdx-project.json, it should be validated against the scehma', versionName: 'bi', versionNumber: '1.0.0.0', aliasfy: 'false', - skipDeployOnOrgs: ['uat'], + skipInstallOnOrgs: ['uat'], }, ], namespace: '',