<commit_before>#!/bin/bash
set -e

cp /opt/terraform/terraform /usr/local/bin

cd pcfawsops-terraform-state-get
  while read -r line
  do
    `echo "$line" | awk '{print "export "$1"="$3}'`
  done < <(terraform output)

  export AWS_ACCESS_KEY_ID=`terraform state show aws_iam_access_key.pcf_iam_user_access_key | grep ^id | awk '{print $3}'`
  export AWS_SECRET_ACCESS_KEY=`terraform state show aws_iam_access_key.pcf_iam_user_access_key | grep ^secret | awk '{print $3}'`
cd -

json_file="json_file/ert.json"

# Set JSON Config Template and inster Concourse Parameter Values

perl -pi -e "s/{{db_host}}/${db_host}/g" ${json_file}

perl -pi -e "s/{{aws_access_key}}/${AWS_ACCESS_KEY_ID}/g" ${json_file}
perl -pi -e "s%{{aws_secret_key}}%${AWS_SECRET_ACCESS_KEY}%g" ${json_file}
perl -pi -e "s/{{aws_region}}/${region}/g" ${json_file}
perl -pi -e "s%{{s3_endpoint}}%${S3_ENDPOINT}%g" ${json_file}
perl -pi -e "s/{{syslog_host}}/${SYSLOG_HOST}/g" ${json_file}<commit_msg>Remove perl from aws/run.sh<commit_after>#!/bin/bash
set -e

cp /opt/terraform/terraform /usr/local/bin

cd pcfawsops-terraform-state-get
  while read -r line
  do
    `echo "$line" | awk '{print "export "$1"="$3}'`
  done < <(terraform output)

  export AWS_ACCESS_KEY_ID=`terraform state show aws_iam_access_key.pcf_iam_user_access_key | grep ^id | awk '{print $3}'`
  export AWS_SECRET_ACCESS_KEY=`terraform state show aws_iam_access_key.pcf_iam_user_access_key | grep ^secret | awk '{print $3}'`
cd -

sed -i \
  -e "s/{{db_host}}/${db_host}/g" \
  -e "s/{{aws_access_key}}/${AWS_ACCESS_KEY_ID}/g" \
  -e "s%{{aws_secret_key}}%${AWS_SECRET_ACCESS_KEY}%g" \
  -e "s/{{aws_region}}/${region}/g" \
  -e "s%{{s3_endpoint}}%${S3_ENDPOINT}%g" \
  -e "s/{{syslog_host}}/${SYSLOG_HOST}/g" \
  json_file/ert.json
{'fraction_non_alphanumeric': 0.18345526167698367, 'fraction_numerical': 0.006752954417557681, 'mean_word_length': 4.810457516339869, 'pattern_counts': {'":': 0, '<': 7, '<?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': '5448719', 'n_tokens_mistral': 763, 'n_tokens_neox': 753, 'n_words': 143}