### Home Classes Methods

### In Files

- lib/chef/provider/deploy/revision.rb
- lib/chef/provider/deploy/timestamped.rb
- lib/chef/provider/deploy.rb

### Parent

Chef::Provider

### Namespace

- CLASS Chef::Provider::Deploy::Revision
- CLASS Chef::Provider::Deploy::Timestamped

### Methods

- ::new
- #action_deploy
- #action_force_deploy
- #action_rollback
- #all_releases
- #callback
- #cleanup!
- #copy_cached_repo
- #create_dir_unless_exists
- #create_dirs_before_symlink
- #current_release?
- #define_resource_requirements
- #deploy
- #deployed?
- #enforce_ownership
- #gem_packages
- #gem_resource_collection_runner
- #install_gems
- #link_current_release_to_production
- #link_tempfiles_to_current_release
- #load_current_resource
- #migrate
- #purge_tempfiles_from_current_release
- #release_created
- #release_deleted
- #release_slug
- #restart
- #rollback
- #rollback_to
- #run
- #run_callback_from_file
- #run_options
- #run_scm_sync
- #run_symlinks_before_migrate
- #save_release_state
- #sudo
- #svn_force_export
- #symlink
- #update_cached_repo
- #verify_directories_exist
- #whyrun_supported?
- #with_rollback_on_error

### Included Modules

- Chef::DSL::Recipe
- Chef::Mixin::FromFile
- Chef::Mixin::Command

### Files

- LICENSE

### Class/Module Index

Quicksearch

- Chef
- Chef::ApiClient
- Chef::ApiClient::Registration
- Chef::Application
- Chef::Application::Apply
- Chef::Application::Client
- Chef::Application::Knife
- Chef::Application::Solo
- Chef::Application::Wakeup
- Chef::Application::WindowsService
- Chef::Checksum
- Chef::Checksum::Storage
- Chef::Checksum::Storage::Filesystem
- Chef::ChefFS
- Chef::ChefFS::CommandLine
- Chef::ChefFS::FilePattern
- Chef::ChefFS::FileSystem
- Chef::ChefFS::FileSystem::BaseFSDir
- Chef::ChefFS::FileSystem::BaseFSObject
- Chef::ChefFS::FileSystem::ChefRepositoryFileSystemEntry
- Chef::ChefFS::FileSystem::ChefRepositoryFileSystemRootDir
- Chef::ChefFS::FileSystem::ChefServerRootDir
- Chef::ChefFS::FileSystem::CookbookDir
- Chef::ChefFS::FileSystem::CookbookFile
- Chef::ChefFS::FileSystem::CookbookSubdir
- Chef::ChefFS::FileSystem::CookbooksDir
- Chef::ChefFS::FileSystem::DataBagDir
- Chef::ChefFS::FileSystem::DataBagItem
- Chef::ChefFS::FileSystem::DataBagsDir
- Chef::ChefFS::FileSystem::FileSystemEntry
- Chef::ChefFS::FileSystem::FileSystemError
- Chef::ChefFS::FileSystem::FileSystemRootDir
- Chef::ChefFS::FileSystem::MustDeleteRecursivelyError
- Chef::ChefFS::FileSystem::NodesDir
- Chef::ChefFS::FileSystem::NonexistentFSObject
- Chef::ChefFS::FileSystem::NotFoundError
- Chef::ChefFS::FileSystem::RestListDir
- Chef::ChefFS::FileSystem::RestListEntry
- Chef::ChefFS::Knife
- Chef::ChefFS::PathUtils
- Chef::Client
- Chef::Config
- Chef::Cookbook
- Chef::Cookbook::Chefignore
- Chef::Cookbook::CookbookVersionLoader
- Chef::Cookbook::FileSystemFileVendor
- Chef::Cookbook::FileVendor
- Chef::Cookbook::Metadata
- Chef::Cookbook::MinimalMetadata
- Chef::Cookbook::RemoteFileVendor
- Chef::Cookbook::SyntaxCheck
- Chef::Cookbook::SyntaxCheck::PersistentSet
- Chef::CookbookCacheCleaner
- Chef::CookbookCollection
- Chef::CookbookLoader
- Chef::CookbookSiteStreamingUploader
- Chef::CookbookSiteStreamingUploader::MultipartStream
- Chef::CookbookSiteStreamingUploader::StreamPart
- Chef::CookbookSiteStreamingUploader::StringPart
- Chef::CookbookSynchronizer
- Chef::CookbookUploader
- Chef::CookbookVersion
- Chef::DSL
- Chef::DSL::DataQuery
- Chef::DSL::IncludeAttribute
- Chef::DSL::IncludeRecipe
- Chef::DSL::PlatformIntrospection
- Chef::DSL::PlatformIntrospection::PlatformDependentValue
- Chef::DSL::PlatformIntrospection::PlatformFamilyDependentValue
- Chef::DSL::Recipe
- Chef::DSL::RegistryHelper
- Chef::Daemon
- Chef::DataBag
- Chef::DataBagItem
- Chef::Digester
- Chef::EncryptedDataBagItem
- Chef::EncryptedDataBagItem::DecryptionFailure
- Chef::EncryptedDataBagItem::Decryptor
- Chef::EncryptedDataBagItem::Decryptor::Version0Decryptor
- Chef::EncryptedDataBagItem::Decryptor::Version1Decryptor
- Chef::EncryptedDataBagItem::Encryptor
- Chef::EncryptedDataBagItem::UnsupportedCipher
- Chef::EncryptedDataBagItem::UnsupportedEncryptedDataBagItemFormat
- Chef::Environment
- Chef::EventDispatch
- Chef::EventDispatch::Base
- Chef::EventDispatch::Dispatcher
- Chef::Exceptions
- Chef::Exceptions::AmbiguousRunlistSpecification
- Chef::Exceptions::Application
- Chef::Exceptions::AttributeNotFound
- Chef::Exceptions::CannotDetermineNodeName
- Chef::Exceptions::CannotWritePrivateKey
- Chef::Exceptions::CommandTimeout
- Chef::Exceptions::ConfigurationError
- Chef::Exceptions::CookbookFrozen
- Chef::Exceptions::CookbookNotFound
- Chef::Exceptions::CookbookNotFoundInRepo
- Chef::Exceptions::CookbookVersionConflict
- Chef::Exceptions::CookbookVersionNameMismatch
- Chef::Exceptions::CookbookVersionSelection
- Chef::Exceptions::CookbookVersionSelection::InvalidRunListItems
- Chef::Exceptions::CookbookVersionSelection::UnsatisfiableRunListItem
- Chef::Exceptions::Cron
- Chef::Exceptions::DsclCommandFailed
- Chef::Exceptions::EnclosingDirectoryDoesNotExist
- Chef::Exceptions::Env
- Chef::Exceptions::ErlCall
- Chef::Exceptions::Exec
- Chef::Exceptions::FileNotFound
- Chef::Exceptions::Group
- Chef::Exceptions::GroupIDNotFound
- Chef::Exceptions::Ifconfig
- Chef::Exceptions::IllegalChecksumRevert
- Chef::Exceptions::ImmutableAttributeModification
- Chef::Exceptions::InsufficientPermissions
- Chef::Exceptions::InvalidCommandOption
- Chef::Exceptions::InvalidCookbookVersion
- Chef::Exceptions::InvalidDataBagItemID
- Chef::Exceptions::InvalidDataBagName
- Chef::Exceptions::InvalidDataBagPath
- Chef::Exceptions::InvalidEnvironmentRunListSpecification
- Chef::Exceptions::InvalidHomeDirectory
- Chef::Exceptions::InvalidPrivateKey
- Chef::Exceptions::InvalidRemoteFileURI
- Chef::Exceptions::InvalidRemoteGitReference
- Chef::Exceptions::InvalidResourceReference
- Chef::Exceptions::InvalidResourceSpecification
- Chef::Exceptions::InvalidVersionConstraint
- Chef::Exceptions::Link
- Chef::Exceptions::MissingLibrary
- Chef::Exceptions::MissingParentDirectory
- Chef::Exceptions::MissingRole
- Chef::Exceptions::Mount
- Chef::Exceptions::MultipleFailures
- Chef::Exceptions::ObsoleteDependencySyntax
- Chef::Exceptions::Override
- Chef::Exceptions::Package
- Chef::Exceptions::PrivateKeyMissing
- Chef::Exceptions::RecipeNotFound
- Chef::Exceptions::RedirectLimitExceeded
- Chef::Exceptions::RequestedUIDUnavailable
- Chef::Exceptions::ResourceNotFound
- Chef::Exceptions::RoleNotFound
- Chef::Exceptions::Route
- Chef::Exceptions::SearchIndex
- Chef::Exceptions::Service
- Chef::Exceptions::SolrConnectionError
- Chef::Exceptions::StaleAttributeRead
- Chef::Exceptions::UnresolvableGitReference
- Chef::Exceptions::UnsupportedAction
- Chef::Exceptions::User
- Chef::Exceptions::UserIDNotFound
- Chef::Exceptions::ValidationFailed
- Chef::Exceptions::Win32APIError
- Chef::Exceptions::Win32APIFunctionNotImplemented
- Chef::Exceptions::Win32NotWindows
- Chef::Exceptions::Win32RegArchitectureIncorrect
- Chef::Exceptions::Win32RegBadType
- Chef::Exceptions::Win32RegBadValueSize
- Chef::Exceptions::Win32RegDataMissing
- Chef::Exceptions::Win32RegHiveMissing
- Chef::Exceptions::Win32RegKeyMissing
- Chef::Exceptions::Win32RegNoRecursive
- Chef::Exceptions::Win32RegTypeDoesNotExist
- Chef::Exceptions::Win32RegTypesMismatch
- Chef::Exceptions::Win32RegValueExists
- Chef::Exceptions::Win32RegValueMissing
- Chef::Exceptions::WindowsNotAdmin
- Chef::FileAccessControl
- Chef::FileAccessControl::Unix
- Chef::FileAccessControl::Windows
- Chef::FileAccessControl::Windows::Security
- Chef::FileCache
- Chef::Formatters
- Chef::Formatters::APIErrorFormatting
- Chef::Formatters::Base
- Chef::Formatters::Doc
- Chef::Formatters::ErrorDescription
- Chef::Formatters::ErrorInspectors
- Chef::Formatters::ErrorInspectors::CompileErrorInspector
- Chef::Formatters::ErrorInspectors::CookbookResolveErrorInspector
- Chef::Formatters::ErrorInspectors::CookbookSyncErrorInspector
- Chef::Formatters::ErrorInspectors::NodeLoadErrorInspector
- Chef::Formatters::ErrorInspectors::RegistrationErrorInspector
- Chef::Formatters::ErrorInspectors::ResourceFailureInspector
- Chef::Formatters::ErrorInspectors::RunListExpansionErrorInspector
- Chef::Formatters::ErrorMapper
- Chef::Formatters::Minimal
- Chef::Formatters::NullFormatter
- Chef::Formatters::Outputter
- Chef::Formatters::UnknownFormatter
- Chef::Handler
- Chef::Handler::ErrorReport
- Chef::Handler::JsonFile
- Chef::JSONCompat
- Chef::Knife
- Chef::Knife::Bootstrap
- Chef::Knife::ClientBulkDelete
- Chef::Knife::ClientCreate
- Chef::Knife::ClientDelete
- Chef::Knife::ClientEdit
- Chef::Knife::ClientList
- Chef::Knife::ClientReregister
- Chef::Knife::ClientShow
- Chef::Knife::Configure
- Chef::Knife::ConfigureClient
- Chef::Knife::CookbookBulkDelete
- Chef::Knife::CookbookCreate
- Chef::Knife::CookbookDelete
- Chef::Knife::CookbookDownload
- Chef::Knife::CookbookList
- Chef::Knife::CookbookMetadata
- Chef::Knife::CookbookMetadataFromFile
- Chef::Knife::CookbookSCMRepo
- Chef::Knife::CookbookShow
- Chef::Knife::CookbookSiteDownload
- Chef::Knife::CookbookSiteInstall
- Chef::Knife::CookbookSiteList
- Chef::Knife::CookbookSiteSearch
- Chef::Knife::CookbookSiteShare
- Chef::Knife::CookbookSiteShow
- Chef::Knife::CookbookSiteUnshare
- Chef::Knife::CookbookSiteVendor
- Chef::Knife::CookbookTest
- Chef::Knife::CookbookUpload
- Chef::Knife::Core
- Chef::Knife::Core::BootstrapContext
- Chef::Knife::Core::GenericPresenter
- Chef::Knife::Core::NodeFormattingOptions
- Chef::Knife::Core::NodePresenter
- Chef::Knife::Core::ObjectLoader
- Chef::Knife::Core::ObjectLoader::ObjectType
- Chef::Knife::Core::TextFormatter
- Chef::Knife::DataBagCreate
- Chef::Knife::DataBagDelete
- Chef::Knife::DataBagEdit
- Chef::Knife::DataBagFromFile
- Chef::Knife::DataBagList
- Chef::Knife::DataBagShow
- Chef::Knife::Delete
- Chef::Knife::Diff
- Chef::Knife::Download
- Chef::Knife::EnvironmentCreate
- Chef::Knife::EnvironmentDelete
- Chef::Knife::EnvironmentEdit
- Chef::Knife::EnvironmentFromFile
- Chef::Knife::EnvironmentList
- Chef::Knife::EnvironmentShow
- Chef::Knife::Exec
- Chef::Knife::Help
- Chef::Knife::IndexRebuild
- Chef::Knife::List
- Chef::Knife::NodeBulkDelete
- Chef::Knife::NodeCreate
- Chef::Knife::NodeDelete
- Chef::Knife::NodeEdit
- Chef::Knife::NodeEditor
- Chef::Knife::NodeFromFile
- Chef::Knife::NodeList
- Chef::Knife::NodeRunListAdd
- Chef::Knife::NodeRunListRemove
- Chef::Knife::NodeShow
- Chef::Knife::Raw
- Chef::Knife::RecipeList
- Chef::Knife::RoleBulkDelete
- Chef::Knife::RoleCreate
- Chef::Knife::RoleDelete
- Chef::Knife::RoleEdit
- Chef::Knife::RoleFromFile
- Chef::Knife::RoleList
- Chef::Knife::RoleShow
- Chef::Knife::Search
- Chef::Knife::Show
- Chef::Knife::Ssh
- Chef::Knife::Status
- Chef::Knife::SubcommandLoader
- Chef::Knife::TagCreate
- Chef::Knife::TagDelete
- Chef::Knife::TagList
- Chef::Knife::UI
- Chef::Knife::Upload
- Chef::Knife::UserCreate
- Chef::Knife::UserDelete
- Chef::Knife::UserEdit
- Chef::Knife::UserList
- Chef::Knife::UserReregister
- Chef::Knife::UserShow
- Chef::Log
- Chef::Log::Formatter
- Chef::Mixin
- Chef::Mixin::Checksum
- Chef::Mixin::Command
- Chef::Mixin::Command::Unix
- Chef::Mixin::Command::Windows
- Chef::Mixin::ConvertToClassName
- Chef::Mixin::CreatePath
- Chef::Mixin::DeepMerge
- Chef::Mixin::DeepMerge::InvalidParameter
- Chef::Mixin::DeepMerge::InvalidSubtractiveMerge
- Chef::Mixin::DeprecatedLanguageModule
- Chef::Mixin::Deprecation
- Chef::Mixin::Deprecation::DeprecatedInstanceVariable
- Chef::Mixin::Deprecation::DeprecatedObjectProxyBase
- Chef::Mixin::EnforceOwnershipAndPermissions
- Chef::Mixin::FileClass
- Chef::Mixin::FromFile
- Chef::Mixin::GetSourceFromPackage
- Chef::Mixin::ParamsValidate
- Chef::Mixin::PathSanity
- Chef::Mixin::Securable
- Chef::Mixin::Securable::WindowsMacros
- Chef::Mixin::Securable::WindowsSecurableAttributes
- Chef::Mixin::ShellOut
- Chef::Mixin::Template
- Chef::Mixin::Template::ChefContext
- Chef::Mixin::Template::TemplateError
- Chef::Mixin::WhyRun
- Chef::Mixin::WhyRun::ConvergeActions
- Chef::Mixin::WhyRun::ResourceRequirements
- Chef::Mixin::WhyRun::ResourceRequirements::Assertion
- Chef::Mixin::WhyRun::ResourceRequirements::Assertion::AssertionFailure
- Chef::Mixin::XMLEscape
- Chef::Mixin::XMLEscape::FastXS
- Chef::Mixin::XMLEscape::PureRuby
- Chef::Node
- Chef::Node::AttrArray
- Chef::Node::Attribute
- Chef::Node::ImmutableArray
- Chef::Node::ImmutableMash
- Chef::Node::Immutablize
- Chef::Node::VividMash
- Chef::Platform
- Chef::Provider
- Chef::Provider::Breakpoint
- Chef::Provider::CookbookFile
- Chef::Provider::Cron
- Chef::Provider::Cron::Solaris
- Chef::Provider::Deploy
- Chef::Provider::Deploy::Revision
- Chef::Provider::Deploy::Timestamped
- Chef::Provider::Directory
- Chef::Provider::Env
- Chef::Provider::Env::Windows
- Chef::Provider::ErlCall
- Chef::Provider::Execute
- Chef::Provider::File
- Chef::Provider::Git
- Chef::Provider::Group
- Chef::Provider::Group::Aix
- Chef::Provider::Group::Dscl
- Chef::Provider::Group::Gpasswd
- Chef::Provider::Group::Groupadd
- Chef::Provider::Group::Groupmod
- Chef::Provider::Group::Pw
- Chef::Provider::Group::Suse
- Chef::Provider::Group::Usermod
- Chef::Provider::Group::Windows
- Chef::Provider::HttpRequest
- Chef::Provider::Ifconfig
- Chef::Provider::LWRPBase
- Chef::Provider::LWRPBase::InlineResources
- Chef::Provider::LWRPBase::InlineResources::ClassMethods
- Chef::Provider::Link
- Chef::Provider::Log
- Chef::Provider::Log::ChefLog
- Chef::Provider::Mdadm
- Chef::Provider::Mount
- Chef::Provider::Mount::Mount
- Chef::Provider::Mount::Windows
- Chef::Provider::Ohai
- Chef::Provider::Package
- Chef::Provider::Package::Apt
- Chef::Provider::Package::Dpkg
- Chef::Provider::Package::EasyInstall
- Chef::Provider::Package::Freebsd
- Chef::Provider::Package::Ips
- Chef::Provider::Package::Macports
- Chef::Provider::Package::Pacman
- Chef::Provider::Package::Portage
- Chef::Provider::Package::Rpm
- Chef::Provider::Package::Rubygems
- Chef::Provider::Package::Rubygems::AlternateGemEnvironment
- Chef::Provider::Package::Rubygems::CurrentGemEnvironment
- Chef::Provider::Package::Rubygems::GemEnvironment
- Chef::Provider::Package::SmartOS
- Chef::Provider::Package::Solaris
- Chef::Provider::Package::Yum
- Chef::Provider::Package::Yum::RPMDb
- Chef::Provider::Package::Yum::RPMDbPackage
- Chef::Provider::Package::Yum::RPMDependency
- Chef::Provider::Package::Yum::RPMPackage
- Chef::Provider::Package::Yum::RPMProvide
- Chef::Provider::Package::Yum::RPMRequire
- Chef::Provider::Package::Yum::RPMUtils
- Chef::Provider::Package::Yum::RPMVersion
- Chef::Provider::Package::Yum::YumCache
- Chef::Provider::Package::Zypper
- Chef::Provider::RegistryKey
- Chef::Provider::RemoteDirectory
- Chef::Provider::RemoteFile
- Chef::Provider::ResourceUpdate
- Chef::Provider::Route
- Chef::Provider::RubyBlock
- Chef::Provider::Script
- Chef::Provider::Service
- Chef::Provider::Service::Arch
- Chef::Provider::Service::Debian
- Chef::Provider::Service::Freebsd
- Chef::Provider::Service::Gentoo
- Chef::Provider::Service::Init
- Chef::Provider::Service::Insserv
- Chef::Provider::Service::Invokercd
- Chef::Provider::Service::Macosx
- Chef::Provider::Service::Redhat
- Chef::Provider::Service::Simple
- Chef::Provider::Service::Solaris
- Chef::Provider::Service::Systemd
- Chef::Provider::Service::Upstart
- Chef::Provider::Service::Windows
- Chef::Provider::Subversion
- Chef::Provider::Template
- Chef::Provider::TemplateFinder
- Chef::Provider::User
- Chef::Provider::User::Dscl
- Chef::Provider::User::Pw
- Chef::Provider::User::Useradd
- Chef::Provider::User::Windows
- Chef::REST
- Chef::REST::AuthCredentials
- Chef::REST::CookieJar
- Chef::REST::NoopInflater
- Chef::REST::RESTRequest
- Chef::Recipe
- Chef::ReservedNames
- Chef::ReservedNames::Win32
- Chef::ReservedNames::Win32::API
- Chef::ReservedNames::Win32::API::Error
- Chef::ReservedNames::Win32::API::File
- Chef::ReservedNames::Win32::API::File::BY_HANDLE_FILE_INFORMATION
- Chef::ReservedNames::Win32::API::File::FILETIME
- Chef::ReservedNames::Win32::API::File::REPARSE_DATA_BUFFER
- Chef::ReservedNames::Win32::API::File::REPARSE_DATA_BUFFER_GENERIC
- Chef::ReservedNames::Win32::API::File::REPARSE_DATA_BUFFER_MOUNT_POINT
- Chef::ReservedNames::Win32::API::File::REPARSE_DATA_BUFFER_SYMBOLIC_LINK
- Chef::ReservedNames::Win32::API::File::REPARSE_DATA_BUFFER_UNION
- Chef::ReservedNames::Win32::API::File::SECURITY_ATTRIBUTES
- Chef::ReservedNames::Win32::API::File::WIN32_FIND_DATA
- Chef::ReservedNames::Win32::API::Macros
- Chef::ReservedNames::Win32::API::Memory
- Chef::ReservedNames::Win32::API::PSAPI
- Chef::ReservedNames::Win32::API::PSAPI::PROCESS_MEMORY_COUNTERS
- Chef::ReservedNames::Win32::API::Process
- Chef::ReservedNames::Win32::API::Security
- Chef::ReservedNames::Win32::API::Security::ACE_HEADER
- Chef::ReservedNames::Win32::API::Security::ACE_WITH_MASK_AND_SID
- Chef::ReservedNames::Win32::API::Security::ACLStruct
- Chef::ReservedNames::Win32::API::Security::LUID
- Chef::ReservedNames::Win32::API::Security::LUID_AND_ATTRIBUTES
- Chef::ReservedNames::Win32::API::Security::TOKEN_PRIVILEGES
- Chef::ReservedNames::Win32::API::System
- Chef::ReservedNames::Win32::API::System::OSVERSIONINFOEX
- Chef::ReservedNames::Win32::API::Unicode
- Chef::ReservedNames::Win32::Error
- Chef::ReservedNames::Win32::File
- Chef::ReservedNames::Win32::File::Info
- Chef::ReservedNames::Win32::Handle
- Chef::ReservedNames::Win32::Memory
- Chef::ReservedNames::Win32::Process
- Chef::ReservedNames::Win32::Security
- Chef::ReservedNames::Win32::Security::ACE
- Chef::ReservedNames::Win32::Security::ACL
- Chef::ReservedNames::Win32::Security::SID
- Chef::ReservedNames::Win32::Security::SecurableObject
- Chef::ReservedNames::Win32::Security::SecurableObject::SecurityConst
- Chef::ReservedNames::Win32::Security::SecurityDescriptor
- Chef::ReservedNames::Win32::Security::Token
- Chef::ReservedNames::Win32::Unicode
- Chef::ReservedNames::Win32::Version
- Chef::Resource
- Chef::Resource::AptPackage
- Chef::Resource::Bash
- Chef::Resource::Breakpoint
- Chef::Resource::ChefGem
- Chef::Resource::Conditional
- Chef::Resource::CookbookFile
- Chef::Resource::Cron
- Chef::Resource::Csh
- Chef::Resource::Deploy
- Chef::Resource::DeployBranch
- Chef::Resource::DeployRevision
- Chef::Resource::Directory
- Chef::Resource::DpkgPackage
- Chef::Resource::EasyInstallPackage
- Chef::Resource::Env
- Chef::Resource::ErlCall
- Chef::Resource::Execute
- Chef::Resource::File
- Chef::Resource::FreebsdPackage
- Chef::Resource::GemPackage
- Chef::Resource::Git
- Chef::Resource::Group
- Chef::Resource::HttpRequest
- Chef::Resource::Ifconfig
- Chef::Resource::IpsPackage
- Chef::Resource::LWRPBase
- Chef::Resource::Link
- Chef::Resource::Log
- Chef::Resource::MacportsPackage
- Chef::Resource::Mdadm
- Chef::Resource::Mount
- Chef::Resource::Notification
- Chef::Resource::Ohai
- Chef::Resource::Package
- Chef::Resource::PacmanPackage
- Chef::Resource::Perl
- Chef::Resource::PlatformMap
- Chef::Resource::PortagePackage
- Chef::Resource::Python
- Chef::Resource::RegistryKey
- Chef::Resource::RemoteDirectory
- Chef::Resource::RemoteFile
- Chef::Resource::Route
- Chef::Resource::RpmPackage
- Chef::Resource::Ruby
- Chef::Resource::RubyBlock
- Chef::Resource::Scm
- Chef::Resource::Script
- Chef::Resource::Service
- Chef::Resource::SmartOSPackage
- Chef::Resource::SolarisPackage
- Chef::Resource::Subversion
- Chef::Resource::Template
- Chef::Resource::TimestampedDeploy
- Chef::Resource::User
- Chef::Resource::YumPackage
- Chef::ResourceCollection
- Chef::ResourceCollection::StepableIterator
- Chef::ResourceDefinition
- Chef::ResourceDefinitionList
- Chef::ResourceReporter
- Chef::ResourceReporter::ResourceReport
- Chef::Role
- Chef::RunContext
- Chef::RunContext::CookbookCompiler
- Chef::RunList
- Chef::RunList::RunListExpansion
- Chef::RunList::RunListExpansionFromAPI
- Chef::RunList::RunListExpansionFromDisk
- Chef::RunList::RunListItem
- Chef::RunList::VersionedRecipeList
- Chef::RunLock
- Chef::RunStatus
- Chef::Runner
- Chef::Sandbox
- Chef::ScanAccessControl
- Chef::Search
- Chef::Search::Query
- Chef::ShellOut
- Chef::StreamingCookbookUploader
- Chef::StreamingCookbookUploader::MultipartStream
- Chef::StreamingCookbookUploader::StreamPart
- Chef::StreamingCookbookUploader::StringPart
- Chef::User
- Chef::Util
- Chef::Util::FileEdit
- Chef::Util::Windows
- Chef::Util::Windows::NetGroup
- Chef::Util::Windows::NetUse
- Chef::Util::Windows::NetUser
- Chef::Util::Windows::Volume
- Chef::Version
- Chef::VersionConstraint
- Chef::Win32
- Chef::Win32::Registry
- Shell
- Shell::ClientSession
- Shell::DoppelGangerClient
- Shell::DoppelGangerSession
- Shell::Extensions
- Shell::Extensions::FalseClass
- Shell::Extensions::ObjectCoreExtensions
- Shell::Extensions::String
- Shell::Extensions::Symbol
- Shell::Extensions::TrueClass
- Shell::ModelWrapper
- Shell::NamedDataBagWrapper
- Shell::Options
- Shell::ShellREST
- Shell::ShellSession
- Shell::SoloSession
- Shell::StandAloneSession
- Net
- Net::HTTPError
- Net::HTTPFatalError
- Net::HTTPRetriableError
- Net::HTTPServerException
- FFI
- FFI::Pointer
- FileUtils
- FileUtils::Entry_
- ChefNetHTTPExceptionExtensions
- Dir
- FalseClass
- Mash
- Numeric
- Object
- Regexp
- String
- Symbol
- TrueClass

No matching classes.

# Chef::Provider::Deploy

### Attributes

previous_release_path[R]
release_path[R]
scm_provider[R]

### Public Class Methods

new(new_resource, run_context) click to toggle source

    # File lib/chef/provider/deploy.rb, line 36
    def initialize(new_resource, run_context)
      super(new_resource, run_context)

      # will resolve to ither git or svn based on resource attributes ,
      # and will create a resource corresponding to that provider
      @scm_provider = new_resource.scm_provider.new(new_resource, run_context)

      # @configuration is not used by Deploy, it is only for backwards compat with
      # chef-deploy or capistrano hooks that might use it to get environment information
      @configuration = @new_resource.to_hash
      @configuration[:environment] = @configuration[:environment] && @configuration[:environment]["RAILS_ENV"]
    end

### Public Instance Methods

action_deploy() click to toggle source

    # File lib/chef/provider/deploy.rb, line 98
    def action_deploy
      save_release_state
      if deployed?(release_path )
        if current_release?(release_path )
          Chef::Log.debug("#{@new_resource} is the latest version")
        else
          rollback_to release_path
        end
      else

        with_rollback_on_error do
          deploy
        end
      end
    end

action_force_deploy() click to toggle source

    # File lib/chef/provider/deploy.rb, line 114
    def action_force_deploy
      if deployed?(release_path)
        converge_by("delete deployed app at #{release_path} prior to force-deploy") do
          Chef::Log.info("Already deployed app at #{release_path}, forcing.")
          FileUtils.rm_rf(release_path)
          Chef::Log.info("#{@new_resource} forcing deploy of already deployed app at #{release_path}")
        end
      end

      # Alternatives:
      # * Move release_path directory before deploy and move it back when error occurs
      # * Rollback to previous commit
      # * Do nothing - because deploy is force, it will be retried in short time
      # Because last is simpliest, keep it
      deploy
    end

action_rollback() click to toggle source

    # File lib/chef/provider/deploy.rb, line 131
    def action_rollback
      rollback_to all_releases[-2]
    end

all_releases() click to toggle source

    # File lib/chef/provider/deploy.rb, line 241
    def all_releases
      Dir.glob(@new_resource.deploy_to + "/releases/*").sort
    end

callback(what, callback_code=nil) click to toggle source

    # File lib/chef/provider/deploy.rb, line 178
    def callback(what, callback_code=nil)
      @collection = Chef::ResourceCollection.new
      case callback_code
      when Proc
        Chef::Log.info "#{@new_resource} running callback #{what}"
        recipe_eval(&callback_code)
      when String
        run_callback_from_file("#{release_path}/#{callback_code}")
      when nil
        run_callback_from_file("#{release_path}/deploy/#{what}.rb")
      end
    end

cleanup!() click to toggle source

    # File lib/chef/provider/deploy.rb, line 230
    def cleanup!
      chop = -1 - @new_resource.keep_releases
      all_releases[0..chop].each do |old_release|
        converge_by("remove old release #{old_release}") do
          Chef::Log.info "#{@new_resource} removing old release #{old_release}"
          FileUtils.rm_rf(old_release)
        end
        release_deleted(old_release)
      end
    end

copy_cached_repo() click to toggle source

    # File lib/chef/provider/deploy.rb, line 263
    def copy_cached_repo
      target_dir_path = @new_resource.deploy_to + "/releases"
      converge_by("deploy from repo to #{@target_dir_path} ") do
        FileUtils.mkdir_p(target_dir_path)
        FileUtils.cp_r(::File.join(@new_resource.destination, "."), release_path, :preserve => true)
        Chef::Log.info "#{@new_resource} copied the cached checkout to #{release_path}"
        release_created(release_path)
      end
    end

create_dirs_before_symlink() click to toggle source

    # File lib/chef/provider/deploy.rb, line 336
    def create_dirs_before_symlink
    end

define_resource_requirements() click to toggle source

    # File lib/chef/provider/deploy.rb, line 73
    def define_resource_requirements
      requirements.assert(:rollback) do |a|
        a.assertion { all_releases[-2] }
        a.failure_message(RuntimeError, "There is no release to rollback to!")
        #There is no reason to assume 2 deployments in a single chef run, hence fails in whyrun.
      end

      [ @new_resource.before_migrate, @new_resource.before_symlink,
        @new_resource.before_restart, @new_resource.after_restart ].each do |script|
        requirements.assert(:deploy, :force_deploy) do |a|
          callback_file = "#{release_path}/#{script}"
          a.assertion do
            if script && script.class == String
              ::File.exist?(callback_file)
            else
              true
            end
          end
          a.failure_message(RuntimeError, "Can't find your callback file #{callback_file}")
          a.whyrun("Would assume callback file #{callback_file} included in release")
        end
      end

    end

deploy() click to toggle source

    # File lib/chef/provider/deploy.rb, line 152
    def deploy
      verify_directories_exist
      update_cached_repo # no converge-by - scm provider will dothis
      enforce_ownership
      copy_cached_repo
      install_gems
      enforce_ownership
      callback(:before_migrate, @new_resource.before_migrate)
      migrate
      callback(:before_symlink, @new_resource.before_symlink)
      symlink
      callback(:before_restart, @new_resource.before_restart)
      restart
      callback(:after_restart, @new_resource.after_restart)
      cleanup!
      Chef::Log.info "#{@new_resource} deployed to #{@new_resource.deploy_to}"
    end

enforce_ownership() click to toggle source

    # File lib/chef/provider/deploy.rb, line 273
    def enforce_ownership
      converge_by("force ownership of #{@new_resource.deploy_to} to #{@new_resource.group}:#{@new_resource.user}") do
        FileUtils.chown_R(@new_resource.user, @new_resource.group, @new_resource.deploy_to)
        Chef::Log.info("#{@new_resource} set user to #{@new_resource.user}") if @new_resource.user
        Chef::Log.info("#{@new_resource} set group to #{@new_resource.group}") if @new_resource.group
      end
    end

link_current_release_to_production() click to toggle source

    # File lib/chef/provider/deploy.rb, line 286
    def link_current_release_to_production
      converge_by(["remove existing link at #{@new_resource.current_path}",
                  "link release #{release_path} into production at #{@new_resource.current_path}"]) do
        FileUtils.rm_f(@new_resource.current_path)
        begin
          FileUtils.ln_sf(release_path, @new_resource.current_path)
          rescue => e
            raise Chef::Exceptions::FileNotFound.new("Cannot symlink current release to production: #{e.message}")
          end
        Chef::Log.info "#{@new_resource} linked release #{release_path} into production at #{@new_resource.current_path}"
      end
      enforce_ownership
    end

link_tempfiles_to_current_release() click to toggle source

    # File lib/chef/provider/deploy.rb, line 314
    def link_tempfiles_to_current_release
      dirs_info = @new_resource.create_dirs_before_symlink.join(",")
      @new_resource.create_dirs_before_symlink.each do |dir|
        create_dir_unless_exists(release_path + "/#{dir}")
      end
      Chef::Log.info("#{@new_resource} created directories before symlinking: #{dirs_info}")

      links_info = @new_resource.symlinks.map { |src, dst| "#{src} => #{dst}" }.join(", ")
      converge_by("link shared paths into current release:  #{links_info}") do
        @new_resource.symlinks.each do |src, dest|
          begin
            FileUtils.ln_sf(::File.join(@new_resource.shared_path, src), ::File.join(release_path, dest))
          rescue => e
            raise Chef::Exceptions::FileNotFound.new("Cannot symlink shared data #{::File.join(@new_resource.shared_path, src)} to #{::File.join(release_path, dest)}: #{e.message}")
          end
        end
        Chef::Log.info("#{@new_resource} linked shared paths into current release: #{links_info}")
      end
      run_symlinks_before_migrate
      enforce_ownership
    end

load_current_resource() click to toggle source

    # File lib/chef/provider/deploy.rb, line 53
    def load_current_resource
      @scm_provider.load_current_resource
      @release_path = @new_resource.deploy_to + "/releases/#{release_slug}"
    end

migrate() click to toggle source

    # File lib/chef/provider/deploy.rb, line 191
    def migrate
      run_symlinks_before_migrate

      if @new_resource.migrate
        enforce_ownership

        environment = @new_resource.environment
        env_info = environment && environment.map do |key_and_val|
          "#{key_and_val.first}='#{key_and_val.last}'"
        end.join(" ")

        converge_by("execute migration command #{@new_resource.migration_command}") do
          Chef::Log.info "#{@new_resource} migrating #{@new_resource.user} with environment #{env_info}"
          run_command(run_options(:command => @new_resource.migration_command, :cwd=>release_path, :log_level => :info))
        end
      end
    end

purge_tempfiles_from_current_release() click to toggle source

    # File lib/chef/provider/deploy.rb, line 339
    def purge_tempfiles_from_current_release
      log_info = @new_resource.purge_before_symlink.join(", ")
      converge_by("purge directories in checkout #{log_info}") do
        @new_resource.purge_before_symlink.each { |dir| FileUtils.rm_rf(release_path + "/#{dir}") }
        Chef::Log.info("#{@new_resource} purged directories in checkout #{log_info}")
      end
    end

restart() click to toggle source

    # File lib/chef/provider/deploy.rb, line 216
    def restart
      if restart_cmd = @new_resource.restart_command
        if restart_cmd.kind_of?(Proc)
          Chef::Log.info("#{@new_resource} restarting app with embedded recipe")
          recipe_eval(&restart_cmd)
        else
          converge_by("restart app using command #{@new_resource.restart_command}") do
            Chef::Log.info("#{@new_resource} restarting app")
            run_command(run_options(:command => @new_resource.restart_command, :cwd => @new_resource.current_path))
          end
        end
      end
    end

rollback() click to toggle source

    # File lib/chef/provider/deploy.rb, line 170
    def rollback
      Chef::Log.info "#{@new_resource} rolling back to previous release #{release_path}"
      symlink
      Chef::Log.info "#{@new_resource} restarting with previous release"
      restart
    end

rollback_to(target_release_path) click to toggle source

    # File lib/chef/provider/deploy.rb, line 135
    def rollback_to(target_release_path)
      @release_path = target_release_path

      rp_index = all_releases.index(release_path)
      releases_to_nuke = all_releases[(rp_index + 1)..-1]

      rollback

      releases_to_nuke.each do |i|
        converge_by("roll back by removing release #{i}") do
          Chef::Log.info "#{@new_resource} removing release: #{i}"
          FileUtils.rm_rf i
        end
        release_deleted(i)
      end
    end

run(command, &block) click to toggle source

    # File lib/chef/provider/deploy.rb, line 62
    def run(command, &block)
      exec = execute(command, &block)
      exec.user(@new_resource.user) if @new_resource.user
      exec.group(@new_resource.group) if @new_resource.group
      exec.cwd(release_path) unless exec.cwd
      exec.environment(@new_resource.environment) unless exec.environment
      converge_by("execute #{command}") do
        exec
      end
    end

run_scm_sync() click to toggle source

    # File lib/chef/provider/deploy.rb, line 254
    def run_scm_sync
      @scm_provider.run_action(:sync)
    end

run_symlinks_before_migrate() click to toggle source

    # File lib/chef/provider/deploy.rb, line 300
    def run_symlinks_before_migrate
      links_info = @new_resource.symlink_before_migrate.map { |src, dst| "#{src} => #{dst}" }.join(", ")
      converge_by("make pre-migration symliinks: #{links_info}") do
        @new_resource.symlink_before_migrate.each do |src, dest|
          begin
            FileUtils.ln_sf(@new_resource.shared_path + "/#{src}", release_path + "/#{dest}")
          rescue => e
            raise Chef::Exceptions::FileNotFound.new("Cannot symlink #{@new_resource.shared_path}/#{src} to #{release_path}/#{dest} before migrate: #{e.message}")
          end
        end
        Chef::Log.info "#{@new_resource} made pre-migration symlinks"
      end
    end

sudo(command,&block) click to toggle source

    # File lib/chef/provider/deploy.rb, line 58
    def sudo(command,&block)
      execute(command, &block)
    end

svn_force_export() click to toggle source

    # File lib/chef/provider/deploy.rb, line 258
    def svn_force_export
      Chef::Log.info "#{@new_resource} exporting source repository"
      @scm_provider.run_action(:force_export)
    end

symlink() click to toggle source

    # File lib/chef/provider/deploy.rb, line 209
    def symlink
      purge_tempfiles_from_current_release
      link_tempfiles_to_current_release
      link_current_release_to_production
      Chef::Log.info "#{@new_resource} updated symlinks"
    end

update_cached_repo() click to toggle source

    # File lib/chef/provider/deploy.rb, line 245
    def update_cached_repo
      if @new_resource.svn_force_export
      # TODO assertion, non-recoverable - @scm_provider must be svn if force_export?
        svn_force_export
      else
        run_scm_sync
      end
    end

verify_directories_exist() click to toggle source

    # File lib/chef/provider/deploy.rb, line 281
    def verify_directories_exist
      create_dir_unless_exists(@new_resource.deploy_to)
      create_dir_unless_exists(@new_resource.shared_path)
    end

whyrun_supported?() click to toggle source

    # File lib/chef/provider/deploy.rb, line 49
    def whyrun_supported?
      true
    end

### Protected Instance Methods

create_dir_unless_exists(dir) click to toggle source

    # File lib/chef/provider/deploy.rb, line 415
    def create_dir_unless_exists(dir)
      if ::File.directory?(dir)
        Chef::Log.debug "#{@new_resource} not creating #{dir} because it already exists"
        return false
      end
      converge_by("create new directory #{dir}") do
        begin
          FileUtils.mkdir_p(dir)
          Chef::Log.debug "#{@new_resource} created directory #{dir}"
          if @new_resource.user
            FileUtils.chown(@new_resource.user, nil, dir)
            Chef::Log.debug("#{@new_resource} set user to #{@new_resource.user} for #{dir}")
          end
          if @new_resource.group
            FileUtils.chown(nil, @new_resource.group, dir)
            Chef::Log.debug("#{@new_resource} set group to #{@new_resource.group} for #{dir}")
          end
        rescue => e
          raise Chef::Exceptions::FileNotFound.new("Cannot create directory #{dir}: #{e.message}")
        end
      end
    end

current_release?(release) click to toggle source

    # File lib/chef/provider/deploy.rb, line 470
    def current_release?(release)
      @previous_release_path == release
    end

deployed?(release) click to toggle source

    # File lib/chef/provider/deploy.rb, line 466
    def deployed?(release)
      all_releases.include?(release)
    end

gem_packages() click to toggle source

    # File lib/chef/provider/deploy.rb, line 379
    def gem_packages
      return [] unless ::File.exist?("#{release_path}/gems.yml")
      gems = YAML.load(IO.read("#{release_path}/gems.yml"))

      gems.map do |g|
        r = Chef::Resource::GemPackage.new(g[:name], run_context)
        r.version g[:version]
        r.action :install
        r.source "http://gems.github.com"
        r
      end
    end

gem_resource_collection_runner() click to toggle source

    # File lib/chef/provider/deploy.rb, line 371
    def gem_resource_collection_runner
      gems_collection = Chef::ResourceCollection.new
      gem_packages.each { |rbgem| gems_collection << rbgem }
      gems_run_context = run_context.dup
      gems_run_context.resource_collection = gems_collection
      Chef::Runner.new(gems_run_context)
    end

install_gems() click to toggle source

    # File lib/chef/provider/deploy.rb, line 367
    def install_gems
      gem_resource_collection_runner.converge
    end

release_created(release_path) click to toggle source

Internal callback, called after copy_cached_repo. Override if you need to keep state externally. Note that YOU are responsible for implementing whyrun-friendly behavior in any actions you take in this callback.

    # File lib/chef/provider/deploy.rb, line 353
    def release_created(release_path)
    end

release_deleted(release_path) click to toggle source

Note that YOU are responsible for using appropriate whyrun nomenclature Override if you need to keep state externally. Note that YOU are responsible for implementing whyrun-friendly behavior in any actions you take in this callback.

    # File lib/chef/provider/deploy.rb, line 360
    def release_deleted(release_path)
    end

release_slug() click to toggle source

    # File lib/chef/provider/deploy.rb, line 363
    def release_slug
      raise Chef::Exceptions::Override, "You must override release_slug in #{self.to_s}"
    end

run_callback_from_file(callback_file) click to toggle source

    # File lib/chef/provider/deploy.rb, line 406
    def run_callback_from_file(callback_file)
      Chef::Log.info "#{@new_resource} queueing checkdeploy hook #{callback_file}"
      recipe_eval do
        Dir.chdir(release_path) do
          from_file(callback_file) if ::File.exist?(callback_file)
        end
      end
    end

run_options(run_opts={}) click to toggle source

    # File lib/chef/provider/deploy.rb, line 392
    def run_options(run_opts={})
      run_opts[:user] = @new_resource.user if @new_resource.user
      run_opts[:group] = @new_resource.group if @new_resource.group
      run_opts[:environment] = @new_resource.environment if @new_resource.environment
      run_opts[:log_tag] = @new_resource.to_s
      run_opts[:log_level] ||= :debug
      if run_opts[:log_level] == :info
        if STDOUT.tty? && !Chef::Config[:daemon] && Chef::Log.info?
          run_opts[:live_stream] = STDOUT
        end
      end
      run_opts
    end

save_release_state() click to toggle source

    # File lib/chef/provider/deploy.rb, line 459
    def save_release_state
      if ::File.exists?(@new_resource.current_path)
        release = ::File.readlink(@new_resource.current_path)
        @previous_release_path = release if ::File.exists?(release)
      end
    end

with_rollback_on_error() click to toggle source

    # File lib/chef/provider/deploy.rb, line 438
    def with_rollback_on_error
      yield
    rescue ::Exception => e
      if @new_resource.rollback_on_error
        Chef::Log.warn "Error on deploying #{release_path}: #{e.message}"
        failed_release = release_path

        if previous_release_path
          @release_path = previous_release_path
          rollback
        end
        converge_by("remove failed deploy #{failed_release}") do
          Chef::Log.info "Removing failed deploy #{failed_release}"
          FileUtils.rm_rf failed_release
        end
        release_deleted(failed_release)
      end

      raise
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.