<commit_before>version: 0.2

phases:

  install:
    commands:
      - apt -y update
      - apt -y install awscli texlive-full

  build:
    commands:
      - pdflatex -output-directory static resume/resume.tex

  post_build:
    commands:
      # get s3 bucket name
      - > aws cloudformation describe-stacks
            --stack-name weblog
            --query 'Stacks[0].Outputs[?OutputKey==`Bucket`].OutputValue'
            --output text > bucket
      # copy files to s3 bucket
      - > aws s3 copy static/error.html s3://$(cat bucket)
            --cache-control max-age=31536000
            --content-type text/html
      - > aws s3 copy static/favicon.ico s3://$(cat bucket)
            --cache-control max-age=31536000
            --content-type image/png
      - > aws s3 copy static/index.html s3://$(cat bucket)
            --cache-control max-age=31536000
            --content-type text/html
      - > aws s3 copy static/resume.pdf s3://$(cat bucket)
            --cache-control max-age=31536000
            --content-type application/pdf
      - > aws s3 copy static/robots.txt s3://$(cat bucket)
            --cache-control max-age=31536000
            --content-type text/plain
      # get cloudfront distribution id
      - > aws cloudformation describe-stacks
            --stack-name weblog
            --query 'Stacks[0].Outputs[?OutputKey==`Distribution`].OutputValue'
            --output text > distribution
      # create cloudfront invalidation
      - > aws cloudfront create-invalidation
            --distribution-id $(cat distribution)
            --paths / /error.html /favicon.ico /index.html /resume.pdf /robots.txt

artifacts:
  discard-paths: yes
  files:
    - static/error.html
    - static/favicon.ico
    - static/index.html
    - static/resume.pdf
    - static/robots.txt<commit_msg>fix up yaml multiline string errors<commit_after>version: 0.2

phases:

  install:
    commands:
      - apt -y update
      - apt -y install awscli texlive-full

  build:
    commands:
      - pdflatex -output-directory static resume/resume.tex

  post_build:
    commands:
      # get s3 bucket name
      - >
          aws cloudformation describe-stacks
          --stack-name weblog
          --query 'Stacks[0].Outputs[?OutputKey==`Bucket`].OutputValue'
          --output text > bucket
      # copy files to s3 bucket
      - >
          aws s3 copy static/error.html s3://$(cat bucket)
          --cache-control max-age=31536000
          --content-type text/html
      - >
          aws s3 copy static/favicon.ico s3://$(cat bucket)
          --cache-control max-age=31536000
          --content-type image/png
      - >
          aws s3 copy static/index.html s3://$(cat bucket)
          --cache-control max-age=31536000
          --content-type text/html
      - >
          aws s3 copy static/resume.pdf s3://$(cat bucket)
          --cache-control max-age=31536000
          --content-type application/pdf
      - >
          aws s3 copy static/robots.txt s3://$(cat bucket)
          --cache-control max-age=31536000
          --content-type text/plain
      # get cloudfront distribution id
      - >
          aws cloudformation describe-stacks
          --stack-name weblog
          --query 'Stacks[0].Outputs[?OutputKey==`Distribution`].OutputValue'
          --output text > distribution
      # create cloudfront invalidation
      - >
          aws cloudfront create-invalidation
          --distribution-id $(cat distribution)
          --paths / /error.html /favicon.ico /index.html /resume.pdf /robots.txt

artifacts:
  discard-paths: yes
  files:
    - static/error.html
    - static/favicon.ico
    - static/index.html
    - static/resume.pdf
    - static/robots.txt
{'fraction_non_alphanumeric': 0.11290322580645161, 'fraction_numerical': 0.030107526881720432, 'mean_word_length': 1.785179640718563, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, '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': '1720058', 'n_tokens_mistral': 1159, 'n_tokens_neox': 1106, 'n_words': 260}