<commit_before>#!/bin/bash

function show_usage_and_exit {
    echo ">> a tool for cleaning up local docker daemon

usage:
$(basename "$0") [--allow-failure] [--all] [--whitelist <image> ...]
where:
    --allow-failure   allows the docker commands to fail
    --all             clean everything from docker
    --whitelist       add an image to be whitelisted
    --help            prints this
"
    exit 1
}

set -e

whitelist=()
whitelist+=('instructure/ruby-passenger')
whitelist+=('starlord.inscloudgate.net/jenkins/canvas-lms:master')
whitelist+=('starlord.inscloudgate.net/jenkins/dynamodb-local')
whitelist+=('starlord.inscloudgate.net/jenkins/redis')
whitelist+=('starlord.inscloudgate.net/jenkins/cassandra')
whitelist+=('starlord.inscloudgate.net/jenkins/postgres')

ALLOW_FAILURE="0"
CLEAN_ALL="0"

while [[ $# -gt 0 ]]
do
key="$1"
case $key in
    --allow-failure)
    ALLOW_FAILURE="1"
    shift
    ;;
    --all)
    CLEAN_ALL="1"
    shift
    ;;
    --whitelist)
    whitelist+=("$2")
    shift
    shift
    ;;
    --help)<commit_msg>whitelist postgis in docker cleanup<commit_after>#!/bin/bash

function show_usage_and_exit {
    echo ">> a tool for cleaning up local docker daemon

usage:
$(basename "$0") [--allow-failure] [--all] [--whitelist <image> ...]
where:
    --allow-failure   allows the docker commands to fail
    --all             clean everything from docker
    --whitelist       add an image to be whitelisted
    --help            prints this
"
    exit 1
}

set -e

whitelist=()
whitelist+=('instructure/ruby-passenger')
whitelist+=('starlord.inscloudgate.net/jenkins/canvas-lms:master')
whitelist+=('starlord.inscloudgate.net/jenkins/dynamodb-local')
whitelist+=('starlord.inscloudgate.net/jenkins/redis')
whitelist+=('starlord.inscloudgate.net/jenkins/cassandra')
whitelist+=('starlord.inscloudgate.net/jenkins/postgis')

ALLOW_FAILURE="0"
CLEAN_ALL="0"

while [[ $# -gt 0 ]]
do
key="$1"
case $key in
    --allow-failure)
    ALLOW_FAILURE="1"
    shift
    ;;
    --all)
    CLEAN_ALL="1"
    shift
    ;;
    --whitelist)
    whitelist+=("$2")
    shift
    shift
    ;;
    --help)
{'fraction_non_alphanumeric': 0.15355628827131418, 'fraction_numerical': 0.008478568064060292, 'mean_word_length': 3.092485549132948, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '4650755', 'n_tokens_mistral': 797, 'n_tokens_neox': 774, 'n_words': 151}