Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
silentLogin: false,
redirectUri: '/',
redirectUriLogout: '/logout'
}
};
host = program.host;
try {
this.alfrescoJsApi = new alfrescoApi.AlfrescoApiCompatibility(config);
await this.alfrescoJsApi.login(program.username, program.password);
} catch (e) {
console.log('Login error' + e);
}
for (const key of Object.keys(RESOURCES_CLOUD.ACTIVITI_CLOUD_APPS)) {
await deleteApp(alfrescoJsApi, RESOURCES_CLOUD.ACTIVITI_CLOUD_APPS[key].name);
}
let notRunning = await getNotRunningApps(this.alfrescoJsApi);
if (notRunning && notRunning.length > 0) {
console.log(JSON.stringify(notRunning));
}
}
async function getNotRunningApps(alfrescoJsApi) {
let allStatusApps = await getDeployedApplicationsByStatus(alfrescoJsApi, '');
Object.keys(RESOURCES_CLOUD.ACTIVITI_CLOUD_APPS).forEach((key) => {
let isNotRunning = allStatusApps.find((currentApp) => {
//console.log(currentApp.entry.name + ' ' +currentApp.entry.status);
return RESOURCES_CLOUD.ACTIVITI_CLOUD_APPS[key].name === currentApp.entry.name && currentApp.entry.status !== 'Running';
});
if (isNotRunning && isNotRunning.entry.status !== 'ImagePushFailed') {
notRunningApps.push(isNotRunning);
}
});
if (notRunningApps.length > 0) {
console.log(`The following apps are NOT running in the target env:`);
notRunningApps.forEach((currentApp) => {
console.log(`App ${currentApp.entry.name } current status ${JSON.stringify(currentApp.entry.status)}`);
});
let isNotRunning = allStatusApps.find((currentApp) => {
//console.log(currentApp.entry.name + ' ' +currentApp.entry.status);
return RESOURCES_CLOUD.ACTIVITI_CLOUD_APPS[key].name === currentApp.entry.name && currentApp.entry.status !== 'Running';
});