<commit_before>#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

set -e
RED='\033[0;31m'
NC='\033[0m' # No Color

export TF_VAR_name="$2"
export TF_VAR_internal_tld=${TF_VAR_name}.cncf.demo
export TF_VAR_data_dir=${DIR}/data/${TF_VAR_name}
# tfstate, sslcerts, and ssh keys are currently stored in TF_VAR_data_dir
mkdir -p $TF_VAR_data_dir
cd $TF_VAR_data_dir
 
# Run CMD
if [ "$1" = "aws-deploy" ] ; then
    terraform get ${DIR}/aws && \
        terraform apply -target null_resource.ssl_gen ${DIR}/aws && \
        time terraform apply ${DIR}/aws && \
        printf "${RED}\n#Commands to Configue Kubectl \n\n" && \
        printf 'sudo chown -R $(whoami):$(whoami) $(pwd)/data/ \n\n' && \
        printf 'export KUBECONFIG=$(pwd)/data/kubeconfig \n\n'${NC}
elif [ "$1" = "aws-destroy" ] ; then
    time terraform destroy -force ${DIR}/aws
elif [ "$1" = "azure-deploy" ] ; then
    # There are some dependency issues around cert,sshkey,k8s_cloud_config, and dns
    # since they use files on disk that are created on the fly
    # should probably move these to data resources
    terraform get ${DIR}/azure && \
        terraform apply -target null_resource.ssl_ssh_cloud_gen ${DIR}/cross-cloud && \
        terraform apply -target null_resource.dns_gen ${DIR}/azure && \
        time terraform apply ${DIR}/azure && \
        printf "${RED}\n#Commands to Configue Kubectl \n\n" && \
        printf 'sudo chown -R $(whoami):$(whoami) $(pwd)/data/${name} \n\n' && \
        printf 'export KUBECONFIG=$(pwd)/data/${name}/kubeconfig \n\n'${NC}
elif [ "$1" = "azure-destroy" ] ; then
    time terraform destroy -force ${DIR}/azure
elif [ "$1" = "packet-deploy" ] ; then
    terraform get ${DIR}/packet && \
        terraform apply -target module.etcd.null_resource.discovery_gen ${DIR}/packet && \
        terraform apply -target null_resource.ssl_ssh_gen ${DIR}/packet && \
        time terraform apply ${DIR}/packet && \
        printf "${RED}\n#Commands to Configue Kubectl \n\n" && \
        printf 'sudo chown -R $(whoami):$(whoami) $(pwd)/data/${name} \n\n' && \
        printf 'export KUBECONFIG=$(pwd)/data/${name}/kubeconfig \n\n'${NC}
elif [ "$1" = "packet-destroy" ] ; then
    time terraform destroy -force ${DIR}/packet
elif [ "$1" = "gce-deploy" ] ; then
    terraform get ${DIR}/gce && \
        terraform apply -target module.etcd.null_resource.discovery_gen ${DIR}/gce && \
        terraform apply -target null_resource.ssl_gen ${DIR}/gce && \
        time terraform apply ${DIR}/gce && \
        printf "${RED}\n#Commands to Configue Kubectl \n\n" && \
        printf 'sudo chown -R $(whoami):$(whoami) $(pwd)/data/${name} \n\n' && \
        printf 'export KUBECONFIG=$(pwd)/data/${name}/kubeconfig \n\n'${NC}
elif [ "$1" = "gce-destroy" ] ; then
    time terraform destroy -force ${DIR}/gce
elif [ "$1" = "gke-deploy" ] ; then
    terraform get ${DIR}/gke && \
    terraform apply -target module.vpc ${DIR}/gke && \
        time terraform apply ${DIR}/gke
elif [ "$1" = "gke-destroy" ] ; then
    terraform get ${DIR}/gke && \
    terraform destroy -force -target module.cluster.google_container_node_pool.cncf ${DIR}/gke && \
    terraform destroy -force -target module.cluster.google_container.cncf ${DIR}/gke && \
    time terraform destroy -force ${DIR}/gke
    <commit_msg>Sleep for 10 on Destroy<commit_after>#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

set -e
RED='\033[0;31m'
NC='\033[0m' # No Color

export TF_VAR_name="$2"
export TF_VAR_internal_tld=${TF_VAR_name}.cncf.demo
export TF_VAR_data_dir=${DIR}/data/${TF_VAR_name}
# tfstate, sslcerts, and ssh keys are currently stored in TF_VAR_data_dir
mkdir -p $TF_VAR_data_dir
cd $TF_VAR_data_dir
 
# Run CMD
if [ "$1" = "aws-deploy" ] ; then
    terraform get ${DIR}/aws && \
        terraform apply -target null_resource.ssl_gen ${DIR}/aws && \
        time terraform apply ${DIR}/aws && \
        printf "${RED}\n#Commands to Configue Kubectl \n\n" && \
        printf 'sudo chown -R $(whoami):$(whoami) $(pwd)/data/ \n\n' && \
        printf 'export KUBECONFIG=$(pwd)/data/kubeconfig \n\n'${NC}
elif [ "$1" = "aws-destroy" ] ; then
    time terraform destroy -force ${DIR}/aws
elif [ "$1" = "azure-deploy" ] ; then
    # There are some dependency issues around cert,sshkey,k8s_cloud_config, and dns
    # since they use files on disk that are created on the fly
    # should probably move these to data resources
    terraform get ${DIR}/azure && \
        terraform apply -target null_resource.ssl_ssh_cloud_gen ${DIR}/cross-cloud && \
        terraform apply -target null_resource.dns_gen ${DIR}/azure && \
        time terraform apply ${DIR}/azure && \
        printf "${RED}\n#Commands to Configue Kubectl \n\n" && \
        printf 'sudo chown -R $(whoami):$(whoami) $(pwd)/data/${name} \n\n' && \
        printf 'export KUBECONFIG=$(pwd)/data/${name}/kubeconfig \n\n'${NC}
elif [ "$1" = "azure-destroy" ] ; then
    time terraform destroy -force ${DIR}/azure
elif [ "$1" = "packet-deploy" ] ; then
    terraform get ${DIR}/packet && \
        terraform apply -target module.etcd.null_resource.discovery_gen ${DIR}/packet && \
        terraform apply -target null_resource.ssl_ssh_gen ${DIR}/packet && \
        time terraform apply ${DIR}/packet && \
        printf "${RED}\n#Commands to Configue Kubectl \n\n" && \
        printf 'sudo chown -R $(whoami):$(whoami) $(pwd)/data/${name} \n\n' && \
        printf 'export KUBECONFIG=$(pwd)/data/${name}/kubeconfig \n\n'${NC}
elif [ "$1" = "packet-destroy" ] ; then
    time terraform destroy -force ${DIR}/packet
elif [ "$1" = "gce-deploy" ] ; then
    terraform get ${DIR}/gce && \
        terraform apply -target module.etcd.null_resource.discovery_gen ${DIR}/gce && \
        terraform apply -target null_resource.ssl_gen ${DIR}/gce && \
        time terraform apply ${DIR}/gce && \
        printf "${RED}\n#Commands to Configue Kubectl \n\n" && \
        printf 'sudo chown -R $(whoami):$(whoami) $(pwd)/data/${name} \n\n' && \
        printf 'export KUBECONFIG=$(pwd)/data/${name}/kubeconfig \n\n'${NC}
elif [ "$1" = "gce-destroy" ] ; then
    time terraform destroy -force ${DIR}/gce
elif [ "$1" = "gke-deploy" ] ; then
    terraform get ${DIR}/gke && \
    terraform apply -target module.vpc ${DIR}/gke && \
        time terraform apply ${DIR}/gke
elif [ "$1" = "gke-destroy" ] ; then
    terraform get ${DIR}/gke && \
    terraform destroy -force -target module.cluster.google_container_node_pool.cncf ${DIR}/gke && \
    terraform destroy -force -target module.cluster.google_container.cncf ${DIR}/gke && \
    sleep 10 && \
    time terraform destroy -force ${DIR}/gke
    
{'fraction_non_alphanumeric': 0.1725225225225225, 'fraction_numerical': 0.0075075075075075074, 'mean_word_length': 3.0223429951690823, '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': '2728121', 'n_tokens_mistral': 2325, 'n_tokens_neox': 2335, 'n_words': 578}