<commit_before>#!/bin/bash
set -exo pipefail

PROJECT=/go/src/github.com/coreos/tectonic-installer

export PLATFORM=aws
export CLUSTER="tf-${PLATFORM}-${BUILD_ID}"
export TF_VAR_tectonic_pull_secret_path=${TF_VAR_tectonic_pull_secret_path}
export TF_VAR_tectonic_license_path=${TF_VAR_tectonic_license_path}
export TECTONIC_BUILDER=quay.io/coreos/tectonic-builder:v1.18
export KUBE_CONFORMANCE=quay.io/coreos/kube-conformance:v1.6.2_coreos.0

# Create an env var file
cat <<EOF >> env.list
PLATFORM=aws
CLUSTER="tf-${PLATFORM}-${BUILD_ID}"
TF_VAR_tectonic_cluster_name=$(echo "${CLUSTER}" | awk '{print tolower($0)}')
AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
TF_VAR_tectonic_aws_region="us-west-2"
TF_VAR_tectonic_pull_secret_path=${TF_VAR_tectonic_pull_secret_path}
TF_VAR_tectonic_license_path=${TF_VAR_tectonic_license_path}
TF_VAR_tectonic_aws_ssh_key="jenkins"
EOF

# Mount secret command for docker run
MNT_SECRETS="-v ${TF_VAR_tectonic_license_path}:${TF_VAR_tectonic_license_path} -v ${TF_VAR_tectonic_pull_secret_path}:${TF_VAR_tectonic_pull_secret_path}"

function cleanup() {
    docker run --env-file ./env.list -i -v "${WORKSPACE}":"${PROJECT}" "${MNT_SECRETS}" "${TECTONIC_BUILDER}" /bin/bash <<EOF
cd ${PROJECT}
make destroy
EOF
}
# Trap to ensure cluster clean up before exit
trap cleanup EXIT

export KUBECTL=${WORKSPACE}/kubectl
curl -o "${KUBECTL}" https://storage.googleapis.com/kubernetes-release/release/v1.6.3/bin/linux/amd64/kubectl && chmod +x "${KUBECTL}"

function kubectl() {
    local i=0

    echo "Executing kubectl" "$@"
    while true; do
        (( i++ )) && (( i == 100 )) && echo "kubectl failed, giving up" && exit 1

        set +e
        out=$($KUBECTL "$@" 2>&1)
        status=$?
        set -e
  <commit_msg>tests/conformance: remove double quotes for docker run command<commit_after>#!/bin/bash
set -exo pipefail

PROJECT=/go/src/github.com/coreos/tectonic-installer

export PLATFORM=aws
export CLUSTER="tf-${PLATFORM}-${BUILD_ID}"
export TF_VAR_tectonic_pull_secret_path=${TF_VAR_tectonic_pull_secret_path}
export TF_VAR_tectonic_license_path=${TF_VAR_tectonic_license_path}
export TECTONIC_BUILDER=quay.io/coreos/tectonic-builder:v1.18
export KUBE_CONFORMANCE=quay.io/coreos/kube-conformance:v1.6.2_coreos.0

# Create an env var file
cat <<EOF >> env.list
PLATFORM=aws
CLUSTER="tf-${PLATFORM}-${BUILD_ID}"
TF_VAR_tectonic_cluster_name=$(echo "${CLUSTER}" | awk '{print tolower($0)}')
AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
TF_VAR_tectonic_aws_region="us-west-2"
TF_VAR_tectonic_pull_secret_path=${TF_VAR_tectonic_pull_secret_path}
TF_VAR_tectonic_license_path=${TF_VAR_tectonic_license_path}
TF_VAR_tectonic_aws_ssh_key="jenkins"
EOF

# Mount secret command for docker run
MNT_SECRETS="-v ${TF_VAR_tectonic_license_path}:${TF_VAR_tectonic_license_path} -v ${TF_VAR_tectonic_pull_secret_path}:${TF_VAR_tectonic_pull_secret_path}"

function cleanup() {
    # shellcheck disable=SC2086
    docker run --env-file ./env.list -i -v ${WORKSPACE}:${PROJECT} ${MNT_SECRETS} ${TECTONIC_BUILDER} /bin/bash <<EOF
cd ${PROJECT}
make destroy
EOF
}
# Trap to ensure cluster clean up before exit
trap cleanup EXIT

export KUBECTL=${WORKSPACE}/kubectl
curl -o "${KUBECTL}" https://storage.googleapis.com/kubernetes-release/release/v1.6.3/bin/linux/amd64/kubectl && chmod +x "${KUBECTL}"

function kubectl() {
    local i=0

    echo "Executing kubectl" "$@"
    while true; do
        (( i++ )) && (( i == 100 )) && echo "kubectl failed, giving up" && exit 1

        set +e
        out=$($KUBECTL "$@" 2>&1)
        status=$?
        set -e
  
{'fraction_non_alphanumeric': 0.13751705320600272, 'fraction_numerical': 0.012551159618008186, 'mean_word_length': 5.890977443609023, 'pattern_counts': {'":': 1, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 2, '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': '4491108', 'n_tokens_mistral': 1488, 'n_tokens_neox': 1452, 'n_words': 237}