<commit_before>version: 0.1
environment_variables:
  plaintext:
    BUILD_PHASE_MARKER: build_phase_complete
phases:
  install:
    commands:
      - apt-get update -y
      - apt-get install -y jq docker-compose
  pre_build:
    commands:
      - echo Logging in to Amazon ECR...
      - $(aws ecr get-login --region $ECR_REGION)
  build:
    commands:
      - docker build -t $ECR_REPOSITORY_NAME:$((ECR_IMAGE_TAG+1)) .
      - docker tag $ECR_REPOSITORY_NAME:$((ECR_IMAGE_TAG+1)) $AWS_ACCOUNT_ID.dkr.ecr.$ECR_REGION.amazonaws.com/$ECR_REPOSITORY_NAME:$((ECR_IMAGE_TAG+1))
      - echo "CODECOV_TOKEN=$CODECOV_TOKEN" >> .env
      - docker-compose run publish ci
      - touch $BUILD_PHASE_MARKER
  post_build:
    commands:
      - test -e $BUILD_PHASE_MARKER
      - docker push $AWS_ACCOUNT_ID.dkr.ecr.$ECR_REGION.amazonaws.com/$ECR_REPOSITORY_NAME:$((ECR_IMAGE_TAG+1))
      - aws s3 cp s3://$TEMPLATE_CONFIG_BUCKET/$TEMPLATE_CONFIG_ARTIFACT $TEMPLATE_CONFIG_ARTIFACT
      - unzip $TEMPLATE_CONFIG_ARTIFACT
      - jq --arg tag $((ECR_IMAGE_TAG+1)) '.Parameters.PublishECRImageTag = $tag' staging.json > staging2.json
      - rm staging.json && mv staging2.json staging.json
      - zip $TEMPLATE_CONFIG_ARTIFACT staging.json
      - aws s3 cp $TEMPLATE_CONFIG_ARTIFACT s3://$TEMPLATE_CONFIG_BUCKET/
      # that will trigger a Root Stack CodePipeline execution
artifacts:
  # It seems like CodePipeline and CodeBuild expect an artifact here. Currently
  # we don't need any, so this is essentially a no-op.<commit_msg>Better install<commit_after>version: 0.1
environment_variables:
  plaintext:
    BUILD_PHASE_MARKER: build_phase_complete
phases:
  install:
    commands:
      - apt-get update -y
      - apt-get install -y jq
      - curl -L "https://github.com/docker/compose/releases/download/1.11.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose
  pre_build:
    commands:
      - echo Logging in to Amazon ECR...
      - $(aws ecr get-login --region $ECR_REGION)
  build:
    commands:
      - docker build -t $ECR_REPOSITORY_NAME:$((ECR_IMAGE_TAG+1)) .
      - docker tag $ECR_REPOSITORY_NAME:$((ECR_IMAGE_TAG+1)) $AWS_ACCOUNT_ID.dkr.ecr.$ECR_REGION.amazonaws.com/$ECR_REPOSITORY_NAME:$((ECR_IMAGE_TAG+1))
      - echo "CODECOV_TOKEN=$CODECOV_TOKEN" >> .env
      - docker-compose run publish ci
      - touch $BUILD_PHASE_MARKER
  post_build:
    commands:
      - test -e $BUILD_PHASE_MARKER
      - docker push $AWS_ACCOUNT_ID.dkr.ecr.$ECR_REGION.amazonaws.com/$ECR_REPOSITORY_NAME:$((ECR_IMAGE_TAG+1))
      - aws s3 cp s3://$TEMPLATE_CONFIG_BUCKET/$TEMPLATE_CONFIG_ARTIFACT $TEMPLATE_CONFIG_ARTIFACT
      - unzip $TEMPLATE_CONFIG_ARTIFACT
      - jq --arg tag $((ECR_IMAGE_TAG+1)) '.Parameters.PublishECRImageTag = $tag' staging.json > staging2.json
      - rm staging.json && mv staging2.json staging.json
      - zip $TEMPLATE_CONFIG_ARTIFACT staging.json
      - aws s3 cp $TEMPLATE_CONFIG_ARTIFACT s3://$TEMPLATE_CONFIG_BUCKET/
      # that will trigger a Root Stack CodePipeline execution
artifacts:
  # It seems like CodePipeline and CodeBuild expect an artifact here. Currently
  # we don't need any, so this is essentially a no-op.
{'fraction_non_alphanumeric': 0.1096314648497987, 'fraction_numerical': 0.009290802105915144, 'mean_word_length': 3.3707713125845737, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2073220', 'n_tokens_mistral': 1216, 'n_tokens_neox': 1182, 'n_words': 239}