Class: Avocado::ScmProvider

Inherits:
Object
  • Object
show all
Defined in:
lib/avocado/scm_provider/scm_provider.rb

Overview

scm provider facade

Instance Method Summary collapse

Constructor Details

#initialize(env, scm) ⇒ ScmProvider

Initializes the scm provider

Parameters:

Raises:

  • (ArgumentError)


27
28
29
30
31
32
33
34
35
36
# File 'lib/avocado/scm_provider/scm_provider.rb', line 27

def initialize(env, scm)
  raise ArgumentError, 'env must be a TaskExecutionEnvironment' unless env.is_a?(TaskExecutionEnvironment)

  @env = env
  @real_provider = nil

  if scm == :git
    @real_provider = GitScmProvider.new(env)
  end
end

Instance Method Details

#checkout_from_remote(url, local_dir, branch) ⇒ Object

Checks out repository code from a system and switches to the given branch

Parameters:

  • url (String)

    the repository location

  • local_dir (String)

    path to the working copy

  • branch (String)

    the branch to check out



43
44
45
# File 'lib/avocado/scm_provider/scm_provider.rb', line 43

def checkout_from_remote(url, local_dir, branch)
  @real_provider.checkout_from_remote(url, local_dir, branch)
end

#cli_utilsArray

Returns scm files to be executed in the deployment process

Returns:

  • (Array)

    array of scm control files



57
58
59
# File 'lib/avocado/scm_provider/scm_provider.rb', line 57

def cli_utils
  @real_provider.cli_utils
end

#revisionArray

Returns the scm tools that have to be installed on specific systems

Returns:

  • (Array)

    array of utilities



64
65
66
# File 'lib/avocado/scm_provider/scm_provider.rb', line 64

def revision
  @real_provider.revision
end

#scm_filesString

Returns the current revision of the working copy

Returns:

  • (String)

    the current revision of the working copy



50
51
52
# File 'lib/avocado/scm_provider/scm_provider.rb', line 50

def scm_files
  @real_provider.scm_files
end