<commit_before>require "rubygems"
require "json"

rightscale_marker :begin

node[:web_app] = JSON.parse(node[:web_app_config])

RightScale::Repo::GitSshKey.new.create(node[:repo][:default][:credential], node[:repo][:default][:credential] )


log "===> Cloning resource"
git "/home/webapps/#{node[:web_app][:application]}" do
  repository node[:web_app][:git_repository]
  reference node[:web_app][:git_revision]
  enable_submodules node[:web_app][:submodule_init]
  action :sync
end

template "/home/webapps/#{node[:web_app][:application]}#{node[:web_app][:symfony_dir]}app/config/parameters.yml" do
  source "parameters.yml.erb"
  mode "0644"
  variables(
    :hostname => node[:web_app][:database][:hostname],
    :username => node[:web_app][:database][:username],
    :password => node[:web_app][:database][:password],
    :redis_hostname => node[:symfony][:redis][:hostname],
    :schema_name => node[:web_app][:database][:schema_name]
  )
end

execute "composer_install" do
  cwd "/home/webapps/#{node[:web_app][:application]}#{node[:web_app][:symfony_dir]}"
  command "php composer.phar install"
  only_if { ::File.exists?("/home/webapps/#{node[:web_app][:application]}#{node[:web_app][:symfony_dir]}composer.phar") }
  action :run
end

execute "clear_cache" do
  cwd "/home/webapps/#{node[:web_app][:application]}#{node[:web_app][:symfony_dir]}"
  command "app/console cache:clear --env=prod"
  only_if { ::File.exists?("/home/webapps/#{node[:web_app][:application]}#{node[:web_app][:symfony_dir]}app/console") }
  action :run
end

rightscale_marker :end
<commit_msg>chmod on vendor directory before composer install<commit_after>require "rubygems"
require "json"

rightscale_marker :begin

node[:web_app] = JSON.parse(node[:web_app_config])

RightScale::Repo::GitSshKey.new.create(node[:repo][:default][:credential], node[:repo][:default][:credential] )


log "===> Cloning resource"
git "/home/webapps/#{node[:web_app][:application]}" do
  repository node[:web_app][:git_repository]
  reference node[:web_app][:git_revision]
  enable_submodules node[:web_app][:submodule_init]
  action :sync
end

template "/home/webapps/#{node[:web_app][:application]}#{node[:web_app][:symfony_dir]}app/config/parameters.yml" do
  source "parameters.yml.erb"
  mode "0644"
  variables(
    :hostname => node[:web_app][:database][:hostname],
    :username => node[:web_app][:database][:username],
    :password => <PASSWORD>[:web_app][:database][:password],
    :redis_hostname => node[:symfony][:redis][:hostname],
    :schema_name => node[:web_app][:database][:schema_name]
  )
end

execute "composer_install" do
  cwd "/home/webapps/#{node[:web_app][:application]}#{node[:web_app][:symfony_dir]}"
  command "chmod -R 777 /home/webapps/#{node[:web_app][:application]}#{node[:web_app][:symfony_dir]}/vendors"
  command "php composer.phar install"
  only_if { ::File.exists?("/home/webapps/#{node[:web_app][:application]}#{node[:web_app][:symfony_dir]}composer.phar") }
  action :run
end

execute "clear_cache" do
  cwd "/home/webapps/#{node[:web_app][:application]}#{node[:web_app][:symfony_dir]}"
  command "app/console cache:clear --env=prod"
  only_if { ::File.exists?("/home/webapps/#{node[:web_app][:application]}#{node[:web_app][:symfony_dir]}app/console") }
  action :run
end

rightscale_marker :end

{'fraction_non_alphanumeric': 0.19545454545454546, 'fraction_numerical': 0.0033333333333333335, 'mean_word_length': 7.618798955613577, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 16, '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': '3940358', 'n_tokens_mistral': 1187, 'n_tokens_neox': 1192, 'n_words': 159}