Skip to content

Commit

Permalink
Merge pull request #24 from Fgerthoffert/develop
Browse files Browse the repository at this point in the history
Slight changes in manifest handling
  • Loading branch information
Fgerthoffert authored Jan 31, 2020
2 parents 1c2b123 + f9a3fe9 commit 75b15ba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/commands/manifest/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default class ManifestCreate extends Command {
},
{
type: 'shell',
command: 'node -v'
cmd: 'node -v'
}
],
// List source docker images that would be used in the absence of corresponding images
Expand Down
14 changes: 11 additions & 3 deletions src/commands/manifest/run.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { flags } from '@oclif/command';
import cli from 'cli-ux';

import { performance } from 'perf_hooks';
import * as loadYamlFile from 'load-yaml-file';
import * as fs from 'fs';
Expand Down Expand Up @@ -52,10 +54,11 @@ export default class ManifestRun extends Command {
if (manifestContent.jobs !== undefined && manifestContent.jobs.length > 0) {
const gClient = await graphqlClient(flags);
await waitAlive(gClient, 500000); // Wait for 500s by default

let browser = null;
let jahiaPage = null;
for (const job of manifestContent.jobs) {
cli.action.start('Starting a job of type: ' + job.type);
const t1 = performance.now();
if ([ 'webproject', 'groovy' ].includes(job.type)) {
if (browser === null) {
// eslint-disable-next-line no-await-in-loop
Expand Down Expand Up @@ -119,10 +122,15 @@ export default class ManifestRun extends Command {
console.log('ERROR: Unsupported job type');
exit();
}
cli.action.stop(' done (' + Math.round(performance.now() - t1) + ' ms)');
}

await jahiaPage.close();
await closePuppeteer(browser);
if (jahiaPage !== null) {
await jahiaPage.close();
}
if (browser !== null) {
await closePuppeteer(browser);
}
} else {
console.log('Manifest is empty and does not contain any jobs');
}
Expand Down

0 comments on commit 75b15ba

Please sign in to comment.