Example #1
0
	files.forEach( function(file) {

		var job = require('./.idea/logs/' + file);

		try {
			job.stepName = job.log.match(/(Step:)(.*)(\n)?/)[2];
		} catch (e) {
			job.stepName = 'UnknownStepName'
		}

		if (job.log.match(/(FAIL|ERROR)/i)) {
			job.success = false;
		} else {
			job.success = true;
		}

		try {
			job.jobName = job.log.match(/(Parent Job Name: )(.*)(\n)?/)[2];
		} catch (e) {
			job.jobName = 'UnknownJobName'
		}

		try {
			job.createdTimestamp = job.log.match(/\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}/)[0];
			job.createdTimestamp = new Date(job.createdTimestamp).getTime();
		} catch (e) {
			console.log(e.msg);
		}

		postThatShit(job);

	})