<commit_before>#!/bin/bash
# This script is run by Travis, to execute tests in the CI environment.

set -e

PASSENGER_ROOT=`dirname "$0"`
PASSENGER_ROOT=`cd "$PASSENGER_ROOT/../.." && pwd`
PASSENGER_ROOT_ON_DOCKER_HOST=${PASSENGER_ROOT_ON_DOCKER_HOST:-$PASSENGER_ROOT}

if [[ "$CACHE_DIR_ON_DOCKER_HOST" != "" ]]; then
	CACHE_DIR=/host_cache
else
	CACHE_DIR=/tmp
	CACHE_DIR_ON_DOCKER_HOST=/tmp
fi

COMPILE_CONCURRENCY=${COMPILE_CONCURRENCY:-2}

export VERBOSE=1
export TRACE=1
export DEVDEPS_DEFAULT=no
export rvmsudo_secure_path=1
export LC_CTYPE=C.UTF-8
unset BUNDLE_GEMFILE

if [[ -e /etc/workaround-docker-2267/hosts ]]; then
	HOSTS_FILE=/etc/workaround-docker-2267/hosts
	sudo workaround-docker-2267
	find /usr/local/rvm/rubies/*/lib/ruby -name resolv.rb | sudo xargs sed -i 's|/etc/hosts|/cte/hosts|g'
else
	HOSTS_FILE=/etc/hosts
fi

sudo sh -c "cat >> $HOSTS_FILE" <<EOF
127.0.0.1 passenger.test
127.0.0.1 mycook.passenger.test
127.0.0.1 zsfa.passenger.test
127.0.0.1 norails.passenger.test
127.0.0.1 1.passenger.test 2.passenger.test 3.passenger.test
127.0.0.1 4.passenger.test 5.passenger.test 6.passenger.test
127.0.0.1 7.passenger.test 8.passenger.test 9.passenger.test
EOF

function run()
{
	echo "$ $@"
	"$@"
}

function retry_run()
{
	local reset='\x1B[0m'
	local red='\x1B[31m'
	local yellow='\x1B[33m'<commit_msg>Jenkins CI script: fix hosts file<commit_after>#!/bin/bash
# This script is run by Travis, to execute tests in the CI environment.

set -e

PASSENGER_ROOT=`dirname "$0"`
PASSENGER_ROOT=`cd "$PASSENGER_ROOT/../.." && pwd`
PASSENGER_ROOT_ON_DOCKER_HOST=${PASSENGER_ROOT_ON_DOCKER_HOST:-$PASSENGER_ROOT}

if [[ "$CACHE_DIR_ON_DOCKER_HOST" != "" ]]; then
	CACHE_DIR=/host_cache
else
	CACHE_DIR=/tmp
	CACHE_DIR_ON_DOCKER_HOST=/tmp
fi

COMPILE_CONCURRENCY=${COMPILE_CONCURRENCY:-2}

export VERBOSE=1
export TRACE=1
export DEVDEPS_DEFAULT=no
export rvmsudo_secure_path=1
export LC_CTYPE=C.UTF-8
unset BUNDLE_GEMFILE

if [[ -e /etc/workaround-docker-2267 ]]; then
	HOSTS_FILE=/etc/workaround-docker-2267/hosts
	sudo ln -s /etc/hosts /etc/workaround-docker-2267/hosts
	sudo workaround-docker-2267
	find /usr/local/rvm/rubies/*/lib/ruby -name resolv.rb | sudo xargs sed -i 's|/etc/hosts|/cte/hosts|g'
else
	HOSTS_FILE=/etc/hosts
fi

sudo sh -c "cat >> $HOSTS_FILE" <<EOF
127.0.0.1 passenger.test
127.0.0.1 mycook.passenger.test
127.0.0.1 zsfa.passenger.test
127.0.0.1 norails.passenger.test
127.0.0.1 1.passenger.test 2.passenger.test 3.passenger.test
127.0.0.1 4.passenger.test 5.passenger.test 6.passenger.test
127.0.0.1 7.passenger.test 8.passenger.test 9.passenger.test
EOF

function run()
{
	echo "$ $@"
	"$@"
}

function retry_run()
{
	local reset='\x1B[0m'
	local red='\x1B[31m'
	local yellow='\x1B[33m'
{'fraction_non_alphanumeric': 0.1473067057530231, 'fraction_numerical': 0.05789666544521803, 'mean_word_length': 4.6521739130434785, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 14, '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': '5859686', 'n_tokens_mistral': 1296, 'n_tokens_neox': 1171, 'n_words': 209}