<commit_before>#!/bin/bash
set -e
export DEBIAN_FRONTEND=noninteractive

apt-get -y install \
  libmysqlclient15-dev sqlite3 libsqlite3-dev \
  libcurl4-openssl-dev libpcre3-dev libxml2-dev libxslt-dev \
  imagemagick libpq-dev \
  libmysqlclient-dev \
  libreadline-gplv2-dev

source /etc/profile.d/rbenv.sh

gem update --system
gem install bundler pg rails thin --no-rdoc --no-ri

# install crewmate
git clone https://github.com/crewmate/crewmate.git /srv/crewmate
cd /srv/crewmate
bundle install

install /tmp/crewmate/crewmate.yml config/
install /tmp/crewmate/database.yml config/

# setup directories
install -d /srv/crewmate/db

# add permissions
setfacl -m user:crewmate:rwx /srv/crewmate/log
setfacl -m user:crewmate:rwx /srv/crewmate/db

# create development database
bundle exec rake db:create db:schema:load RAILS_ENV=development<commit_msg>fix: ruby version and dependency<commit_after>#!/bin/bash
set -e
export DEBIAN_FRONTEND=noninteractive

apt-get -y install \
  acl libmysqlclient15-dev sqlite3 libsqlite3-dev \
  libcurl4-openssl-dev libpcre3-dev libxml2-dev libxslt-dev \
  imagemagick libpq-dev libmysqlclient-dev libreadline-gplv2-dev

source /etc/profile.d/rbenv.sh

gem update --system
gem install bundler pg rails thin --no-rdoc --no-ri

# install crewmate
git clone https://github.com/crewmate/crewmate.git /srv/crewmate
cd /srv/crewmate
if [ -e /srv/crewmate/.ruby-version ]; then
  rm -f /srv/crewmate/.ruby-version
fi
gem install debugger
bundle install

install /tmp/crewmate/crewmate.yml config/
install /tmp/crewmate/database.yml config/

# setup directories
install -d /srv/crewmate/db

# add permissions
setfacl -m user:crewmate:rwx /srv/crewmate/log
setfacl -m user:crewmate:rwx /srv/crewmate/db

# create development database
bundle exec rake db:create db:schema:load RAILS_ENV=development
{'fraction_non_alphanumeric': 0.10082191780821918, 'fraction_numerical': 0.008767123287671232, 'mean_word_length': 4.172804532577904, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '2616264', 'n_tokens_mistral': 712, 'n_tokens_neox': 681, 'n_words': 159}