<commit_before>#
# Cookbook Name:: cloudstack
# Recipe:: default
#

for p in ["ntp", "java-1.6.0-openjdk", "java-1.6.0-openjdk-devel", "tomcat6", "mysql", "mysql-server", "genisoimage", "git", "epel-release", "python-setuptools", "python-devel"]
  package p do
    action :install
  end
end

git "#{node[:cloudstack][:git][:install_path]}" do
  repository node[:cloudstack][:git][:repo]
  revision node[:cloudstack][:git][:branch]
  action :sync
end

bash "build from source" do
  code <<-EOH
    source /etc/profile.d/maven.sh
    cd /opt/cloudstack
    mvn -Pdeveloper -Dsimulator -DskipTests clean install
  EOH
end

easy_install_package "nose" do
  action :install
end

easy_install_package "marvin" do
  cwd node[:cloudstack][:marvin][:path]
  package_name "marvin"
  source node[:cloudstack][:marvin][:version] 
end

execute "service iptables stop" do
end

execute "service mysqld restart" do
  notifies :run, "bash[Setup CloudStack db]", :immediately
end

bash "Setup CloudStack db" do
  cwd node[:cloudstack][:git][:install_path]<commit_msg>commenting out marvin before dinner<commit_after>#
# Cookbook Name:: cloudstack
# Recipe:: default
#

for p in ["ntp", "tomcat6", "mysql", "mysql-server", "genisoimage", "git", "epel-release", "python-setuptools", "python-devel"]
  package p do
    action :install
  end
end

git "#{node[:cloudstack][:git][:install_path]}" do
  repository node[:cloudstack][:git][:repo]
  revision node[:cloudstack][:git][:branch]
  action :sync
end

bash "build from source" do
  code <<-EOH
    cd /opt/cloudstack
    mvn -Pdeveloper -Dsimulator -DskipTests clean install
  EOH
end

easy_install_package "nose" do
  action :install
end

#easy_install_package "marvin" do
#  cwd node[:cloudstack][:marvin][:path]
#  package_name "marvin"
#  source node[:cloudstack][:marvin][:version] 
#end

execute "service iptables stop" do
end

execute "service mysqld restart" do
  notifies :run, "bash[Setup CloudStack db]", :immediately
end

bash "Setup CloudStack db" do
  cwd node[:cloudstack][:git][:install_path]
{'fraction_non_alphanumeric': 0.14460784313725492, 'fraction_numerical': 0.00392156862745098, 'mean_word_length': 5.166163141993958, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '969538', 'n_tokens_mistral': 744, 'n_tokens_neox': 719, 'n_words': 193}