class PoiseApplicationGit::Resource

An `application_git` resource to clone application code from git.

@since 1.0.0 @provides application_git @action sync @action checkout @action export @example

application '/srv/myapp' do
  git 'git@github.com:example/myapp.git' do
    deploy_key data_bag_item('deploy_keys', 'myapp')['key']
  end
end

Public Class Methods

new(*args) click to toggle source

@api private

Calls superclass method
# File lib/poise_application_git/resource.rb, line 41
def initialize(*args)
  super
  # Because the superclass declares this, we have to as well. Should be
  # removable at some point when Chef makes everything use the provider
  # resolver system instead.
  @resource_name = :application_git if defined?(@resource_name) && @resource_name
  # Clear defaults in older versions of Chef.
  remove_instance_variable(:@group) if instance_variable_defined?(:@group)
  remove_instance_variable(:@user) if instance_variable_defined?(:@user)
end

Public Instance Methods

after_created() click to toggle source

@api private

Calls superclass method
# File lib/poise_application_git/resource.rb, line 63
def after_created
  # Allow using the repository as the name in an application block.
  if parent && !repository
    destination(parent.path)
    repository(name)
  end
  super
end