Module: GithubBitbucketDeployer

Defined in:
lib/github_bitbucket_deployer.rb,
lib/github_bitbucket_deployer/git.rb,
lib/github_bitbucket_deployer/version.rb,
lib/github_bitbucket_deployer/exceptions.rb,
lib/github_bitbucket_deployer/configuration.rb

Defined Under Namespace

Classes: CommandException, Configuration, ConfigurationException, Git

Constant Summary collapse

VERSION =
'1.0.1'.freeze

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject

The configuration object.

See Also:



18
19
20
# File 'lib/github_bitbucket_deployer.rb', line 18

def configuration
  @configuration ||= Configuration.new
end

Class Method Details

.configure {|configuration| ... } ⇒ Object

Call this method to modify defaults in your initializers.

Examples:

GithubBitbucketDeployer.configure do |config|
  config.id_rsa          = ENV["ID_RSA"]
  config.logger          = Logger.new(STDOUT)
end

Yields:



29
30
31
# File 'lib/github_bitbucket_deployer.rb', line 29

def configure
  yield(configuration)
end

.deploy(options = {}, &block) ⇒ Object



33
34
35
36
37
38
# File 'lib/github_bitbucket_deployer.rb', line 33

def deploy(options={}, &block)
  options = configuration.merge(options)
  validate_options(options)
  git_push_app_to_bitbucket(options, &block)
  true
end

.git_push_app_to_bitbucket(options, &block) ⇒ Object



44
45
46
47
# File 'lib/github_bitbucket_deployer.rb', line 44

def git_push_app_to_bitbucket(options, &block)
  repo = Git.new(options)
  repo.push_app_to_bitbucket(&block)
end

.validate_options(options) ⇒ Object



40
41
42
# File 'lib/github_bitbucket_deployer.rb', line 40

def validate_options(options)
  configuration.validate_presence(options)
end