Skip to content

Commit

Permalink
feat(dependency:install): add release def filter
Browse files Browse the repository at this point in the history
  • Loading branch information
alanjaouen committed Aug 5, 2024
1 parent 6138447 commit 3391fbc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
7 changes: 4 additions & 3 deletions messages/dependency_install.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandDescription":"Install all the external dependencies of a given project",
"installationkeysFlagDescription":"Installation key for key-protected packages (format is packagename:key --> core:key nCino:key vlocity:key to allow some packages without installation key)"
}
"commandDescription":"Install all the external dependencies of a given project",
"configFileFlagDescription":"Path to the config file which determines which external dependency are being installed based on packages in release config",
"installationkeysFlagDescription":"Installation key for key-protected packages (format is packagename:key --> core:key nCino:key vlocity:key to allow some packages without installation key)"
}
15 changes: 13 additions & 2 deletions src/commands/dependency/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import InstallUnlockedPackageCollection from '../../core/package/packageInstalle
import SFPOrg from '../../core/org/SFPOrg';
import { Flags } from '@oclif/core';
import { loglevel, targetdevhubusername, requiredUserNameFlag } from '../../flags/sfdxflags';
import ReleaseConfigLoader from '../../impl/release/ReleaseConfigLoader';

// Initialize Messages with the current plugin directory
Messages.importMessagesDirectory(__dirname);
Expand All @@ -30,6 +31,9 @@ export default class Install extends SfpCommand {
required: false,
description: messages.getMessage('installationkeysFlagDescription'),
}),
releaseconfig: Flags.string({
description: messages.getMessage('configFileFlagDescription'),
}),
loglevel
};

Expand All @@ -43,10 +47,17 @@ export default class Install extends SfpCommand {
ProjectConfig.getSFDXProjectConfig(null),
this.flags.installationkeys
);
let externalPackage2s = await externalPackageResolver.resolveExternalPackage2DependenciesToVersions();

let packages = null;
if (this.flags.releaseconfig) {
let releaseConfigLoader: ReleaseConfigLoader = new ReleaseConfigLoader(new ConsoleLogger(), this.flags.releaseconfig);
packages = releaseConfigLoader.getPackagesAsPerReleaseConfig();
}

let externalPackage2s = await externalPackageResolver.resolveExternalPackage2DependenciesToVersions(packages);

SFPLogger.log(
`Installing external package dependencies of this project in ${username}`,
`Installing external package dependencies of this project in ${username}`,
LoggerLevel.INFO,
new ConsoleLogger()
);
Expand Down

0 comments on commit 3391fbc

Please sign in to comment.