<commit_before>#!/usr/bin/env bash

# This script will run packer to create an AMI for use as a Jenkins worker

if [ -z "${JENKINS_WORKER_AMI}" ]; then
JENKINS_WORKER_AMI=$(aws ec2 describe-images \
                     --region us-east-1 \
                     --owners 099720109477 \
                     --filters 'Name=name,Values=ubuntu/images/hvm-ssd/ubuntu-xenial-16.04-amd64*' \
                     --query 'sort_by(Images,&CreationDate)[-1].ImageId' \
                     --output text)
fi

export TEST_PLATFORM_VERSION=${PLATFORM_VERSION}

# Variable is used for tagging the AMI
export DELETE_OR_KEEP_AMI=${DELETE_OR_KEEP}

# Variable is used for installing and setting NewRelic agent on workers
export NEW_RELIC_KEY=${NEW_RELIC_KEY}

# Activate the Python virtualenv
. $HOME/edx-venv/bin/activate

cd util/packer
echo $PWD
packer build $PACKER_JSON<commit_msg>Add missing variable export<commit_after>#!/usr/bin/env bash

# This script will run packer to create an AMI for use as a Jenkins worker

if [ -z "${JENKINS_WORKER_AMI}" ]; then
export JENKINS_WORKER_AMI=$(aws ec2 describe-images \
    --region us-east-1 \
    --owners 099720109477 \
    --filters 'Name=name,Values=ubuntu/images/hvm-ssd/ubuntu-xenial-16.04-amd64*' \
    --query 'sort_by(Images,&CreationDate)[-1].ImageId' \
    --output text)
fi

export TEST_PLATFORM_VERSION=${PLATFORM_VERSION}

# Variable is used for tagging the AMI
export DELETE_OR_KEEP_AMI=${DELETE_OR_KEEP}

# Variable is used for installing and setting NewRelic agent on workers
export NEW_RELIC_KEY=${NEW_RELIC_KEY}

# Activate the Python virtualenv
. $HOME/edx-venv/bin/activate

cd util/packer
echo $PWD
packer build $PACKER_JSON
{'fraction_non_alphanumeric': 0.10463733650416171, 'fraction_numerical': 0.02497027348394768, 'mean_word_length': 3.3828125, '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': '2122793', 'n_tokens_mistral': 622, 'n_tokens_neox': 572, 'n_words': 145}