mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACA-4227] [APS] Create a script to check Process Services Management plugin status before running e2e tests (#6486)
* [ACA-4227] Create a generic script to check plugin status before running e2e tests by plugin name * * Added governace env check * * Added AAE plugin check * * Updated script * small improvements, add uiName parameter for the command * * Fixed comments * * Moved check-plugin script in the common place * * Added table format to show plugin status Co-authored-by: adomi <ardit.domi@alfresco.com>
This commit is contained in:
55
lib/cli/scripts/plugins/process-automation-check-plugin.ts
Normal file
55
lib/cli/scripts/plugins/process-automation-check-plugin.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import { PluginInterface } from './plugin-model';
|
||||
import { logger } from '../logger';
|
||||
import { ProcessAutomationHealth } from './process-automation-health';
|
||||
|
||||
export class ProcessAutomationCheckPlugin {
|
||||
processAutomationHealth: ProcessAutomationHealth;
|
||||
|
||||
constructor(
|
||||
private plugInInfo: PluginInterface,
|
||||
private alfrescoJsApi: any
|
||||
) {
|
||||
this.processAutomationHealth = new ProcessAutomationHealth(
|
||||
this.plugInInfo,
|
||||
this.alfrescoJsApi
|
||||
);
|
||||
}
|
||||
|
||||
async checkProcessAutomationPlugin() {
|
||||
let pluginStatus;
|
||||
try {
|
||||
const isPluginEnabled = await this.processAutomationHealth.isPluginEnabledFromAppConfiguration();
|
||||
const isBackendActive = await this.processAutomationHealth.checkBackendHealth();
|
||||
|
||||
if (isPluginEnabled && isBackendActive) {
|
||||
logger.info(
|
||||
`The plugin ${
|
||||
this.plugInInfo.name
|
||||
} has been correctly configured`
|
||||
);
|
||||
|
||||
pluginStatus = [{ PluginName: this.plugInInfo.name, Status: 'Active', BE: 'Enabled', FE: 'Enabled' }];
|
||||
console.table(pluginStatus);
|
||||
} else {
|
||||
this.logConfigurationError();
|
||||
pluginStatus = [{ PluginName: this.plugInInfo.name, Status: 'Inactive', BE: isBackendActive ? 'Enabled' : 'Disabled', FE: isPluginEnabled ? 'Enabled' : 'Disabled' }];
|
||||
console.table(pluginStatus);
|
||||
process.exit(1);
|
||||
}
|
||||
} catch (e) {
|
||||
this.logConfigurationError(e);
|
||||
pluginStatus = [{ PluginName: this.plugInInfo.name, Status: 'Inactive', BE: 'Disabled', FE: 'Disabled' }];
|
||||
console.table(pluginStatus);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
private logConfigurationError(error?: any) {
|
||||
logger.error(
|
||||
`The plugin ${
|
||||
this.plugInInfo.name
|
||||
} has not been correctly configured`,
|
||||
error
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user