<commit_before>#!/bin/bash

. $WORKSPACE/utils/jenkins/common.sh

topdir=$WORKSPACE/utils/jenkins

sudo ln -sf $topdir/init.d/nailgun /etc/init.d/nailgun
sudo WORKSPACE=$WORKSPACE /etc/init.d/nailgun stop

# Installing nailgun dependencies
nailgun_deps

make clean
make $WORKSPACE/build/repos/nailgun.done

cd $WORKSPACE/build/repos/nailgun/nailgun
# Cleaning database
./manage.py dropdb

# Loading data
./manage.py syncdb
./manage.py loaddefault
./manage.py loaddata nailgun/fixtures/sample_environment.json

# Compressing javascript
r.js -o build.js dir=static_compressed

# Replace static path with the one pointing to compressed static content folder
sed 's|_replace_me_static_compressed_path_|'"$WORKSPACE"'/nailgun/static_compressed|' -i $topdir/nginx/nailgun.conf
sed 's|_replace_me_static_path_|'"$WORKSPACE"'/nailgun/static|' -i $topdir/nginx/nailgun.conf
sudo ln -sf $topdir/nginx/nailgun.conf /etc/nginx/conf.d/nailgun.conf

# Starting fake UI
sudo WORKSPACE=$WORKSPACE /etc/init.d/nailgun start
# Reload updated config file
sudo /etc/init.d/nginx reload<commit_msg>fix fake ui static path<commit_after>#!/bin/bash

. $WORKSPACE/utils/jenkins/common.sh

topdir=$WORKSPACE/utils/jenkins

sudo ln -sf $topdir/init.d/nailgun /etc/init.d/nailgun
sudo WORKSPACE=$WORKSPACE /etc/init.d/nailgun stop

# Installing nailgun dependencies
nailgun_deps

make clean
make $WORKSPACE/build/repos/nailgun.done

cd $WORKSPACE/build/repos/nailgun/nailgun
# Cleaning database
./manage.py dropdb

# Loading data
./manage.py syncdb
./manage.py loaddefault
./manage.py loaddata nailgun/fixtures/sample_environment.json

# Compressing javascript
r.js -o build.js dir=static_compressed

# Replace static path with the one pointing to compressed static content folder
sed 's|_replace_me_static_compressed_path_|'"$WORKSPACE"'/build/repos/nailgun/nailgun/static_compressed|' -i $topdir/nginx/nailgun.conf
sed 's|_replace_me_static_path_|'"$WORKSPACE"'/build/repos/nailgun/nailgun/static|' -i $topdir/nginx/nailgun.conf
sudo ln -sf $topdir/nginx/nailgun.conf /etc/nginx/conf.d/nailgun.conf

# Starting fake UI
sudo WORKSPACE=$WORKSPACE /etc/init.d/nailgun start
# Reload updated config file
sudo /etc/init.d/nginx reload
{'fraction_non_alphanumeric': 0.11433756805807622, 'fraction_numerical': 0.0, 'mean_word_length': 5.142061281337047, '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': '6865062', 'n_tokens_mistral': 821, 'n_tokens_neox': 782, 'n_words': 163}