<commit_before>#!/bin/bash -e

host=wonderdome

admin_user=greg
admin=$admin_user@$host

srv_user=wonder
srv=$srv_user@$host
srv_home=$srv:/srv/wonder

jar_name="wonderdome"
config_file="config.clj"


echo "Packaging code..."
lein uberjar

echo "Backing up deployed jar..."
ssh $srv "cp /srv/wonder/wonderdome.jar /srv/wonder/wonderdome.jar.bak"

echo "Stopping service..."
ssh $admin "sudo service wonderdome stop"

echo "Deploying uberjar..."
scp target/uberjar/$jar_name-*-standalone.jar $srv_home/wonderdome.jar

echo "Deploying native libraries..."
scp -r target/native/linux/ $srv_home/lib/

echo "Deploying configuration..."
scp $config_file $srv_home/$config_file

echo "Restarting service..."
ssh $admin "sudo service wonderdome start"<commit_msg>Don't use admin user to deploy.<commit_after>#!/bin/bash -e

# Note that this relies on the wonder user being able to control the wonderdome
# service without a password. This requires a sudoers directive like:
#
#     wonder  ALL=(root) NOPASSWD:/usr/sbin/service wonderdome *

host=wonderdome

srv_user=wonder
srv=$srv_user@$host
srv_home=$srv:/srv/wonder

jar_name="wonderdome"
config_file="config.clj"


echo "Packaging code..."
lein uberjar

echo "Backing up deployed jar..."
ssh $srv "cp /srv/wonder/wonderdome.jar /srv/wonder/wonderdome.jar.bak"

echo "Stopping service..."
ssh $srv "sudo service wonderdome stop"

echo "Deploying uberjar..."
scp target/uberjar/$jar_name-*-standalone.jar $srv_home/wonderdome.jar

echo "Deploying native libraries..."
scp -r target/native/linux/ $srv_home/lib/

echo "Deploying configuration..."
scp $config_file $srv_home/$config_file

echo "Restarting service..."
ssh $srv "sudo service wonderdome start"
{'fraction_non_alphanumeric': 0.1297709923664122, 'fraction_numerical': 0.0, 'mean_word_length': 4.776271186440678, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3253779', 'n_tokens_mistral': 656, 'n_tokens_neox': 631, 'n_words': 156}