<commit_before># Defines for the default deployment recipes whether we want to use sudo or not.
set :use_sudo, false

# This a space separated list of folders that will be shared between deploys
set :shared_children, %w(assets)

# The number of old releases to keep, defaults to 5, can be overridden with
# any positive integer.
set :keep_releases, 10

# Keep set to false, RubyOnRails behaviour, will brake in Silverstripe
set :normalize_asset_timestamps, false

# Deploy the code by copying it up to the server so the target servers don't need
# to have access to the git repo
set :deploy_via, :copy
set :copy_strategy, :export
set :copy_cache, false

_cset(:sake_path) { "./framework/sake" }

# The migrate task takes care of doing the dev/build
namespace :deploy do

	task :migrate, :roles => :db do
		if exists?(:webserver_user)
			run "sudo -u #{webserver_user} #{latest_release}/#{sake_path} dev/build"
		else
			run "mkdir -p #{latest_release}/silverstripe-cache"
			run "#{latest_release}/#{sake_path} dev/build flush=1"
			run "rm -rf #{latest_release}/silverstripe-cache"
		end
	end

	task :restart do
		system "echo \""+Time.now.strftime("%Y-%m-%d %H:%M:%S")+" => #{release_name} \" >> #{history_path}/#{config_name}.deploy-history.txt";
		logger.debug "Deploy finished."
	end
end

# Change the deploy target folder to the current branch name if the :branch
# is set, otherwise use default timestamp
before "deploy:update" do
	# check if the branch is set to head and .. do something?
	set :release_name,  "#{branch}" if exists?(:branch)
end



after "deploy:finalize_update", "deploy:migrate"<commit_msg>BUG Use a timestamped release folder<commit_after># Defines for the default deployment recipes whether we want to use sudo or not.
set :use_sudo, false

# This a space separated list of folders that will be shared between deploys
set :shared_children, %w(assets)

# The number of old releases to keep, defaults to 5, can be overridden with
# any positive integer.
set :keep_releases, 10

# Keep set to false, RubyOnRails behaviour, will brake in Silverstripe
set :normalize_asset_timestamps, false

# Deploy the code by copying it up to the server so the target servers don't need
# to have access to the git repo
set :deploy_via, :copy
set :copy_strategy, :export
set :copy_cache, false

_cset(:sake_path) { "./framework/sake" }

# The migrate task takes care of doing the dev/build
namespace :deploy do

	task :migrate, :roles => :db do
		if exists?(:webserver_user)
			run "sudo -u #{webserver_user} #{latest_release}/#{sake_path} dev/build"
		else
			run "mkdir -p #{latest_release}/silverstripe-cache"
			run "#{latest_release}/#{sake_path} dev/build flush=1"
			run "rm -rf #{latest_release}/silverstripe-cache"
		end
	end

	task :restart do
		system "echo \""+Time.now.strftime("%Y-%m-%d %H:%M:%S")+" => #{branch} \" >> #{history_path}/#{config_name}.deploy-history.txt";
		logger.debug "Deploy finished."
	end
end

after "deploy:finalize_update", "deploy:migrate"
{'fraction_non_alphanumeric': 0.11178045515394913, 'fraction_numerical': 0.002677376171352075, 'mean_word_length': 4.693333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '197104', 'n_tokens_mistral': 1027, 'n_tokens_neox': 960, 'n_words': 359}