Chapter 09/circuit-oneops-1-master/components/cookbooks/artifact/providers/deploy.rb
# Deletes the current version if and only if it is the same
# as the one to be installed, we are forcing, and remove_on_force is
# set. Only bad people will use this.
Deletes the current version if and only if it is the same
as the one to be installed, we are forcing, and remove_on_force is
set. Only bad people will use this.
Deletes the current version if and only if it is the same as the one to be installed we are forcing and remove_on_force is set . Only bad people will use this .
def delete_current_if_forcing!
  return unless @new_resource.force
  return unless remove_on_force?
  return unless get_current_release_version == artifact_version || previous_version_numbers.include?(artifact_version)
  recipe_eval do
    log "artifact_deploy[delete_current_if_forcing!] #{artifact_version} deleted because remove_on_force is true" do
      level :info
    end
    directory ::File.join(new_resource.deploy_to, 'releases', artifact_version) do
      recursive true
      action :delete
    end
  end
end
def delete_current_if_forcing! return unless @new_resource . force return unless remove_on_force? return unless get_current_release_version == artifact_version || previous_version_numbers . include? ( artifact_version ) recipe_eval do log "artifact_deploy[delete_current_if_forcing!] #{artifact_version} deleted because remove_on_force is true" do level :info end directory :: File . join ( new_resource . deploy_to , 'releases' , artifact_version ) do recursive true action :delete end end end
Deletes the current version if and only if it is the same
as the one to be installed, we are forcing, and remove_on_force is
set.
Deletes the current version if and only if it is the same as the one to be installed we are forcing and remove_on_force is set .