Module: Dapp::Dapp::Deps::Gitartifact

Included in:
Dapp::Dapp
Defined in:
lib/dapp/dapp/deps/gitartifact.rb

Constant Summary collapse

GITARTIFACT_VERSION =
"0.2.1"

Instance Method Summary collapse

Instance Method Details

#git_binObject



32
33
34
# File 'lib/dapp/dapp/deps/gitartifact.rb', line 32

def git_bin
  "/.dapp/deps/gitartifact/#{GITARTIFACT_VERSION}/bin/git"
end

#gitartifact_containerObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/dapp/dapp/deps/gitartifact.rb', line 11

def gitartifact_container
  @gitartifact_container ||= begin
    is_container_exist = proc{shellout("#{host_docker} inspect #{gitartifact_container_name}").exitstatus.zero?}
    if !is_container_exist.call
      lock("dappdeps.container.#{gitartifact_container_name}", default_timeout: 600) do
        if !is_container_exist.call
          log_secondary_process(t(code: 'process.gitartifact_container_creating', data: {name: gitartifact_container_name}), short: true) do
            shellout!(
              ["#{host_docker} create",
              "--name #{gitartifact_container_name}",
              "--volume /.dapp/deps/gitartifact/#{GITARTIFACT_VERSION}",
              "dappdeps/gitartifact:#{GITARTIFACT_VERSION}"].join(' ')
            )
          end
        end
      end
    end
    gitartifact_container_name
  end
end

#gitartifact_container_nameObject

FIXME: hashsum(image) or dockersafe()



7
8
9
# File 'lib/dapp/dapp/deps/gitartifact.rb', line 7

def gitartifact_container_name # FIXME: hashsum(image) or dockersafe()
  "dappdeps_gitartifact_#{GITARTIFACT_VERSION}"
end