Class: Stax::Docker

Inherits:
Base
  • Object
show all
Defined in:
lib/stax/docker.rb

Instance Method Summary collapse

Instance Method Details

#buildObject

override this method with the desired builder



51
# File 'lib/stax/docker.rb', line 51

desc 'build', 'build docker image'

#existsObject



71
72
73
# File 'lib/stax/docker.rb', line 71

def exists
  puts Aws::Ecr.exists?(docker_repository, Git.sha)
end

#imageObject



46
47
48
# File 'lib/stax/docker.rb', line 46

def image
  puts docker_image
end

#loginObject



57
58
59
60
61
62
63
# File 'lib/stax/docker.rb', line 57

def 
  Aws::Ecr.auth.each do |auth|
    debug("Login to ECR registry #{auth.proxy_endpoint}")
    user, pass = Base64.decode64(auth.authorization_token).split(':')
    system "docker login -u #{user} -p #{pass} #{auth.proxy_endpoint}"
  end
end

#pollObject



76
77
78
79
# File 'lib/stax/docker.rb', line 76

def poll
  debug("Waiting for image in ECR #{docker_repository}:#{Git.sha}")
  sleep 10 until Aws::Ecr.exists?(docker_repository, Git.sha)
end

#pushObject



66
67
68
# File 'lib/stax/docker.rb', line 66

def push
  docker_push
end

#registryObject



36
37
38
# File 'lib/stax/docker.rb', line 36

def registry
  puts docker_registry
end

#repositoryObject



41
42
43
# File 'lib/stax/docker.rb', line 41

def repository
  puts docker_repository
end