Skip to content
Snippets Groups Projects
Commit a7082518 authored by michael.minelli's avatar michael.minelli
Browse files

Merge branch 'correct_compose_override_path' into v3.0.1

parents ef8b72f3 c52ea10c
No related branches found
No related tags found
No related merge requests found
...@@ -42,7 +42,8 @@ class ExerciseRunCommand extends CommanderCommand { ...@@ -42,7 +42,8 @@ class ExerciseRunCommand extends CommanderCommand {
private displayExecutionLogs() { private displayExecutionLogs() {
ora({ ora({
text: `${ chalk.magenta('Execution logs folder:') } ${ this.folderResultsVolume }`, indent: 0 text : `${ chalk.magenta('Execution logs folder:') } ${ this.folderResultsVolume }`,
indent: 0
}).start().info(); }).start().info();
} }
...@@ -66,13 +67,15 @@ class ExerciseRunCommand extends CommanderCommand { ...@@ -66,13 +67,15 @@ class ExerciseRunCommand extends CommanderCommand {
ora({ ora({
text: `Checking exercise content:`, indent: 4 text : `Checking exercise content:`,
indent: 4
}).start().info(); }).start().info();
// Exercise folder // Exercise folder
{ {
const spinner: ora.Ora = ora({ const spinner: ora.Ora = ora({
text: `Checking exercise folder`, indent: 8 text : `Checking exercise folder`,
indent: 8
}).start(); }).start();
const files = fs.readdirSync(options.path); const files = fs.readdirSync(options.path);
...@@ -89,7 +92,8 @@ class ExerciseRunCommand extends CommanderCommand { ...@@ -89,7 +92,8 @@ class ExerciseRunCommand extends CommanderCommand {
// dojo_assignment.json validity // dojo_assignment.json validity
{ {
const spinner: ora.Ora = ora({ const spinner: ora.Ora = ora({
text: `Checking ${ ClientsSharedConfig.assignment.filename } file`, indent: 8 text : `Checking ${ ClientsSharedConfig.assignment.filename } file`,
indent: 8
}).start(); }).start();
const validationResults = SharedAssignmentHelper.validateDescriptionFile(path.join(options.path, ClientsSharedConfig.assignment.filename)); const validationResults = SharedAssignmentHelper.validateDescriptionFile(path.join(options.path, ClientsSharedConfig.assignment.filename));
...@@ -108,7 +112,8 @@ class ExerciseRunCommand extends CommanderCommand { ...@@ -108,7 +112,8 @@ class ExerciseRunCommand extends CommanderCommand {
// Docker daemon // Docker daemon
{ {
const spinner: ora.Ora = ora({ const spinner: ora.Ora = ora({
text: `Checking Docker daemon`, indent: 4 text : `Checking Docker daemon`,
indent: 4
}).start(); }).start();
try { try {
...@@ -130,7 +135,7 @@ class ExerciseRunCommand extends CommanderCommand { ...@@ -130,7 +135,7 @@ class ExerciseRunCommand extends CommanderCommand {
let composeFileOverride: string[] = []; let composeFileOverride: string[] = [];
const composeOverridePath: string = path.join(localExercisePath, 'docker-compose-override.yml'); const composeOverridePath: string = path.join(localExercisePath, 'docker-compose-override.yml');
if ( haveResultsVolume ) { if ( haveResultsVolume ) {
const composeOverride = fs.readFileSync(path.join(__dirname, '../../../assets/docker-compose-override.yml'), 'utf8').replace('{{VOLUME_NAME}}', assignmentFile.result.volume!).replace('{{MOUNT_PATH}}', this.folderResultsExercise); const composeOverride = fs.readFileSync(path.join(__dirname, '../../../../assets/docker-compose-override.yml'), 'utf8').replace('{{VOLUME_NAME}}', assignmentFile.result.volume!).replace('{{MOUNT_PATH}}', this.folderResultsExercise);
fs.writeFileSync(composeOverridePath, composeOverride); fs.writeFileSync(composeOverridePath, composeOverride);
composeFileOverride = [ composeOverridePath ]; composeFileOverride = [ composeOverridePath ];
...@@ -152,7 +157,8 @@ class ExerciseRunCommand extends CommanderCommand { ...@@ -152,7 +157,8 @@ class ExerciseRunCommand extends CommanderCommand {
exerciseDockerCompose.events.on('step', (name: string, message: string) => { exerciseDockerCompose.events.on('step', (name: string, message: string) => {
spinner = ora({ spinner = ora({
text: message, indent: 4 text : message,
indent: 4
}).start(); }).start();
if ( options.verbose && name == 'COMPOSE_RUN' ) { if ( options.verbose && name == 'COMPOSE_RUN' ) {
...@@ -164,7 +170,8 @@ class ExerciseRunCommand extends CommanderCommand { ...@@ -164,7 +170,8 @@ class ExerciseRunCommand extends CommanderCommand {
if ( error ) { if ( error ) {
if ( options.verbose && stepName == 'COMPOSE_RUN' ) { if ( options.verbose && stepName == 'COMPOSE_RUN' ) {
ora({ ora({
text: message, indent: 4 text : message,
indent: 4
}).start().fail(); }).start().fail();
} else { } else {
spinner.fail(message); spinner.fail(message);
...@@ -172,7 +179,8 @@ class ExerciseRunCommand extends CommanderCommand { ...@@ -172,7 +179,8 @@ class ExerciseRunCommand extends CommanderCommand {
} else { } else {
if ( options.verbose && stepName == 'COMPOSE_RUN' ) { if ( options.verbose && stepName == 'COMPOSE_RUN' ) {
ora({ ora({
text: message, indent: 4 text : message,
indent: 4
}).start().succeed(); }).start().succeed();
} else { } else {
spinner.succeed(message); spinner.succeed(message);
...@@ -210,7 +218,8 @@ class ExerciseRunCommand extends CommanderCommand { ...@@ -210,7 +218,8 @@ class ExerciseRunCommand extends CommanderCommand {
exerciseResultsValidation.events.on('step', (name: string, message: string) => { exerciseResultsValidation.events.on('step', (name: string, message: string) => {
spinner = ora({ spinner = ora({
text: message, indent: 4 text : message,
indent: 4
}).start(); }).start();
}); });
...@@ -242,7 +251,9 @@ class ExerciseRunCommand extends CommanderCommand { ...@@ -242,7 +251,9 @@ class ExerciseRunCommand extends CommanderCommand {
// Step 4: Display results + Volume location // Step 4: Display results + Volume location
{ {
ClientsSharedExerciseHelper.displayExecutionResults(exerciseResultsValidation.exerciseResults!, exerciseDockerCompose.exitCode, { ClientsSharedExerciseHelper.displayExecutionResults(exerciseResultsValidation.exerciseResults!, exerciseDockerCompose.exitCode, {
INFO: chalk.bold, SUCCESS: chalk.green, FAILURE: chalk.red INFO : chalk.bold,
SUCCESS: chalk.green,
FAILURE: chalk.red
}, `\n\n${ chalk.bold('Execution results folder') } : ${ this.folderResultsVolume }`); }, `\n\n${ chalk.bold('Execution results folder') } : ${ this.folderResultsVolume }`);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment