<commit_before>#json->[:deploy][:akronym_erlang_code][:scm][:repository]
#json->[:deploy][:akronym_erlang_code][:deploy_to]

include_recipe 'deploy'

node[:deploy].each do |application, deploy|
  if deploy[:akronym_app_type] != 'erlang-runner'
    Chef::Log.debug("only deploying 'erlang-runner' apps, which doesn't include this: #{application} because its type == #{deploy[:akronym_app_type]}")
    next
  end
  Chef::Log.debug("yep, deploying app == #{application} with config == #{deploy.to_json}")

  #opsworks_deploy_user
  opsworks_deploy_dir do
    user deploy[:user]
    group deploy[:group]
    path deploy[:deploy_to]
  end

  #execute "deployapp" do
    #command "aws s3 sync s3://akronym-internal/
  # Source accepts the protocol s3:// with the host as the bucket
  # access_key_id and secret_access_key are just that
  Chef::Log.debug("gonna do a deploy from #{deploy[:s3_source]}")
  Chef::Log.debug("headed to #{deploy[:deploy_to]}")

	ensure_scm_package_installed('s3')
	repo = prepare_s3_checkouts(deploy[:s3_source])
	#deploy[:scm] = {
		#:scm_type => 'git',
		#:repository => repo
	#}


  Chef::Log.debug("deploy time: #{repo} and #{deploy[:s3_source]}")
	deploy deploy[:deploy_to] do
		repository deploy[:s3_source]
	end

  Chef::Log.debug("scm time: #{repo} and #{deploy[:s3_source]}")
	scm "download code" do
		action :checkout
		destination deploy[:deploy_to]
		repository deploy[:s3_source]
	end

  #s3_file deploy[:deploy_to] do
    ##source "s3://your.bucket/the_file.tar.gz"
    #source deploy[:s3_source]
    #access_key_id your_key<commit_msg>try this<commit_after>#json->[:deploy][:akronym_erlang_code][:scm][:repository]
#json->[:deploy][:akronym_erlang_code][:deploy_to]

include_recipe 'deploy'

node[:deploy].each do |application, deploy|
  if deploy[:akronym_app_type] != 'erlang-runner'
    Chef::Log.debug("only deploying 'erlang-runner' apps, which doesn't include this: #{application} because its type == #{deploy[:akronym_app_type]}")
    next
  end
  Chef::Log.debug("yep, deploying app == #{application} with config == #{deploy.to_json}")

  #opsworks_deploy_user
  opsworks_deploy_dir do
    user deploy[:user]
    group deploy[:group]
    path deploy[:deploy_to]
  end

  #execute "deployapp" do
    #command "aws s3 sync s3://akronym-internal/
  # Source accepts the protocol s3:// with the host as the bucket
  # access_key_id and secret_access_key are just that
  Chef::Log.debug("gonna do a deploy from #{deploy[:s3_source]}")
  Chef::Log.debug("headed to #{deploy[:deploy_to]}")

	ensure_scm_package_installed('s3')
	repo = prepare_s3_checkouts(:repository => deploy[:s3_source])
	#deploy[:scm] = {
		#:scm_type => 'git',
		#:repository => repo
	#}


  Chef::Log.debug("deploy time: #{repo} and #{deploy[:s3_source]}")
	deploy deploy[:deploy_to] do
		repository deploy[:s3_source]
	end

  Chef::Log.debug("scm time: #{repo} and #{deploy[:s3_source]}")
	scm "download code" do
		action :checkout
		destination deploy[:deploy_to]
		repository deploy[:s3_source]
	end

  #s3_file deploy[:deploy_to] do
    ##source "s3://your.bucket/the_file.tar.gz"
    #source deploy[:s3_source]
    #access_key_id your_key
{'fraction_non_alphanumeric': 0.15250475586556753, 'fraction_numerical': 0.008877615726062143, 'mean_word_length': 5.2848605577689245, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6321153', 'n_tokens_mistral': 1189, 'n_tokens_neox': 1111, 'n_words': 243}