<commit_before>#!/bin/bash

#better safe than sorry - I still have to read about permissions for volumes
# in overlay-fs

if [ -f "/var/shared/strapstate/omscore" ]
then
	echo "Bootstrap-file found, not executing bootstrap script"
else
	echo "Bootstrapping..."
    sleep 15 #give time to postgres container to startup

    if [ ! -f /var/www/.env ]; then
      echo "No .env file found, copying from .env.example"
      cp /var/www/.env.example /var/www/.env
    fi

	cd /var/www
    composer install --quiet   || { echo "Error at composer install"; exit 10; }
	php artisan config:clear   || { echo "Error at config:clear"; exit 11; }
	php artisan clear-compiled || { echo "Error at clear-compiled"; exit 12; }
	php artisan config:cache   || { echo "Error at config:cache (1)"; exit 13; }
	php artisan migrate        || { echo "Error at migrate"; exit 14; }
	php artisan key:generate   || { echo "Error at key:generate"; exit 15; }
	php artisan config:cache   || { echo "Error at config:cache (2)"; exit 16; }
	php artisan db:seed        || { echo "Error at db:seed"; exit 17; }
	php artisan config:cache   || { echo "Error at config:cache (3)"; exit 18; }

	# Make omscore write out the api-key
  echo "Write out API Key:"
	echo "app()->call([app()->make('App\\Http\\Controllers\\ModuleController'), 'getSharedSecret'], [])->original;" | php artisan tinker || { echo "Error at artisan tinker"; exit 17; }

  cp /var/www/storage/key /var/shared/api-key

	# Copy the key into the volume mount so other
	mkdir -p /var/shared
	cp /var/www/storage/key /var/shared/api-key

	npm install
  gulp

	mkdir -p storage
	mkdir -p /var/shared/strapstate

	# Create a file on strapstate to indicate we do not need to run this again
	touch /var/shared/strapstate/omscore

	echo "Bootstrap finished"
fi<commit_msg>Silenced most of the bootstrap script (#67)<commit_after>#!/bin/bash

#better safe than sorry - I still have to read about permissions for volumes
# in overlay-fs

if [ -f "/var/shared/strapstate/omscore" ]
then
	echo "Bootstrap-file found, not executing bootstrap script"
else
	echo "Bootstrapping..."
    sleep 15 #give time to postgres container to startup

    if [ ! -f /var/www/.env ]; then
      echo "No .env file found, copying from .env.example"
      cp /var/www/.env.example /var/www/.env
    fi

	cd /var/www
    composer install --quiet       || { echo "Error at composer install"; exit 10; }
	php artisan config:clear -q    || { echo "Error at config:clear"; exit 11; }
	php artisan clear-compiled -q  || { echo "Error at clear-compiled"; exit 12; }
	php artisan config:cache -q    || { echo "Error at config:cache (1)"; exit 13; }
	php artisan migrate -q         || { echo "Error at migrate"; exit 14; }
	php artisan key:generate -q    || { echo "Error at key:generate"; exit 15; }
	php artisan config:cache -q    || { echo "Error at config:cache (2)"; exit 16; }
	php artisan db:seed -q         || { echo "Error at db:seed"; exit 17; }
	php artisan config:cache -q    || { echo "Error at config:cache (3)"; exit 18; }

	# Make omscore write out the api-key
    echo "Write out API Key:"
	echo "app()->call([app()->make('App\\Http\\Controllers\\ModuleController'), 'getSharedSecret'], [])->original;" | php artisan tinker || { echo "Error at artisan tinker"; exit 17; }

    cp /var/www/storage/key /var/shared/api-key

	# Copy the key into the volume mount so other
	mkdir -p /var/shared
	cp /var/www/storage/key /var/shared/api-key

	npm install
    gulp --silent &> /dev/null # Output is sent to null, disabling it

	mkdir -p storage
	mkdir -p /var/shared/strapstate

	# Create a file on strapstate to indicate we do not need to run this again
	touch /var/shared/strapstate/omscore

	echo "Bootstrap finished"
fi
{'fraction_non_alphanumeric': 0.12791633145615447, 'fraction_numerical': 0.013944757307589166, 'mean_word_length': 3.1444444444444444, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 10, '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': '3191355', 'n_tokens_mistral': 1277, 'n_tokens_neox': 1173, 'n_words': 452}