<commit_before>#!/bin/bash

# NOTE: this script is expectd to be run from project checkout dir

function init() {
  set -eu
  : ${DST_ENV:?}
  : ${PORT:?}

  ROOT_DIR="$SCRIPT_DIR/../../../.."

  VERSION=`cat $ROOT_DIR/version`
  AWS_TEST=ubuntu@172.16.17.32
  SSH_OPTS="-i /var/go/hsl-liipi.pem -oStrictHostKeyChecking=no"

  SRC_JAR="$ROOT_DIR/staging/fi/hsl/parkandride/parkandride-application/$VERSION/parkandride-application-$VERSION.jar"
  DST_JAR="parkandride-application-$DST_ENV-$VERSION.jar"
}

function stop_and_delete() {
  ssh $SSH_OPTS $AWS_TEST "pkill -F $DST_ENV/application.pid; sleep 1; rm -rfv $DST_ENV; mkdir $DST_ENV"
}

function transfer() {
  scp $SSH_OPTS $SRC_JAR $AWS_TEST:$DST_ENV/$DST_JAR
}

function start() {
  #ssh $SSH_OPTS $AWS_TEST "cd $DST_ENV; nohup java -jar $DST_JAR --spring.profiles.active=demo --server.port=$PORT > app.out 2> app.err < /dev/null &"
  ssh $SSH_OPTS $AWS_TEST "cd $DST_ENV; nohup java -jar $DST_JAR --spring.profiles.active=demo --server.port=$PORT 2>&1 > app.out < /dev/null &"
}<commit_msg>chore(deploy): combining 2>&1 hangs, revert to separate rediction with -n option<commit_after>#!/bin/bash

# NOTE: this script is expectd to be run from project checkout dir

function init() {
  set -eu
  : ${DST_ENV:?}
  : ${PORT:?}

  ROOT_DIR="$SCRIPT_DIR/../../../.."

  VERSION=`cat $ROOT_DIR/version`
  AWS_TEST=ubuntu@172.16.17.32
  SSH_OPTS="-i /var/go/hsl-liipi.pem -oStrictHostKeyChecking=no"

  SRC_JAR="$ROOT_DIR/staging/fi/hsl/parkandride/parkandride-application/$VERSION/parkandride-application-$VERSION.jar"
  DST_JAR="parkandride-application-$DST_ENV-$VERSION.jar"
}

function stop_and_delete() {
  ssh $SSH_OPTS $AWS_TEST "pkill -F $DST_ENV/application.pid; sleep 1; rm -rfv $DST_ENV; mkdir $DST_ENV"
}

function transfer() {
  scp $SSH_OPTS $SRC_JAR $AWS_TEST:$DST_ENV/$DST_JAR
}

function start() {
  ssh $SSH_OPTS -n $AWS_TEST "cd $DST_ENV; nohup java -jar $DST_JAR --spring.profiles.active=demo --server.port=$PORT > app.out 2> app.err &"
}
{'fraction_non_alphanumeric': 0.16318407960199005, 'fraction_numerical': 0.012935323383084577, 'mean_word_length': 4.3201058201058204, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, 'https://': 0, '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': '5547737', 'n_tokens_mistral': 885, 'n_tokens_neox': 831, 'n_words': 156}