<commit_before>#!/bin/bash

play=/mnt/data/dev/play/github/play

set -u  # exit on unset variable
set -e  # exit on non-zero command exit code
set -o pipefail  # exit on false | true

# Don't deploy unless everything has been committed.
if [ ! -z "`git status --porcelain`" ]; then
  echo 'There are dirty files. Please run git status, and add and commit.'
  # exit 1
fi

# Build distribution.
$play dist
unzip -d dist/ dist/debiki-app-play-1.0-SNAPSHOT.zip

ssh_ec2_user="ssh -i /home/kajmagnus/debiki/hosting/amazon/debiki-az-ec2-keypair-1.pem"
ssh_play_user="ssh -i /home/kajmagnus/debiki/hosting/amazon/debiki-play-user.pem"
host=dw0azirdbpv11danny
basedir=/opt/debiki/debiki.se

echo "`date '+%F %H:%M'` `git log --oneline -n1`" >> deploy.log

rsync -avz \
  -e "$ssh_ec2_user"  \
  --exclude logs/ \
  --delete \
  ./dist/debiki-app-play-1.0-SNAPSHOT/* \
  ec2-user@$host:$basedir/app1/

# Allow user `play' to run `start'.
$ssh_ec2_user \<commit_msg>Don't deploy if anything not committed.<commit_after>#!/bin/bash

play=/mnt/data/dev/play/github/play

set -u  # exit on unset variable
set -e  # exit on non-zero command exit code
set -o pipefail  # exit on false | true

# Don't deploy unless everything has been committed.
if [ ! -z "`git status --porcelain`" ]; then
  echo 'There are dirty files. Please run git status, and add and commit.'
  exit 1
fi

# Build distribution.
$play dist
unzip -d dist/ dist/debiki-app-play-1.0-SNAPSHOT.zip

ssh_ec2_user="ssh -i /home/kajmagnus/debiki/hosting/amazon/debiki-az-ec2-keypair-1.pem"
ssh_play_user="ssh -i /home/kajmagnus/debiki/hosting/amazon/debiki-play-user.pem"
host=dw0azirdbpv11danny
basedir=/opt/debiki/debiki.se

echo "`date '+%F %H:%M'` `git log --oneline -n1`" >> deploy.log

rsync -avz \
  -e "$ssh_ec2_user"  \
  --exclude logs/ \
  --delete \
  ./dist/debiki-app-play-1.0-SNAPSHOT/* \
  ec2-user@$host:$basedir/app1/

# Allow user `play' to run `start'.
$ssh_ec2_user \
{'fraction_non_alphanumeric': 0.152218782249742, 'fraction_numerical': 0.016511867905056758, 'mean_word_length': 3.3475336322869955, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5077772', 'n_tokens_mistral': 837, 'n_tokens_neox': 782, 'n_words': 191}