<commit_before>#
# deployspec.yml
#

version: 0.2

env:
  variables:
    terraform_version: 1.0.7

phases:
  install:
    runtime-versions:
      golang: 1.15
    commands:
     # update
      - apt-get update -y
      - apt-get install -y ansible
      - wget https://releases.hashicorp.com/terraform/${terraform_version}/terraform_${terraform_version}_linux_amd64.zip
      - unzip terraform_${terraform_version}_linux_amd64.zip
      - mv terraform /usr/local/bin

  pre_build:
    commands:
      - latest_build=$(aws --region=$AWS_REGION ssm get-parameter --name /containers/$CONTAINER_IMAGE/latest | grep "Value" | awk -F\" '{print $4}')
      - git clone https://$GITLAB_USER:$GITLAB_TOKEN@gitlab.com/uvalib/terraform-infrastructure.git

  build:
    commands:
      - cd $CODEBUILD_SRC_DIR/terraform-infrastructure/avalon.lib.virginia.edu/staging
      - terraform init -no-color
      - AMI=$(terraform output instance_ami | tr -d "\"")
      - echo "AMI: $AMI"
      - |
        if [ -z "$AMI" ]; then
           echo "ERROR: cannot determine instance AMI"
           exit 1
        fi
      - terraform apply -auto-approve -no-color -var instance_ami="$AMI" --target=local_file.inventory --target=local_file.tfvars
      - cd ansible
      - ansible-playbook undeploy-backend.yml


#  post_build:
#    commands:

#
# end of file
#<commit_msg>Trying to get the deploy to work<commit_after>#
# deployspec.yml
#

version: 0.2

env:
  variables:
    terraform_version: 1.0.7

phases:
  install:
    runtime-versions:
      golang: 1.15
    commands:
      - apt-get update -y
      - apt-get install -y ansible
      - wget https://releases.hashicorp.com/terraform/${terraform_version}/terraform_${terraform_version}_linux_amd64.zip
      - unzip terraform_${terraform_version}_linux_amd64.zip
      - mv terraform /usr/local/bin

  pre_build:
    commands:
      - latest_build=$(aws --region=$AWS_REGION ssm get-parameter --name /containers/$CONTAINER_IMAGE/latest | grep "Value" | awk -F\" '{print $4}')
      - git clone https://$GITLAB_USER:$GITLAB_TOKEN@gitlab.com/uvalib/terraform-infrastructure.git

  build:
    commands:
      - cd $CODEBUILD_SRC_DIR/terraform-infrastructure/avalon.lib.virginia.edu/staging
      - terraform init -no-color
      - AMI=$(terraform output instance_ami | tr -d "\"")
      - echo "AMI: $AMI"
      #- |
      #  if [ -z "$AMI" ]; then
      #     echo "ERROR: cannot determine instance AMI"
      #     exit 1
      #  fi
      #- terraform apply -auto-approve -no-color -var instance_ami="$AMI" --target=local_file.inventory --target=local_file.tfvars
      #- cd ansible
      #- ansible-playbook undeploy-backend.yml

#  post_build:
#    commands:

#
# end of file
#
{'fraction_non_alphanumeric': 0.12619573215599705, 'fraction_numerical': 0.010301692420897719, 'mean_word_length': 2.591809775429326, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '479346', 'n_tokens_mistral': 977, 'n_tokens_neox': 969, 'n_words': 189}