<commit_before>#!/bin/bash

#********************************************************************************
# Copyright 2015 IBM
#
#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#********************************************************************************

# uncomment the next line to debug this script
#set -x

debugme() {
  [[ $DEBUG = 1 ]] && "$@" || :
}

###########################################################
# Install the IBM Containers plug-in (cf ic)              #
#                                                         #
###########################################################
install_cf_ic() {

    debugme echo "installing docker"
    sudo apt-get -y install docker.io &> /dev/null
    local RESULT=$?
    if [ $RESULT -ne 0 ]; then
        log_and_echo "$ERROR" "'Installing docker failed with return code ${RESULT}"
        return 1
    fi
    DOCKER_VER=$(docker -v)
    log_and_echo "$LABEL" "Successfully installed ${DOCKER_VER}"

    pushd $EXT_DIR

    EXT_DIR_CF_VER=$($EXT_DIR/cf -v)
    log_and_echo "$LABEL" "New cf version: ${EXT_DIR_CF_VER}"

    debugme echo "wget of ic plugin"
    wget https://static-ice.ng.bluemix.net/ibm-containers-linux_x64 &> /dev/null
    chmod 755 $EXT_DIR/ibm-containers-linux_x64

    debugme echo "Installing IBM Containers plugin (cf ic)"
    $EXT_DIR/cf install-plugin -f $EXT_DIR/ibm-containers-linux_x64 &> /dev/null
    cf install-plugin -f $EXT_DIR/ibm-containers-linux_x64 &> /dev/null
    local RESULT=$?
    if [ $RESULT -ne 0 ]; then 
        log_and_echo "$ERROR" "'Installing IBM Containers plug-in (cf ic) failed with return code ${RESULT}"
        ${EXT_DIR}/print_help.sh
        ${EXT_DIR}/utilities/sendMessage.sh -l bad -m "Failed to install IBM Containers plug-in (cf ic). $(get_error_info)"<commit_msg>support cf ic<commit_after>#!/bin/bash

#********************************************************************************
# Copyright 2015 IBM
#
#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#********************************************************************************

# uncomment the next line to debug this script
#set -x

debugme() {
  [[ $DEBUG = 1 ]] && "$@" || :
}

###########################################################
# Install the IBM Containers plug-in (cf ic)              #
#                                                         #
###########################################################
install_cf_ic() {

    debugme echo "installing docker"
    sudo apt-get -y install docker.io &> /dev/null
    local RESULT=$?
    if [ $RESULT -ne 0 ]; then
        log_and_echo "$ERROR" "'Installing docker failed with return code ${RESULT}"
        return 1
    fi
    DOCKER_VER=$(docker -v)
    log_and_echo "$LABEL" "Successfully installed ${DOCKER_VER}"

    pushd $EXT_DIR

    EXT_DIR_CF_VER=$($EXT_DIR/cf -v)
    log_and_echo "$LABEL" "New cf version: ${EXT_DIR_CF_VER}"

    debugme echo "wget of ic plugin"
    wget https://static-ice.ng.bluemix.net/ibm-containers-linux_x64 &> /dev/null
    chmod 755 $EXT_DIR/ibm-containers-linux_x64

    debugme echo "Installing IBM Containers plugin (cf ic)"
    $EXT_DIR/cf install-plugin -f $EXT_DIR/ibm-containers-linux_x64
    cf install-plugin -f $EXT_DIR/ibm-containers-linux_x64
    local RESULT=$?
    if [ $RESULT -ne 0 ]; then 
        log_and_echo "$ERROR" "'Installing IBM Containers plug-in (cf ic) failed with return code ${RESULT}"
        ${EXT_DIR}/print_help.sh
        ${EXT_DIR}/utilities/sendMessage.sh -l bad -m "Failed to install IBM Containers plug-in (cf ic). $(get_error_info)"
{'fraction_non_alphanumeric': 0.2184873949579832, 'fraction_numerical': 0.010172490048651039, 'mean_word_length': 3.3532242540904718, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1114663', 'n_tokens_mistral': 1347, 'n_tokens_neox': 1278, 'n_words': 417}