<commit_before>#!/bin/bash

eval "$(ssh-agent -s)"
chmod 600 .travis/id_rsa
ssh-add .travis/id_rsa

ssh apps@$IP -p $PORT <<EOF
  cd $DEPLOY_DIR
  git pull
  npm ci
  ng build --prod

  # Make backup of current production stuff
  TIMESTAMP=\$(date --rfc-3339=seconds)
  mkdir /home/apps/MyMICDS/production-backups/"\$TIMESTAMP"
  cp -R /var/www/mymicds/mymicds-angular/* /home/apps/MyMICDS/production-backups/"\$TIMESTAMP"

  # Copy new compiled files into production
  rm -rf /var/www/mymicds/mymicds-angular/*
  cp -R $DEPLOY_DIR/dist/mymicds-v2-angular/* /var/www/mymicds/mymicds-angular
EOF<commit_msg>deploy script failsafe<commit_after>#!/bin/bash

eval "$(ssh-agent -s)"
chmod 600 .travis/id_rsa
ssh-add .travis/id_rsa

ssh apps@$IP -p $PORT <<EOF
  cd $DEPLOY_DIR
  git pull
  npm ci
  ng build --prod

  # Make backup of current production stuff
  TIMESTAMP=\$(date --rfc-3339=seconds)
  mkdir /home/apps/MyMICDS/production-backups/"\$TIMESTAMP"
  cp -R /var/www/mymicds/mymicds-angular/* /home/apps/MyMICDS/production-backups/"\$TIMESTAMP"

  BUILD_DIR=$DEPLOY_DIR/dist/mymicds-v2-angular
  # Check for a successful build
  if [ ! -d "\$BUILD_DIR" ]; then
    echo "Build failed, exiting"
    exit 1
  fi

  # Copy new compiled files into production
  rm -rf /var/www/mymicds/mymicds-angular/*
  cp -R \$BUILD_DIR/* /var/www/mymicds/mymicds-angular
EOF
{'fraction_non_alphanumeric': 0.14096916299559473, 'fraction_numerical': 0.012481644640234948, 'mean_word_length': 3.3967741935483873, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, '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': '1826674', 'n_tokens_mistral': 591, 'n_tokens_neox': 545, 'n_words': 120}