Strider-CD/strider

View on GitHub
apps/strider/dist-lib/cli/commands/prune-jobs.js

Summary

Maintainability
C
1 day
Test Coverage
'use strict';
module.exports = function (deps, parser) {
    const pruneJobs = require('../lib/prune-jobs')(deps);
    parser
        .command('pruneJobs')
        .option('project', {
        abbr: 'p',
        help: 'Project to target, defaults to all projects if not specified',
    })
        .option('keepJobs', {
        abbr: 'k',
        help: 'Number of latest jobs to keep',
        default: 20,
    })
        .option('dryRun', {
        abbr: 'd',
        help: 'Just print stats about what will be removed, but do not remove any jobs',
        flag: true,
        default: false,
    })
        .callback(function (opts) {
        deps.connect(function (err) {
            if (err) {
                throw err;
            }
            pruneJobs(opts.keepJobs, opts.project, opts.dryRun);
        });
    })
        .help('Cleanup all jobs except for the latest 20 or custom');
};
//# sourceMappingURL=prune-jobs.js.map