<commit_before>include_recipe 'deploy'
include_recipe "nginx::service"

Chef::Log.info("Deploy Proxy Configuration to Nginx.")
node[:deploy].each do |application, deploy|
	if deploy[:application_type] != 'nodejs'
    	next
	end	
	
	bash "site_available" do
		user "root"
		cwd "#{deploy[:deploy_to]}/current"    
		code<<-EOF
IP=`sed -n 's/[\t ]*"proxy":[\t ]*"\([^"]*\).*/\1/p' package.json`
PORT=`sed -n 's/[\t ]*"port":[\t ]*"\([^"]*\).*/\1/p' package.json`
echo "server {
	listen 80;
	server_name $DOMAINS;
	location / {
		proxy_pass http://$IP:$PORT/;
	}
}" > titi
EOF
		environment({"DOMAINS" => "api.mangakas.fr"})
	end
end
 <commit_msg>Add Deploy<commit_after>include_recipe 'deploy'
include_recipe "nginx::service"

Chef::Log.info("Deploy Proxy Configuration to Nginx.")
node[:deploy].each do |application, deploy|
	if deploy[:application_type] != 'nodejs'
    	next
	end	
	
	bash "site_available" do
		user "root"
		cwd "#{deploy[:deploy_to]}/current"    
		code <<-EOH
IP=`sed -n 's/[\t ]*"proxy":[\t ]*"\([^"]*\).*/\1/p' package.json`
PORT=`sed -n 's/[\t ]*"port":[\t ]*"\([^"]*\).*/\1/p' package.json`
echo "server {
	listen 80;
	server_name $DOMAINS;
	location / {
		proxy_pass http://$IP:$PORT/;
	}
}" > titi
EOH
		environment({"DOMAINS" => "api.mangakas.fr"})
	end
end
 
{'fraction_non_alphanumeric': 0.22706065318818042, 'fraction_numerical': 0.006220839813374806, 'mean_word_length': 4.047058823529412, 'pattern_counts': {'":': 4, '<': 7, '<?xml version=': 0, '>': 7, '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': '1271989', 'n_tokens_mistral': 562, 'n_tokens_neox': 518, 'n_words': 108}