Sha256: d4a43266d8b8e298af902309d8a8f92cb1dfc3d557e4d0757796f6184b8fcaae

Contents?: true

Size: 753 Bytes

Versions: 17

Compression:

Stored size: 753 Bytes

Contents

class Indocker::Artifacts::Git
  attr_reader :name, :remote_name, :remote_url, :branch, :source_path, :target_path

  def initialize(name:, remote_name:, remote_url:, branch:, source_path:, target_path:)
    @name        = name
    @remote_name = remote_name
    @remote_url  = remote_url
    @branch      = branch
    @source_path = source_path
    @target_path = target_path
  end

  def repository
    @repository ||= Indocker::Repositories::Git.new(@name).setup(
      remote_name: remote_name,
      remote_url:  remote_url,
      branch:      branch,
      clone_path:  "/tmp/#{Indocker.configuration.name}/artifacts/git/#{project_name(remote_url)}/#{branch}"
    )
  end

  def project_name(url)
    url.split('/').last.gsub('.git', '')
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
indocker-0.1.16 lib/indocker/artifacts/git.rb
indocker-0.1.15 lib/indocker/artifacts/git.rb
indocker-0.1.14 lib/indocker/artifacts/git.rb
indocker-0.1.13 lib/indocker/artifacts/git.rb
indocker-0.1.12 lib/indocker/artifacts/git.rb
indocker-0.1.11 lib/indocker/artifacts/git.rb
indocker-0.1.10 lib/indocker/artifacts/git.rb
indocker-0.1.9 lib/indocker/artifacts/git.rb
indocker-0.1.8 lib/indocker/artifacts/git.rb
indocker-0.1.7 lib/indocker/artifacts/git.rb
indocker-0.1.6 lib/indocker/artifacts/git.rb
indocker-0.1.5 lib/indocker/artifacts/git.rb
indocker-0.1.4 lib/indocker/artifacts/git.rb
indocker-0.1.3 lib/indocker/artifacts/git.rb
indocker-0.1.2 lib/indocker/artifacts/git.rb
indocker-0.1.1 lib/indocker/artifacts/git.rb
indocker-0.1.0 lib/indocker/artifacts/git.rb