<commit_before>#!/bin/bash

#sudo apt-get install -y ansible

echo "Environment: production or development?"
read env

if  [ "$env" == "production" ]; then
	echo "Server host?"
	read host

	echo "DB user?"
	read db_user

	echo "DB password?"
	read db_pass

	if [ "$db_user" == '' || "$db_pass" == '' ]; then
		echo "Cannot continue without required values."
		exit 1
	fi

	echo "School Name?"
	read school_name

	config="vars/production.yml"

	echo "Creating the production vars file for Ansible templates..."

	echo "---" > "$config"
	echo "environ: $env" >> "$config"
	echo "administrator_email: $administrator_email" >> "$config"
	echo "application_directory: $application_directory" >> "$config"
	echo "eportfolio_directory: $eportfolio_directory" >> "$config"
	echo "templates_directory: $templates_directory" >> "$config"
	echo "classis_directory: $classis_directory" >> "$config"
	echo "database_backup_directory: $db_dumps_dir" >> "$config"
	echo "logs_directory: $logs_directory" >> "$config"
	echo "utils_directory: $utils_directory" >> "$config"
	echo "http_port: $http_port" >> "$config"
	echo "https_port: $https_port" >> "$config"
	echo "apache_site: $apache_site" >> "$config"
	echo "apache_error_log_path: $apache_error_log_path" >> "$config"
	echo "apache_access_log_path: $apache_access_log_path" >> "$config"
	echo "certificate_file_path: $certificate_file_path" >> "$config"
	echo "certificate_key_file_path: $certificate_key_file_path" >> "$config"
	echo "slave_server_ip: $slave_server_ip" >> "$config"
	echo "master_server_ip: $master_server_ip" >> "$config"
	echo "host: $host" >> "$config"
	echo "user: $user" >> "$config"
	echo "db_name: $db_name" >> "$config"
	echo "db_user: $db_user" >> "$config"
	echo "db_pass: $db_pass" >> "$config"
	echo "school_name: $school_name" >> "$config"
	echo "password_short_keyword: $pass_short_keyword" >> "$config"
	echo "application_url: $application_url" >> "$config"

	echo "Initiating Classis installation with ansible provision."
	ansible-playbook production.yml -f 10
elif  [ "$env" == "development" ]; then
	echo "Installing VirtualBox, Vagrant and Capistrano for development."

	#sudo apt-get install -y virtualbox vagrant capistrano git

	echo "Initiating the vagrant box with ansible provision."
	vagrant up

	application_directory="."
else
	echo "Cannot continue without selecting an environment."
	exit 1
fi

echo "Configure Classis school.php file:"
nano $application_directory/school.php<commit_msg>remove -y from apt-get installs and added --provision to vagrant up for development<commit_after>#!/bin/bash

sudo apt-get install ansible

echo "Environment: production or development?"
read env

if  [ "$env" == "production" ]; then
	echo "Server host?"
	read host

	echo "DB user?"
	read db_user

	echo "DB password?"
	read db_pass

	if [ "$db_user" == '' || "$db_pass" == '' ]; then
		echo "Cannot continue without required values."
		exit 1
	fi

	echo "School Name?"
	read school_name

	config="vars/production.yml"

	echo "Creating the production vars file for Ansible templates..."

	echo "---" > "$config"
	echo "environ: $env" >> "$config"
	echo "administrator_email: $administrator_email" >> "$config"
	echo "application_directory: $application_directory" >> "$config"
	echo "eportfolio_directory: $eportfolio_directory" >> "$config"
	echo "templates_directory: $templates_directory" >> "$config"
	echo "classis_directory: $classis_directory" >> "$config"
	echo "database_backup_directory: $db_dumps_dir" >> "$config"
	echo "logs_directory: $logs_directory" >> "$config"
	echo "utils_directory: $utils_directory" >> "$config"
	echo "http_port: $http_port" >> "$config"
	echo "https_port: $https_port" >> "$config"
	echo "apache_site: $apache_site" >> "$config"
	echo "apache_error_log_path: $apache_error_log_path" >> "$config"
	echo "apache_access_log_path: $apache_access_log_path" >> "$config"
	echo "certificate_file_path: $certificate_file_path" >> "$config"
	echo "certificate_key_file_path: $certificate_key_file_path" >> "$config"
	echo "slave_server_ip: $slave_server_ip" >> "$config"
	echo "master_server_ip: $master_server_ip" >> "$config"
	echo "host: $host" >> "$config"
	echo "user: $user" >> "$config"
	echo "db_name: $db_name" >> "$config"
	echo "db_user: $db_user" >> "$config"
	echo "db_pass: $db_<PASSWORD>" >> "$config"
	echo "school_name: $school_name" >> "$config"
	echo "password_short_keyword: $pass_short_keyword" >> "$config"
	echo "application_url: $application_url" >> "$config"

	echo "Initiating Classis installation with ansible provision."
	ansible-playbook production.yml -f 10
elif  [ "$env" == "development" ]; then
	echo "Installing VirtualBox, Vagrant and Capistrano for development."

	sudo apt-get install virtualbox vagrant capistrano git

	echo "Initiating the vagrant box with ansible provision."
	vagrant up --provision

	application_directory="."
else
	echo "Cannot continue without selecting an environment."
	exit 1
fi

echo "Configure Classis school.php file:"
nano $application_directory/school.php
{'fraction_non_alphanumeric': 0.14035785288270378, 'fraction_numerical': 0.0015904572564612327, 'mean_word_length': 5.817073170731708, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 110, 'https://': 0, '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': '3037446', 'n_tokens_mistral': 1695, 'n_tokens_neox': 1638, 'n_words': 466}