<commit_before>#!/bin/bash

. /etc/profile
if [ -z "$1" ]; then
    echo usage: $0 branch [apache user]
    exit
fi

# Specify
APACHE_GROUP=$2
if [ -z "$2" ]; then
    APACHE_GROUP=apache
fi

# Variable setup
SRC=https://github.com/landreg/knowman-alpha
DEST="/opt/deploy/landreg/releases"
CURRENT_SYM_PATH="/opt/deploy/landreg"
BRANCH_NAME=$1
DESTPATH=$DEST/$(date +%Y%m%d%H%M%S)
VENDOR_PATH=$DEST/build/vendor
CONFIG_PATH=$DEST/build/config

set -x
# Pull from source
git clone $SRC -b $BRANCH_NAME $DESTPATH

# Make sure the common vendor and config folders exist
mkdir -p $VENDOR_PATH
mkdir -p $CONFIG_PATH

# Create the base config file.
touch $CONFIG_PATH/parameters.yml
cd $DESTPATH/app/config && ln -s $CONFIG_PATH/parameters.yml parameters.yml

# Update permissions on all writable and exuctable files and directories
mkdir -p $DESTPATH/app/cache && chgrp $APACHE_GROUP $DESTPATH/app/cache && chmod g+s $DESTPATH/app/cache
mkdir -p $DESTPATH/app/logs && chgrp $APACHE_GROUP $DESTPATH/app/logs && chmod g+s $DESTPATH/app/logs
chmod +x $DESTPATH/app/console


# Set the vendor directory to be a symlink and run composer install
cd $DESTPATH && ln -s $VENDOR_PATH vendor && composer -vvv install

# Make sure the web server can write to it
chmod -R 775 $DESTPATH/app/cache
chmod -R 775 $DESTPATH/app/logs
hgrp $APACHE_GROUP $DESTPATH
hgrp $APACHE_GROUP $VENDOR_PATH

# Update symlink to new source
cd $CURRENT_SYM_PATH && ln -sfn $DESTPATH current
<commit_msg>spelling mistake<commit_after>#!/bin/bash

. /etc/profile
if [ -z "$1" ]; then
    echo usage: $0 branch [apache user]
    exit
fi

# Specify
APACHE_GROUP=$2
if [ -z "$2" ]; then
    APACHE_GROUP=apache
fi

# Variable setup
SRC=https://github.com/landreg/knowman-alpha
DEST="/opt/deploy/landreg/releases"
CURRENT_SYM_PATH="/opt/deploy/landreg"
BRANCH_NAME=$1
DESTPATH=$DEST/$(date +%Y%m%d%H%M%S)
VENDOR_PATH=$DEST/build/vendor
CONFIG_PATH=$DEST/build/config

set -x
# Pull from source
git clone $SRC -b $BRANCH_NAME $DESTPATH

# Make sure the common vendor and config folders exist
mkdir -p $VENDOR_PATH
mkdir -p $CONFIG_PATH

# Create the base config file.
touch $CONFIG_PATH/parameters.yml
cd $DESTPATH/app/config && ln -s $CONFIG_PATH/parameters.yml parameters.yml

# Update permissions on all writable and exuctable files and directories
mkdir -p $DESTPATH/app/cache && chgrp $APACHE_GROUP $DESTPATH/app/cache && chmod g+s $DESTPATH/app/cache
mkdir -p $DESTPATH/app/logs && chgrp $APACHE_GROUP $DESTPATH/app/logs && chmod g+s $DESTPATH/app/logs
chmod +x $DESTPATH/app/console


# Set the vendor directory to be a symlink and run composer install
cd $DESTPATH && ln -s $VENDOR_PATH vendor && composer -vvv install

# Make sure the web server can write to it
chmod -R 775 $DESTPATH/app/cache
chmod -R 775 $DESTPATH/app/logs
chgrp $APACHE_GROUP $DESTPATH
chgrp $APACHE_GROUP $VENDOR_PATH

# Update symlink to new source
cd $CURRENT_SYM_PATH && ln -sfn $DESTPATH current

{'fraction_non_alphanumeric': 0.11440245148110317, 'fraction_numerical': 0.00749063670411985, 'mean_word_length': 4.522556390977444, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '4366791', 'n_tokens_mistral': 1103, 'n_tokens_neox': 1094, 'n_words': 315}