Fix build scripts (#5461)

* improve check env script

* fix update script children
This commit is contained in:
Eugenio Romano 2020-02-10 00:33:14 +00:00 committed by GitHub
parent a0926a38d8
commit c84bb250fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 41 deletions

View File

@ -44,34 +44,35 @@ async function checkEnv() {
}
async function checkDiskSpaceFullEnv() {
this.alfrescoJsApi = new alfrescoApi.AlfrescoApiCompatibility({
provider: 'ECM',
hostEcm: program.host
});
await this.alfrescoJsApi.login(program.username, program.password);
let folder;
try {
folder = await alfrescoJsApi.nodes.addNode('-my-', {
'name': `try-env`,
'relativePath': `Builds`,
'nodeType': 'cm:folder'
}, {}, {
'overwrite': true
this.alfrescoJsApi = new alfrescoApi.AlfrescoApiCompatibility({
provider: 'ECM',
hostEcm: program.host
});
} catch (error) {
folder = await alfrescoJsApi.nodes.getNode('-my-', {
'relativePath': `Builds/try-env`,
'nodeType': 'cm:folder'
}, {}, {
'overwrite': true
});
}
await this.alfrescoJsApi.login(program.username, program.password);
let folder;
try {
folder = await alfrescoJsApi.nodes.addNode('-my-', {
'name': `try-env`,
'relativePath': `Builds`,
'nodeType': 'cm:folder'
}, {}, {
'overwrite': true
});
} catch (error) {
folder = await alfrescoJsApi.nodes.getNode('-my-', {
'relativePath': `Builds/try-env`,
'nodeType': 'cm:folder'
}, {}, {
'overwrite': true
});
}
try {
let pathFile = path.join(__dirname, '../../', 'README.md');
let file = fs.createReadStream(pathFile);
@ -89,11 +90,20 @@ async function checkDiskSpaceFullEnv() {
this.alfrescoJsApi.node.deleteNode(uploadedFile.entry.id, {permanent: true});
} catch (error) {
console.log('=============================================================');
console.log('================ Not able to upload a file ==================');
console.log('================ Possible cause CS is full ==================');
console.log('=============================================================');
process.exit(1);
counter++;
if (MAX_RETRY === counter) {
console.log('=============================================================');
console.log('================ Not able to upload a file ==================');
console.log('================ Possible cause CS is full ==================');
console.log('=============================================================');
process.exit(1);
} else {
console.log(`Retry in 1 minute attempt N ${counter}`);
sleep(TIMEOUT);
checkDiskSpaceFullEnv();
}
}
}

View File

@ -1,15 +1,4 @@
#!/bin/sh -f
# Trigger a new Travis-CI job.
# Usage:
# trigger-travis.sh [--pro] [--branch BRANCH] GITHUBID GITHUBPROJECT TRAVIS_ACCESS_TOKEN [MESSAGE]
# For example:
# trigger-travis.sh typetools checker-framework `cat ~/private/.travis-access-token` "Trigger for testing"
# For full documentation, see
# https://github.com/plume-lib/trigger-travis/
#!/usr/bin/env bash
eval repos=( "alfresco-modeler-app"
"alfresco-process-workspace-app"