<commit_before>#!/bin/bash

SERVER_SETTINGS_PATH='/home/jenkins'
DEPLOYMENT_PATH='/var/www/HadithHouseWebsite'

# Stops the execution of the script if any command, including pipes, fail.
set -e 
set -o pipefail

# Deleting the current files in the deployment directory.
echo "Deleting ${DEPLOYMENT_PATH}"
rm -rf ${DEPLOYMENT_PATH}/*

# Copy server settings file into te build directory.
echo "Copy server_settings.py from $SERVER_SETTINGS_PATH to `pwd`/HadithHouseWebsite/"
cp ${SERVER_SETTINGS_PATH}/server_settings.py HadithHouseWebsite/

# Collect Django's static files.
echo "Running manage.py collectstatic to collect static files."
python manage.py collectstatic --noinput

# Apply Django's migrations.
echo "Running manage.py migrate to apply migrations."
python manage.py migrate

# Creating directory $DEPLOYMENT_PATH if it is not created.
echo "Creating directory $DEPLOYMENT_PATH if it is not created."
sudo /bin/mkdir -p $DEPLOYMENT_PATH

# Copy the project onto the deployment directory.
echo "Copying `pwd`/* to $DEPLOYMENT_PATH"
cp -r ./* ${DEPLOYMENT_PATH}/

# Restart Apache2 server.
echo "Restarting Apache2 server"
sudo /usr/bin/service apache2 restart
<commit_msg>Add 'sudo' in front of some commands in deploy.sh<commit_after>#!/bin/bash

SERVER_SETTINGS_PATH='/home/jenkins'
DEPLOYMENT_PATH='/var/www/HadithHouseWebsite'

# Stops the execution of the script if any command, including pipes, fail.
set -e 
set -o pipefail

# Deleting the current files in the deployment directory.
echo "Deleting ${DEPLOYMENT_PATH}"
sudo rm -rf ${DEPLOYMENT_PATH}/*

# Copy server settings file into te build directory.
echo "Copy server_settings.py from $SERVER_SETTINGS_PATH to `pwd`/HadithHouseWebsite/"
cp ${SERVER_SETTINGS_PATH}/server_settings.py HadithHouseWebsite/

# Collect Django's static files.
echo "Running manage.py collectstatic to collect static files."
python manage.py collectstatic --noinput

# Apply Django's migrations.
echo "Running manage.py migrate to apply migrations."
python manage.py migrate

# Creating directory $DEPLOYMENT_PATH if it is not created.
echo "Creating directory $DEPLOYMENT_PATH if it is not created."
sudo mkdir -p $DEPLOYMENT_PATH

# Copy the project onto the deployment directory.
echo "Copying `pwd`/* to $DEPLOYMENT_PATH"
sudo cp -r ./* ${DEPLOYMENT_PATH}/

# Restart Apache2 server.
echo "Restarting Apache2 server"
sudo service apache2 restart

{'fraction_non_alphanumeric': 0.0875, 'fraction_numerical': 0.0025, 'mean_word_length': 5.140664961636829, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7458704', 'n_tokens_mistral': 796, 'n_tokens_neox': 741, 'n_words': 266}