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

Merge branch 'v3.0.1' into main

parents ebdaa2b6 a15f6b79
No related branches found
No related tags found
No related merge requests found
Pipeline #26847 passed
{
"name" : "dojo_cli",
"description" : "CLI of the Dojo project",
"version" : "3.0.0",
"version" : "3.0.1",
"license" : "AGPLv3",
"author" : "Michaël Minelli <dojo@minelli.me>",
"main" : "dist/app.js",
......
......@@ -42,7 +42,8 @@ class ExerciseRunCommand extends CommanderCommand {
private displayExecutionLogs() {
ora({
text: `${ chalk.magenta('Execution logs folder:') } ${ this.folderResultsVolume }`, indent: 0
text : `${ chalk.magenta('Execution logs folder:') } ${ this.folderResultsVolume }`,
indent: 0
}).start().info();
}
......@@ -66,13 +67,15 @@ class ExerciseRunCommand extends CommanderCommand {
ora({
text: `Checking exercise content:`, indent: 4
text : `Checking exercise content:`,
indent: 4
}).start().info();
// Exercise folder
{
const spinner: ora.Ora = ora({
text: `Checking exercise folder`, indent: 8
text : `Checking exercise folder`,
indent: 8
}).start();
const files = fs.readdirSync(options.path);
......@@ -89,7 +92,8 @@ class ExerciseRunCommand extends CommanderCommand {
// dojo_assignment.json validity
{
const spinner: ora.Ora = ora({
text: `Checking ${ ClientsSharedConfig.assignment.filename } file`, indent: 8
text : `Checking ${ ClientsSharedConfig.assignment.filename } file`,
indent: 8
}).start();
const validationResults = SharedAssignmentHelper.validateDescriptionFile(path.join(options.path, ClientsSharedConfig.assignment.filename));
......@@ -108,7 +112,8 @@ class ExerciseRunCommand extends CommanderCommand {
// Docker daemon
{
const spinner: ora.Ora = ora({
text: `Checking Docker daemon`, indent: 4
text : `Checking Docker daemon`,
indent: 4
}).start();
try {
......@@ -130,7 +135,7 @@ class ExerciseRunCommand extends CommanderCommand {
let composeFileOverride: string[] = [];
const composeOverridePath: string = path.join(localExercisePath, 'docker-compose-override.yml');
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);
composeFileOverride = [ composeOverridePath ];
......@@ -152,7 +157,8 @@ class ExerciseRunCommand extends CommanderCommand {
exerciseDockerCompose.events.on('step', (name: string, message: string) => {
spinner = ora({
text: message, indent: 4
text : message,
indent: 4
}).start();
if ( options.verbose && name == 'COMPOSE_RUN' ) {
......@@ -164,7 +170,8 @@ class ExerciseRunCommand extends CommanderCommand {
if ( error ) {
if ( options.verbose && stepName == 'COMPOSE_RUN' ) {
ora({
text: message, indent: 4
text : message,
indent: 4
}).start().fail();
} else {
spinner.fail(message);
......@@ -172,7 +179,8 @@ class ExerciseRunCommand extends CommanderCommand {
} else {
if ( options.verbose && stepName == 'COMPOSE_RUN' ) {
ora({
text: message, indent: 4
text : message,
indent: 4
}).start().succeed();
} else {
spinner.succeed(message);
......@@ -210,7 +218,8 @@ class ExerciseRunCommand extends CommanderCommand {
exerciseResultsValidation.events.on('step', (name: string, message: string) => {
spinner = ora({
text: message, indent: 4
text : message,
indent: 4
}).start();
});
......@@ -242,7 +251,9 @@ class ExerciseRunCommand extends CommanderCommand {
// Step 4: Display results + Volume location
{
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 }`);
}
}
......
Subproject commit dc12d17660bf9e92656c6abcb24ec7ce6ab3d675
Subproject commit 39ababf437cd738b45e07743455be7588640d5c9
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment