Updated scripts and travis to handle cron jobs properly

This commit is contained in:
Angelos Chalaris
2018-01-02 21:20:22 +02:00
parent fb57e9c4be
commit f0b2cb7f9c
6 changed files with 28 additions and 6 deletions

View File

@ -8,8 +8,8 @@ const path = require('path');
const chalk = require('chalk');
// Load helper functions (these are from existing snippets in 30 seconds of code!)
const isTravisCI = () => 'TRAVIS' in process.env && 'CI' in process.env;
if(isTravisCI() && process.env['TRAVIS_EVENT_TYPE'] !== 'cron') {
console.log(`${chalk.green('NOBUILD')} Build terminated, not a cron job!`);
if(isTravisCI() && (process.env['TRAVIS_EVENT_TYPE'] !== 'cron' || process.env['TRAVIS_EVENT_TYPE'] !== 'api')) {
console.log(`${chalk.green('NOBUILD')} Module build terminated, not a cron job or a custom build!`);
process.exit(0);
}
// Set variables for paths