<commit_before>var docker = require('./lib/docker'),
    util = require('./lib/util'),
    config = require('./lib/config'),
    opts = require("nomnom")
        .options({
            push: {
                abbr: 'p',
                flag: true,
                help: 'Provide if image should be pushed after being built'
            },
            base: {
                abbr: 'b',
                flag: true,
                help: 'True if the base image should be built first'
            },
            version: {
                abbr: 'v',
                flag: true,
                help: 'Print version and exit',
                callback: function () {
                    return config.version
                }
            }
        })
        .help('This utility will rebuild the docker image for the latest version')
        .parse();


docker.imageChain(opts._, function(name, image, next, end)
{
    console.log("Name = " + name);
    console.log("Building " + image);

    docker.build(name, image, function (code)
    {
        console.log('Image name = ' + image);

        if (opts.push)
        {
            console.log('Pushing image ' + image + ' ...');

            docker.push(image, function (code)
            {
                console.log('Pushed ' + image);
                next();
            });
        }
        else
        {
            next();
        }
    });
}).run(function()
{
    // cleanup any resources
//    util.pipeSpawn('sh', ['setup/cleanup.sh']);
});


<commit_msg>removed "base" build option. Should either be built first manually or specified within a named list<commit_after>var docker = require('./lib/docker'),
    util = require('./lib/util'),
    config = require('./lib/config'),
    opts = require("nomnom")
        .options({
            push: {
                abbr: 'p',
                flag: true,
                help: 'Provide if image should be pushed after being built'
            },
            version: {
                abbr: 'v',
                flag: true,
                help: 'Print version and exit',
                callback: function () {
                    return config.version
                }
            }
        })
        .help('This utility will rebuild the docker image for the latest version')
        .parse();


docker.imageChain(opts._, function(name, image, next, end)
{
    console.log("Name = " + name);
    console.log("Building " + image);

    docker.build(name, image, function (code)
    {
        console.log('Image name = ' + image);

        if (opts.push)
        {
            console.log('Pushing image ' + image + ' ...');

            docker.push(image, function (code)
            {
                console.log('Pushed ' + image);
                next();
            });
        }
        else
        {
            next();
        }
    });
}).run(function()
{
    // cleanup any resources
//    util.pipeSpawn('sh', ['setup/cleanup.sh']);
});



{'fraction_non_alphanumeric': 0.13576494427558258, 'fraction_numerical': 0.0, 'mean_word_length': 1.332283464566929, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '269143', 'n_tokens_mistral': 813, 'n_tokens_neox': 763, 'n_words': 202}