mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4948] Move the resources config in the process cloud lib - Part 2 (#5143)
* Move the resources in the cloud lib * Use adf cli * Add missing process definitions * Add debug points * Print new class * Use the resources under the adf-testing * Use the resources from testing package * Fix adf-testing bugs * remove empty row * Remove the npm install * Remove log stuff * Remove the console log * Fix typo on process def names Improve the debug e2e command * Fix lowercase name * Check the process cloud env and content env * Add the new process definitions * Add missing process definitions * Use the latest simpleapp * Rollback the bigFile * Use relative link * Trasnpile the adf-testing before using it
This commit is contained in:
committed by
Eugenio Romano
parent
ee5c90871a
commit
941df740d5
@@ -1,489 +0,0 @@
|
||||
let path = require('path');
|
||||
let fs = require('fs');
|
||||
let alfrescoApi = require('@alfresco/js-api');
|
||||
let program = require('commander');
|
||||
let ACTIVITI7_APPS = require('../../e2e/util/resources').ACTIVITI7_APPS;
|
||||
|
||||
let config = {};
|
||||
let absentApps = [];
|
||||
let pushFailedApps = [];
|
||||
let notRunningApps = [];
|
||||
let host;
|
||||
|
||||
let MAX_RETRY = 3;
|
||||
let counter = 0;
|
||||
let TIMEOUT = 1000;
|
||||
|
||||
|
||||
async function main() {
|
||||
|
||||
console.log('---START---');
|
||||
|
||||
program
|
||||
.version('0.1.0')
|
||||
.option('--host [type]', 'Remote environment host adf.lab.com ')
|
||||
.option('--oauth [type]', 'oauth host')
|
||||
.option('--client [type]', 'clientId ')
|
||||
.option('-p, --password [type]', 'password ')
|
||||
.option('-u, --username [type]', 'username ')
|
||||
.parse(process.argv);
|
||||
|
||||
config = {
|
||||
provider: 'BPM',
|
||||
hostBpm: `${program.host}`,
|
||||
authType: 'OAUTH',
|
||||
oauth2: {
|
||||
host: `${program.oauth}`,
|
||||
clientId: program.client,
|
||||
scope: 'openid',
|
||||
secret: '',
|
||||
implicitFlow: false,
|
||||
silentLogin: false,
|
||||
redirectUri: '/',
|
||||
redirectUriLogout: '/logout'
|
||||
}
|
||||
};
|
||||
|
||||
host = program.host;
|
||||
|
||||
console.log('---Login---');
|
||||
|
||||
try {
|
||||
this.alfrescoJsApi = new alfrescoApi.AlfrescoApiCompatibility(config);
|
||||
await this.alfrescoJsApi.login(program.username, program.password);
|
||||
} catch (e) {
|
||||
console.log('Login error' + e);
|
||||
}
|
||||
|
||||
console.log('---Login ok---');
|
||||
|
||||
|
||||
await deployAbsentApps(this.alfrescoJsApi);
|
||||
|
||||
let pushFailed = await getPushFailedApps(this.alfrescoJsApi);
|
||||
|
||||
if (pushFailed && pushFailed.length > 0) {
|
||||
await deleteStaleApps(this.alfrescoJsApi, pushFailed);
|
||||
}
|
||||
|
||||
let notRunning = await getNotRunningApps(this.alfrescoJsApi);
|
||||
|
||||
if (notRunning && notRunning.length > 0) {
|
||||
let notRunningAppAfterWait = await waitPossibleStaleApps(this.alfrescoJsApi, notRunning);
|
||||
|
||||
await deleteStaleApps(this.alfrescoJsApi, notRunningAppAfterWait);
|
||||
|
||||
await deployAbsentApps(this.alfrescoJsApi);
|
||||
let notRunningSecondAttempt = await getNotRunningApps(this.alfrescoJsApi);
|
||||
|
||||
if (notRunningSecondAttempt && notRunningSecondAttempt.length > 0) {
|
||||
let notRunningAppAfterWaitSecondAttempt = await waitPossibleStaleApps(this.alfrescoJsApi, notRunningSecondAttempt);
|
||||
|
||||
if (notRunningAppAfterWaitSecondAttempt && notRunningAppAfterWaitSecondAttempt.length > 0) {
|
||||
console.log(`Not possible to recover the following apps in the environment`);
|
||||
|
||||
notRunningAppAfterWaitSecondAttempt.forEach((currentApp) => {
|
||||
console.log(`App ${currentApp.entry.name } current status ${JSON.stringify(currentApp.entry.status)}`);
|
||||
});
|
||||
|
||||
process.exit(1);
|
||||
}
|
||||
} else {
|
||||
console.log(`Activiti 7 all ok :)`);
|
||||
}
|
||||
} else {
|
||||
console.log(`Activiti 7 all ok :-)`);
|
||||
}
|
||||
}
|
||||
|
||||
async function deleteStaleApps(alfrescoJsApi, notRunningAppAfterWait) {
|
||||
for (const currentApp of notRunningAppAfterWait) {
|
||||
await deleteApp(alfrescoJsApi, currentApp.entry.name);
|
||||
}
|
||||
}
|
||||
|
||||
async function waitPossibleStaleApps(alfrescoJsApi, notRunning) {
|
||||
pushFailedApps = [];
|
||||
do {
|
||||
console.log(`Wait stale app ${TIMEOUT}`);
|
||||
|
||||
notRunning.forEach((currentApp) => {
|
||||
console.log(`${currentApp.entry.name } ${currentApp.entry.status}`);
|
||||
});
|
||||
|
||||
sleep(TIMEOUT);
|
||||
counter++;
|
||||
|
||||
let runningApps = await getDeployedApplicationsByStatus(alfrescoJsApi, 'RUNNING');
|
||||
|
||||
notRunning.forEach((currentStaleApp) => {
|
||||
let nowIsRunning = runningApps.find((currentRunnignApp) => {
|
||||
return currentStaleApp.entry.name === currentRunnignApp.entry.name;
|
||||
});
|
||||
|
||||
if (nowIsRunning) {
|
||||
console.log(`The ${currentApp.entry.name } is now running`);
|
||||
|
||||
notRunning = notRunning.filter((item) => {
|
||||
return item.entry.name !== nowIsRunning.entry.name
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
} while (counter < MAX_RETRY && notRunning.length > 0);
|
||||
|
||||
return notRunning;
|
||||
}
|
||||
|
||||
async function getNotRunningApps(alfrescoJsApi) {
|
||||
let allStatusApps = await getDeployedApplicationsByStatus(alfrescoJsApi, '');
|
||||
|
||||
Object.keys(ACTIVITI7_APPS).forEach((key) => {
|
||||
let isNotRunning = allStatusApps.find((currentApp) => {
|
||||
//console.log(currentApp.entry.name + ' ' +currentApp.entry.status);
|
||||
return ACTIVITI7_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)}`);
|
||||
});
|
||||
|
||||
await checkIfAppIsReleased(alfrescoJsApi, absentApps);
|
||||
}
|
||||
|
||||
return notRunningApps;
|
||||
}
|
||||
|
||||
async function getPushFailedApps(alfrescoJsApi) {
|
||||
let allStatusApps = await getDeployedApplicationsByStatus(alfrescoJsApi, '');
|
||||
|
||||
Object.keys(ACTIVITI7_APPS).forEach((key) => {
|
||||
let isNotRunning = allStatusApps.find((currentApp) => {
|
||||
//console.log(currentApp.entry.name + ' ' +currentApp.entry.status);
|
||||
return ACTIVITI7_APPS[key].name === currentApp.entry.name && currentApp.entry.status !== 'Running';
|
||||
});
|
||||
|
||||
if (isNotRunning && isNotRunning.entry.status === 'ImagePushFailed') {
|
||||
pushFailedApps.push(isNotRunning);
|
||||
}
|
||||
});
|
||||
|
||||
if (pushFailedApps.length > 0) {
|
||||
console.log(`The following apps are pushFailedApps:`);
|
||||
pushFailedApps.forEach((currentApp) => {
|
||||
console.log(`App ${currentApp.entry.name } current status ${JSON.stringify(currentApp.entry.status)}`);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
return pushFailedApps;
|
||||
}
|
||||
|
||||
async function deployAbsentApps(alfrescoJsApi) {
|
||||
let deployedApps = await getDeployedApplicationsByStatus(alfrescoJsApi, '');
|
||||
|
||||
Object.keys(ACTIVITI7_APPS).forEach((key) => {
|
||||
let isPresent = deployedApps.find((currentApp) => {
|
||||
return ACTIVITI7_APPS[key].name === currentApp.entry.name;
|
||||
});
|
||||
|
||||
if (!isPresent) {
|
||||
absentApps.push(ACTIVITI7_APPS[key]);
|
||||
}
|
||||
});
|
||||
|
||||
if (absentApps.length > 0) {
|
||||
console.log(`The following apps are missing in the target env ${JSON.stringify(absentApps)}`);
|
||||
|
||||
await checkIfAppIsReleased(alfrescoJsApi, absentApps);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async function checkIfAppIsReleased(apiService, absentApps) {
|
||||
let listAppsInModeler = await getAppProjects(apiService);
|
||||
|
||||
for (let i = 0; i < absentApps.length; i++) {
|
||||
let currentAbsentApp = absentApps[i];
|
||||
let app = listAppsInModeler.find((currentApp) => {
|
||||
return currentAbsentApp.name === currentApp.entry.name;
|
||||
});
|
||||
|
||||
|
||||
if (!app) {
|
||||
console.log('Missing project, create the project for ' + currentAbsentApp.name);
|
||||
|
||||
let uploadedApp = await importProjectApp(apiService, currentAbsentApp);
|
||||
|
||||
console.log('Project uploaded ' + currentAbsentApp.name);
|
||||
|
||||
if (uploadedApp) {
|
||||
await releaseApp(apiService, uploadedApp);
|
||||
await deployApp(apiService, uploadedApp, currentAbsentApp.name);
|
||||
sleep(120000);///wait to not fail
|
||||
}
|
||||
} else {
|
||||
console.log('Project for ' + currentAbsentApp.name + ' present');
|
||||
|
||||
let appRelease = undefined;
|
||||
let appReleaseList = await getReleaseAppProjectId(apiService, app.entry.id);
|
||||
|
||||
if (appReleaseList.list.entries.length === 0) {
|
||||
console.log('Needs to release');
|
||||
appRelease = await releaseApp(apiService, app);
|
||||
|
||||
} else {
|
||||
console.log('Not Need to release' + JSON.stringify(appReleaseList));
|
||||
|
||||
let currentReleaseVersion = -1;
|
||||
|
||||
appReleaseList.list.entries.forEach((currentRelease) => {
|
||||
if (currentRelease.entry.version > currentReleaseVersion) {
|
||||
currentReleaseVersion = currentRelease.entry.version;
|
||||
appRelease = currentRelease;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
console.log('App to deploy app release id ' + JSON.stringify(appRelease));
|
||||
|
||||
await deployApp(apiService, appRelease, currentAbsentApp.name);
|
||||
sleep(120000);///wait to not fail
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function deployApp(apiService, app, name) {
|
||||
console.log(`Deploy app ${name}`);
|
||||
|
||||
const url = `${config.hostBpm}/deployment-service/v1/applications`;
|
||||
|
||||
const pathParams = {};
|
||||
const bodyParam = {
|
||||
"name": name,
|
||||
"releaseId": app.entry.id,
|
||||
"version": app.entry.name,
|
||||
"security": [{"role": "APS_ADMIN", "groups": [], "users": ["admin.adf", "superadminuser"]}, {
|
||||
"role": "APS_USER",
|
||||
"groups": ["hr", "testgroup"],
|
||||
"users": ["admin.adf"]
|
||||
}]
|
||||
};
|
||||
|
||||
const headerParams = {}, formParams = {}, queryParams = {},
|
||||
contentTypes = ['application/json'], accepts = ['application/json'];
|
||||
|
||||
try {
|
||||
return await apiService.oauth2Auth.callCustomApi(url, 'POST', pathParams, queryParams, headerParams, formParams, bodyParam,
|
||||
contentTypes, accepts);
|
||||
} catch (error) {
|
||||
console.log(`Not possible to deploy the project ${name} status : ${JSON.stringify(error.status)} ${JSON.stringify(error.response.text)}`);
|
||||
await deleteSiteByName(name);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
async function importProjectApp(apiService, app) {
|
||||
const pathFile = path.join('./e2e/' + app.file_location);
|
||||
console.log(pathFile);
|
||||
const file = fs.createReadStream(pathFile);
|
||||
|
||||
const url = `${config.hostBpm}/modeling-service/v1/projects/import`;
|
||||
|
||||
const pathParams = {}, queryParams = {},
|
||||
headerParams = {}, formParams = {'file': file}, bodyParam = {},
|
||||
contentTypes = ['multipart/form-data'], accepts = ['application/json'];
|
||||
|
||||
try {
|
||||
console.log('import app ' + app.file_location);
|
||||
return await apiService.oauth2Auth.callCustomApi(url, 'POST', pathParams, queryParams, headerParams, formParams, bodyParam,
|
||||
contentTypes, accepts);
|
||||
} catch (error) {
|
||||
if (error.status !== 409) {
|
||||
console.log(`Not possible to upload the project ${app.name} status : ${JSON.stringify(error.status)} ${JSON.stringify(error.response.text)}`);
|
||||
process.exit(1);
|
||||
} else {
|
||||
console.log(`Not possible to upload the project because inconsistency CS - Modelling try to delete manually the node`);
|
||||
await deleteSiteByName(app.name);
|
||||
await importProjectApp(apiService, app);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function getReleaseAppProjectId(apiService, projectId) {
|
||||
const url = `${config.hostBpm}/modeling-service/v1/projects/${projectId}/releases`;
|
||||
|
||||
const pathParams = {}, queryParams = {},
|
||||
headerParams = {}, formParams = {}, bodyParam = {},
|
||||
contentTypes = ['application/json'], accepts = ['application/json'];
|
||||
|
||||
try {
|
||||
return await apiService.oauth2Auth.callCustomApi(url, 'GET', pathParams, queryParams, headerParams, formParams, bodyParam,
|
||||
contentTypes, accepts);
|
||||
} catch (error) {
|
||||
console.log(`Not possible to get the release of the project ${projectId} ` + JSON.stringify(error));
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async function releaseApp(apiService, app) {
|
||||
const url = `${config.hostBpm}/modeling-service/v1/projects/${app.entry.id}/releases`;
|
||||
|
||||
console.log(url);
|
||||
console.log('Release ID ' + app.entry.id);
|
||||
const pathParams = {}, queryParams = {},
|
||||
headerParams = {}, formParams = {}, bodyParam = {},
|
||||
contentTypes = ['application/json'], accepts = ['application/json'];
|
||||
|
||||
try {
|
||||
return await apiService.oauth2Auth.callCustomApi(url, 'POST', pathParams, queryParams, headerParams, formParams, bodyParam,
|
||||
contentTypes, accepts);
|
||||
} catch (error) {
|
||||
console.log(`Not possible to release the project ${app.entry.name} status : $ \n ${JSON.stringify(error.status)} \n ${JSON.stringify(error.response.text)}`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async function getDeployedApplicationsByStatus(apiService, status) {
|
||||
const url = `${config.hostBpm}/deployment-service/v1/applications`;
|
||||
|
||||
const pathParams = {}, queryParams = {status: status},
|
||||
headerParams = {}, formParams = {}, bodyParam = {},
|
||||
contentTypes = ['application/json'], accepts = ['application/json'];
|
||||
|
||||
let data;
|
||||
try {
|
||||
data = await apiService.oauth2Auth.callCustomApi(url, 'GET', pathParams, queryParams, headerParams, formParams, bodyParam,
|
||||
contentTypes, accepts);
|
||||
|
||||
return data.list.entries;
|
||||
} catch (error) {
|
||||
console.log(`Not possible get the applications from deployment-service ${JSON.stringify(error)} `);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async function getAppProjects(apiService, status) {
|
||||
const url = `${config.hostBpm}/modeling-service/v1/projects`;
|
||||
|
||||
const pathParams = {}, queryParams = {status: status},
|
||||
headerParams = {}, formParams = {}, bodyParam = {},
|
||||
contentTypes = ['application/json'], accepts = ['application/json'];
|
||||
|
||||
let data;
|
||||
try {
|
||||
data = await apiService.oauth2Auth.callCustomApi(url, 'GET', pathParams, queryParams, headerParams, formParams, bodyParam,
|
||||
contentTypes, accepts);
|
||||
return data.list.entries;
|
||||
} catch (error) {
|
||||
console.log(`Not possible get the application from modeling-service ` + error);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
async function deleteApp(apiService, appName) {
|
||||
console.log(`Delete the app ${appName}`);
|
||||
|
||||
const url = `${config.hostBpm}/deployment-service/v1/applications/${appName}`;
|
||||
|
||||
const pathParams = {}, queryParams = {},
|
||||
headerParams = {}, formParams = {}, bodyParam = {},
|
||||
contentTypes = ['application/json'], accepts = ['application/json'];
|
||||
|
||||
try {
|
||||
await apiService.oauth2Auth.callCustomApi(url, 'DELETE', pathParams, queryParams, headerParams, formParams, bodyParam,
|
||||
contentTypes, accepts);
|
||||
|
||||
///it needs time
|
||||
console.log(`Deleting apps stale wait 3 minutes`);
|
||||
sleep(180000);
|
||||
console.log(`App deleted`);
|
||||
} catch (error) {
|
||||
console.log(`Not possible to delete the application from modeling-service` + error);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
function sleep(delay) {
|
||||
var start = new Date().getTime();
|
||||
while (new Date().getTime() < start + delay) ;
|
||||
}
|
||||
|
||||
async function deleteChildrenNodeByName(alfrescoJsApi, nameNodeToDelete, nodeId) {
|
||||
let childrenNodes = await alfrescoJsApi.core.nodesApi.getNodeChildren(nodeId);
|
||||
|
||||
let childrenToDelete = childrenNodes.list.entries.find((currentNode) => {
|
||||
return currentNode.entry.name === nameNodeToDelete;
|
||||
});
|
||||
|
||||
console.log('childrenToDelete ' + childrenToDelete.entry.name);
|
||||
|
||||
if (childrenToDelete) {
|
||||
await alfrescoJsApi.core.nodesApi.deleteNode(childrenToDelete.entry.id);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
async function deleteSiteByName(name) {
|
||||
|
||||
console.log(`====== Delete Site ${name} ${program.host} ======`);
|
||||
|
||||
let alfrescoJsApi = new alfrescoApi.AlfrescoApiCompatibility({
|
||||
provider: 'ECM',
|
||||
hostEcm: `https://${program.host}`
|
||||
});
|
||||
|
||||
await this.alfrescoJsApi.login(program.username, program.password);
|
||||
|
||||
let listSites = [];
|
||||
|
||||
try {
|
||||
listSites = await alfrescoJsApi.core.sitesApi.getSites();
|
||||
} catch (error) {
|
||||
console.log('error get list sites' + JSON.stringify(error));
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
let apsModelingNodeId;
|
||||
let apsReleaseNodeId;
|
||||
|
||||
if (listSites && listSites.list.entries.length > 0) {
|
||||
for (let i = 0; i < listSites.list.entries.length; i++) {
|
||||
if (listSites.list.entries[i].entry.id === name) {
|
||||
try {
|
||||
await alfrescoJsApi.core.sitesApi.deleteSite(listSites.list.entries[i].entry.id, {options: {permanent: true}});
|
||||
} catch (error) {
|
||||
console.log('error' + JSON.stringify(error));
|
||||
}
|
||||
}
|
||||
|
||||
if (listSites.list.entries[i].entry.id === 'ApsModeling') {
|
||||
apsModelingNodeId = listSites.list.entries[i].entry.guid;
|
||||
}
|
||||
|
||||
if (listSites.list.entries[i].entry.id === 'ApsRelease') {
|
||||
apsReleaseNodeId = listSites.list.entries[i].entry.guid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`====== Delete Folder in apsModeling`);
|
||||
await deleteChildrenNodeByName(alfrescoJsApi, name, apsModelingNodeId);
|
||||
|
||||
console.log(`====== Delete Folder in apsRelease`);
|
||||
await deleteChildrenNodeByName(alfrescoJsApi, name, apsReleaseNodeId);
|
||||
}
|
||||
|
||||
main();
|
@@ -1,6 +1,6 @@
|
||||
let alfrescoApi = require('@alfresco/js-api');
|
||||
let program = require('commander');
|
||||
let ACTIVITI7_APPS = require('../../e2e/util/resources').ACTIVITI7_APPS;
|
||||
const RESOURCES_CLOUD = require("@alfresco/adf-process-services-cloud");
|
||||
|
||||
let config = {};
|
||||
let absentApps = [];
|
||||
@@ -42,8 +42,8 @@ async function main() {
|
||||
console.log('Login error' + e);
|
||||
}
|
||||
|
||||
for (const key of Object.keys(ACTIVITI7_APPS)) {
|
||||
await deleteApp(alfrescoJsApi, ACTIVITI7_APPS[key].name);
|
||||
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);
|
||||
@@ -56,10 +56,10 @@ async function main() {
|
||||
async function getNotRunningApps(alfrescoJsApi) {
|
||||
let allStatusApps = await getDeployedApplicationsByStatus(alfrescoJsApi, '');
|
||||
|
||||
Object.keys(ACTIVITI7_APPS).forEach((key) => {
|
||||
Object.keys(RESOURCES_CLOUD.ACTIVITI_CLOUD_APPS).forEach((key) => {
|
||||
let isNotRunning = allStatusApps.find((currentApp) => {
|
||||
//console.log(currentApp.entry.name + ' ' +currentApp.entry.status);
|
||||
return ACTIVITI7_APPS[key].name === currentApp.entry.name && currentApp.entry.status !== 'Running';
|
||||
return RESOURCES_CLOUD.ACTIVITI_CLOUD_APPS[key].name === currentApp.entry.name && currentApp.entry.status !== 'Running';
|
||||
});
|
||||
|
||||
if (isNotRunning && isNotRunning.entry.status !== 'ImagePushFailed') {
|
||||
|
@@ -221,6 +221,11 @@ fi
|
||||
echo "====== Update webdriver-manager ====="
|
||||
./node_modules/protractor/bin/webdriver-manager update --gecko=false
|
||||
|
||||
export DEBUG_OPTION=''
|
||||
if [[ $DEBUG == "true" ]]; then
|
||||
DEBUG_OPTION=' node --inspect-brk '
|
||||
fi
|
||||
|
||||
if [[ $DEVELOPMENT == "true" ]]; then
|
||||
echo "====== Run against local development ====="
|
||||
npm run e2e-lib || exit 1
|
||||
@@ -243,14 +248,8 @@ else
|
||||
sed -e "s/\"ecmHost\": \".*\"/\"ecmHost\": \"${encoded}\"/g" "${sedi[@]}" demo-shell/dist/app.config.json
|
||||
fi
|
||||
|
||||
npm run lite-server-e2e>/dev/null & ./node_modules/protractor/bin/protractor protractor.conf.ts || exit 1
|
||||
npm run lite-server-e2e>/dev/null & $DEBUG_OPTION ./node_modules/protractor/bin/protractor protractor.conf.ts || exit 1
|
||||
else
|
||||
if [[ $DEBUG == "true" ]]; then
|
||||
echo "====== DEBUG npm run lite-server-e2e>/dev/null & ./node_modules/protractor/bin/protractor protractor.conf.ts || exit 1
|
||||
else====="
|
||||
node --inspect-brk ./node_modules/protractor/bin/protractor protractor.conf.ts || exit 1
|
||||
else
|
||||
./node_modules/protractor/bin/protractor protractor.conf.ts || exit 1
|
||||
fi
|
||||
$DEBUG_OPTION ./node_modules/protractor/bin/protractor protractor.conf.ts || exit 1
|
||||
fi
|
||||
fi
|
||||
|
@@ -13,17 +13,18 @@ AFFECTED_E2E="$(./scripts/git-util/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e/
|
||||
|
||||
RUN_E2E=$(echo ./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST_BPM" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" -host_sso "$E2E_HOST_SSO" -host_bpm "$E2E_HOST_BPM" -host_identity "$E2E_HOST_IDENTITY" -identity_admin_email "$E2E_ADMIN_EMAIL_IDENTITY" -identity_admin_password "$E2E_ADMIN_PASSWORD_IDENTITY" -prefix $TRAVIS_BUILD_NUMBER --use-dist -gnu )
|
||||
|
||||
./node_modules/@alfresco/adf-cli/bin/adf-cli init-aae-env --host "$E2E_HOST_BPM" --oauth "$E2E_HOST_SSO" --username "$E2E_USERNAME" --password "$E2E_PASSWORD" --clientId 'activiti' || exit 1
|
||||
node ./scripts/check-env/check-cs-env.js --host "$E2E_HOST_BPM" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1
|
||||
|
||||
if [[ $AFFECTED_LIBS =~ "testing" || $AFFECTED_LIBS =~ "$CONTEXT_ENV" || $TRAVIS_PULL_REQUEST == "false" ]];
|
||||
then
|
||||
node ./scripts/check-env/check-activiti-env.js --host "$E2E_HOST_BPM" --oauth "$E2E_HOST_SSO" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" --client 'activiti' || exit 1
|
||||
node ./scripts/check-env/check-cs-env.js --host "$E2E_HOST_BPM" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1
|
||||
|
||||
echo "Case 1 - adf-testing has been changed";
|
||||
$RUN_E2E --folder $CONTEXT_ENV
|
||||
else if [[ $AFFECTED_E2E = "e2e/$CONTEXT_ENV" ]];
|
||||
then
|
||||
echo "Case 2 - e2e/$CONTEXT_ENV folder has been changed";
|
||||
HEAD_SHA_BRANCH="$(git merge-base origin/$TRAVIS_BRANCH HEAD)"
|
||||
LIST_SPECS="$(git diff --name-only $HEAD_SHA_BRANCH HEAD | grep "^e2e/$CONTEXT_ENV/" | paste -sd , -)"
|
||||
node ./scripts/check-env/check-activiti-env.js --host "$E2E_HOST_BPM" --oauth "$E2E_HOST_SSO" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" --client 'activiti' || exit 1
|
||||
if [[ $LIST_SPECS != "" ]];
|
||||
then
|
||||
echo "Run $CONTEXT_ENV e2e based on the sha $HEAD_SHA_BRANCH with the specs: "$LIST_SPECS
|
||||
|
Reference in New Issue
Block a user