<commit_before>{
    "id": "ibm.devops.services.pipeline.appscan.static.builder",
    "version": 1,
    "name_key": "ExtName",
    "desc_key": "ExtDesc",
    "extension_type": "Build",
    "message_key": "ExtMessage",
    "inputs": [
        {
            "type": "Bluemix",
            "inclusion" : "always"
        }
    ],
    "params": [
        {
            "name": "SETUP_SERVICE_SPACE",
            "type": "Text",
            "required": "true",
            "default_value": "false",
            "label_key": "ACCEPT_KEY",
            "desc_key": "ACCEPT_DESC"
        },
        {
            "name": "WAIT_TIME",
            "type": "Text",
            "required": "false",
            "default_value": "5",
            "label_key": "WAIT_TIME_KEY",
            "desc_key": "WAIT_TIME_DESC"
        }
    ],
    "outputs": [
        {
            "type": "Artifacts",
            "inclusion" : "always"
        }
    ],
    "execution": {
        "type": "JenkinsDocker",
        "shell": "#!/bin/bash
set +x
set +e
export INIT_START_TIME=$(date +\"%s\")
export SETUP_SERVICE_SPACE=#SETUP_SERVICE_SPACE#
export WAIT_TIME=#WAIT_TIME#
# OSSC line
dpkg -l | grep '^ii' > $EXT_DIR/pkglist
. $EXT_DIR/_init.sh
# OSSC line
dpkg -l | grep '^ii' > $EXT_DIR/pkglist2
if [[ $DEBUG -eq 1 ]]; then
    diff $EXT_DIR/pkglist $EXT_DIR/pkglist2
fi
INIT_END_TIME=$(date +\"%s\")
export INIT_EST_TIME=$(($INIT_END_TIME-$INIT_START_TIME))
echo -e \"Init runtime of `date -u -d @\"$INIT_EST_TIME\" +\'%-Mm %-Ss\'`\"
echo -e \"${label_color}Starting build script${no_color}\"

# helper function to print the end time for this script
end_script_time() {
    SCRIPT_END_TIME=$(date +\"%s\")
    SCRIPT_EST_TIME=$(($SCRIPT_END_TIME-$INIT_END_TIME))
    echo -e \"Script runtime of `date -u -d @\"$SCRIPT_EST_TIME\" +\'%-Mm %-Ss\'`\"
}

# run the python IBM Security Static Analyzer checker, dump results on output
if [ -f ${EXT_DIR}/appscan_check.py ]; then 
    ${EXT_DIR}/appscan_check.py
    RESULT=$?

    if [ \"${ARCHIVE_DIR}\" == \"${WORKSPACE}\" ]; then 
        echo \"Achive directory, is the working directory\"
    else 
        echo \"Archive directory, is ${ARCHIVE_DIR}.  Copy all content to that directory\"
        pushd 
        #set to archive hidden directories and files with *
        shopt -s dotglob
        cd ${WORKSPACE}
        tar -cf source.tar *
        mv source.tar ${ARCHIVE_DIR}
        cd ${ARCHIVE_DIR}
        tar -xf source.tar 
        rm source.tar 
        #unset include hidden directories and files with *
        shopt -u dotglob
        popd <commit_msg>copy git metadata to ARCHIVE<commit_after>{
    "id": "ibm.devops.services.pipeline.appscan.static.builder",
    "version": 1,
    "name_key": "ExtName",
    "desc_key": "ExtDesc",
    "extension_type": "Build",
    "message_key": "ExtMessage",
    "inputs": [
        {
            "type": "Bluemix",
            "inclusion" : "always"
        }
    ],
    "params": [
        {
            "name": "SETUP_SERVICE_SPACE",
            "type": "Text",
            "required": "true",
            "default_value": "false",
            "label_key": "ACCEPT_KEY",
            "desc_key": "ACCEPT_DESC"
        },
        {
            "name": "WAIT_TIME",
            "type": "Text",
            "required": "false",
            "default_value": "5",
            "label_key": "WAIT_TIME_KEY",
            "desc_key": "WAIT_TIME_DESC"
        }
    ],
    "outputs": [
        {
            "type": "Artifacts",
            "inclusion" : "always"
        }
    ],
    "execution": {
        "type": "JenkinsDocker",
        "shell": "#!/bin/bash
set +x
set +e
export INIT_START_TIME=$(date +\"%s\")
export SETUP_SERVICE_SPACE=#SETUP_SERVICE_SPACE#
export WAIT_TIME=#WAIT_TIME#
# OSSC line
dpkg -l | grep '^ii' > $EXT_DIR/pkglist
. $EXT_DIR/_init.sh
# OSSC line
dpkg -l | grep '^ii' > $EXT_DIR/pkglist2
if [[ $DEBUG -eq 1 ]]; then
    diff $EXT_DIR/pkglist $EXT_DIR/pkglist2
fi
INIT_END_TIME=$(date +\"%s\")
export INIT_EST_TIME=$(($INIT_END_TIME-$INIT_START_TIME))
echo -e \"Init runtime of `date -u -d @\"$INIT_EST_TIME\" +\'%-Mm %-Ss\'`\"
echo -e \"${label_color}Starting build script${no_color}\"

# helper function to print the end time for this script
end_script_time() {
    SCRIPT_END_TIME=$(date +\"%s\")
    SCRIPT_EST_TIME=$(($SCRIPT_END_TIME-$INIT_END_TIME))
    echo -e \"Script runtime of `date -u -d @\"$SCRIPT_EST_TIME\" +\'%-Mm %-Ss\'`\"
}

# run the python IBM Security Static Analyzer checker, dump results on output
if [ -f ${EXT_DIR}/appscan_check.py ]; then 
    ${EXT_DIR}/appscan_check.py
    RESULT=$?

    if [ \"${ARCHIVE_DIR}\" == \"${WORKSPACE}\" ]; then 
        echo \"Achive directory, is the working directory\"
    else 
        echo \"Archive directory, is ${ARCHIVE_DIR}.  Copy all content to that directory\"
        pushd ${WORKSPACE} &> /dev/null
        # also copy .git metadata
        if [ -d .git ]; then
            tar -cf source.tar * .git
        else
            tar -cf source.tar *
        fi
        mv source.tar ${ARCHIVE_DIR}
        cd ${ARCHIVE_DIR}
        tar -xf source.tar 
        rm source.tar 
        popd &> /dev/null
{'fraction_non_alphanumeric': 0.16047231900890438, 'fraction_numerical': 0.0019357336430507162, 'mean_word_length': 2.1914762198888202, 'pattern_counts': {'":': 52, '<': 3, '<?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': '294462', 'n_tokens_mistral': 1820, 'n_tokens_neox': 1778, 'n_words': 422}